michal-h21 / vim-zettel

VimWiki addon for managing notes according to Zettelkasten method
MIT License
555 stars 72 forks source link

Make :ZettelOpen jump to correct line #120

Open kjk11 opened 2 years ago

kjk11 commented 2 years ago

For long notes it would be handy to automatically jump to the correct line with the cursor after running :ZettelOpen and selecting a note to jump to. It seems that would be a more sensible behaviour than just jumping to the beginning of the note, as it happens currently. While people who stick to the principles of Zettelkasten mostly keep short notes, people with long lists and 'info dumps' will have to either remember the line number of the matching line or (more likely) re-enter their search the usual way to get to the correct line and retrieve information. Personally, it slows my workflow down quite a bit here and there...

michal-h21 commented 2 years ago

That's a good idea. It should work now.

folofjc commented 2 years ago

Is it possible to add this for links? For instance, when inserting links with notational-fzf and selecting a word, to choose the first previous "tag" (header, etc)?

michal-h21 commented 2 years ago

That should be possible in theory, at least for the Vimwiki syntax, where you can link to anchors based on headers, etc. I can take a look at this in the future, but cannot promise that it will be soon.

folofjc commented 2 years ago

Okay, thanks this would be super helpful! Vimwiki is "in the process" of updating so that it also uses github style anchors (it is on dev branch, but not master), so I think that would also help since it could remove the spaces in header anchors.