mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 06:14:23 -05:00
yank notelink
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
# Backlog
|
||||
|
||||
- extend markdown syntax highlights for [[links]]
|
||||
- maybe choose template in create note
|
||||
|
||||
## Dones
|
||||
- [x] yank notelink
|
||||
- [x] extend markdown syntax highlights for [[links]]
|
||||
- [x] avoid creating new note in home dir when following link to daily or weekly
|
||||
- [x] get rid of `daily_finder.sh`
|
||||
- [x] find weekly note
|
||||
|
||||
@@ -101,6 +101,7 @@ The plugin defines the following functions.
|
||||
- `search_notes()`: live grep for word under cursor in all notes (search in notes), via Telescope
|
||||
- `insert_link()` : select a note by name, via Telescope, and place a `[[link]]` at the current cursor position
|
||||
- `follow_link()`: take text between brackets (linked note) and open a Telescope file finder with it: selects note to open (incl. preview) - with optional note creation for non-existing notes, honoring the configured template
|
||||
- `yank_notelink` : yank a link to the current note, ready to paste
|
||||
- `setup(opts)`: used for configuring paths, file extension, etc.
|
||||
|
||||
To use one of the functions above, just run them with the `:lua ...` command.
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user