yank notelink

This commit is contained in:
Rene Schallner
2021-11-22 12:24:18 +01:00
parent bc8776cf9e
commit 3d0533ba73
3 changed files with 17 additions and 1 deletions

View File

@@ -193,6 +193,19 @@ FollowLink = function(opts)
end
--
-- YankLink:
-- -----------
--
-- Create and yank a [[link]] from the current note.
--
YankLink = function()
local title = '[[' .. path_to_linkname(vim.fn.expand('%')) .. ']]'
vim.fn.setreg('"', title)
print('yanked ' .. title)
end
--
-- GotoToday:
-- ----------
@@ -335,6 +348,7 @@ local M = {
new_note = CreateNote,
goto_thisweek = GotoThisWeek,
find_weekly_notes = FindWeeklyNotes,
yank_notelink = YankLink,
}
return M