Closed leamsi closed 1 year ago
That's strange, we had to change from regular mappings to noremap
, thanks to this PR, which fixed issue #85. I already have vim 9.0, but I think it should work in older Vim versions. Isn't it possible that there is another issue?
This is a well know issue with noremap
and <Plug>
. See for example the explanation in this reddit thread from four years ago: https://www.reddit.com/r/vim/comments/78izt4/please_help_understand_how_to_use_plug_mapping/doufox8/ or the accepted answer in this stack exchange post: https://vi.stackexchange.com/questions/31012/what-does-plug-do-in-vim . It could be they fixed this in Vim9 though.
Honestly, it seems to me that #85 should've been closed as working as intended... A lot of things are going to break if you map <Esc>
to <Nop>
like that user did, I'm actually pretty sure a lot of other plugins with insert mode mappings use <Esc>
in their mappings
A possible solution so that user can keep their <Esc>
mapping is to use recursive map
with <C-O><Plug>ZettelSearchMap
... and pray that this user hasn't mapped <C-O>
to anything :P. This will change the behavior a little bit as the user will be back in insert mode after the function returns (and I actually prefer that). I just tried that locally and it works, even with <Esc>
mapped to <Nop>
. What do you think?
Thanks for the links, it seems that you are right, and I accepted this PR.
At least in ViM (I'm still stuck on 8.2 here) it seems you cannot create a mapping from a key to a with "noremap", they need to be the regular version.