michal-h21 / vim-zettel

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

ZettelSearch and insert mode #128

Open rcmosher opened 2 years ago

rcmosher commented 2 years ago

ZettelSearch doesn't handle remaining in insert mode well. First, if it's run from a mode other than insert mode, it still goes in to insert mode afterward. Second, at least in markdown format, the cursor ends up inside the link instead of after it. E.g. [LinkedZettel](123456-123456-12\)

For the first it would be nice to have an option which could be used for normal mode mappings to not enter insert mode after ZettelSearch

For the second, the last line of zettel#fzf#wiki_search could be call feedkeys("ea", "n"). Though I don't know if that would break other formats.

rcmosher commented 2 years ago

My suggestion for placing the cursor outside the link is bad. And it looks like it may not be necessary. I upgraded to Vim 9 and the issue seems to have gone away.

I discovered this while starting a pull request. It may still be worth considering since it removes some extraneous characters and logic. But I decided to pause on it after being surprised by the issue going away for me. Changes in my branch