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.
|
- `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
|
- `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
|
- `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
|
- `install_daily_finder()` : installs the daily finder tool used by the plugin
|
||||||
- `setup(opts)`: used for configuring paths, file extension, etc.
|
- `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
|
-- find the file linked to by the word under the cursor
|
||||||
--
|
--
|
||||||
follow_link = function(opts)
|
follow_link = function(opts)
|
||||||
|
vim.cmd('normal yi]')
|
||||||
|
local word = vim.fn.getreg('"0')
|
||||||
builtin.find_files({
|
builtin.find_files({
|
||||||
prompt_title = "Follow link to note...",
|
prompt_title = "Follow link to note...",
|
||||||
cwd = zkcfg.home,
|
cwd = zkcfg.home,
|
||||||
default_text = vim.fn.expand("<cword>"),
|
default_text = word,
|
||||||
find_command = { zkcfg.daily_finder },
|
find_command = { zkcfg.daily_finder },
|
||||||
entry_maker = zk_entry_maker,
|
entry_maker = zk_entry_maker,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- find_notes:
|
-- find_notes:
|
||||||
--
|
--
|
||||||
|
|||||||
Reference in New Issue
Block a user