michal-h21 / vim-zettel

VimWiki addon for managing notes according to Zettelkasten method
MIT License
557 stars 73 forks source link

Better interface to find backlinks using fzf #80

Open mickael-menu opened 3 years ago

mickael-menu commented 3 years ago

Not an issue, so feel free to close when you see fit.

I just wanted to share some useful mapping which can replace the subpar :VimwikiBacklinks, using notational-fzf-vim:

nmap gB :NV \(<C-R>=expand("%:t:r")<CR>\)<CR>

This will open an fzf search window restricted to all the files containing (<current filename without extension>). The nice thing is that you can see previews of the Zettels, and filter further the list by entering other keywords.

This works for Markdown-style links, but you can customize it. The important bit inserting the filename is <C-R>=expand("%:t:r")<CR>, remove :r if you want to keep the file extension.

Use :NV! to see the preview window in fullscreen.

illus0r commented 3 years ago

@mickael-menu Thanks for the advice! You helped me to overcome a problem I had been struggling with for a long time

I removed \) to search for links with or without .md extention:

nmap gB :NV \(<C-R>=expand("%:t:r")<CR>\)<CR>
↓
nmap gB :NV \(<C-R>=expand("%:t:r")<CR><CR>