mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 06:14:23 -05:00
fixed follow link
This commit is contained in:
@@ -56,7 +56,7 @@ The plugin defines the following functions.
|
||||
- `find_daily_notes()` : find daily notes by date (file names, sorted, most recent first), via Telescope. If today's daily note is not present, it will be created with a hardcoded template.
|
||||
- `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 word under cursor and open a Telescope file finder with it: selects note to open (incl. preview)
|
||||
- `follow_link()`: take text between brackets (linked notes) and open a Telescope file finder with it: selects note to open (incl. preview)
|
||||
- `install_daily_finder()` : installs the daily finder tool used by the plugin
|
||||
- `setup(opts)`: used for configuring paths, file extension, etc.
|
||||
|
||||
|
||||
@@ -109,15 +109,19 @@ end
|
||||
-- find the file linked to by the word under the cursor
|
||||
--
|
||||
follow_link = function(opts)
|
||||
vim.cmd('normal yi]')
|
||||
local word = vim.fn.getreg('"0')
|
||||
builtin.find_files({
|
||||
prompt_title = "Follow link to note...",
|
||||
cwd = zkcfg.home,
|
||||
default_text = vim.fn.expand("<cword>"),
|
||||
default_text = word,
|
||||
find_command = { zkcfg.daily_finder },
|
||||
entry_maker = zk_entry_maker,
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- find_notes:
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user