I’ve narrowed this problem down to this one line. If I add neovim as default editor my bindkey setting for zsh autosuggest-accept gets wiped (bindkey -L shows no mapping for it). If I remove that one line, leaving all the rest of my neovim config, the key bind works properly. I can’t imagine why this is the case. Anyone?
That’s expected by zsh’s design; see man zshzle
:
If one of the
VISUAL
orEDITOR
environment variables contain the stringvi
when the shell starts up then it will beviins
, otherwise it will beemacs
.bindkey
’s-e
and-v
options provide a convenient way to override this default choice.
2 Likes
While I’m still not fully clear on what’s happening that is a very good clue. Thank you! I’ll do testing to see if I can determine the difference between these modes (viins and emacs). The way I’ve fixed it for now is I just added another bindkey statement to my .zshrc and that works. I would like to understand what’s going on under the covers here though.
Yes, that’s exactly what the manpage recommends, if you don’t want to rely on zsh’s implicit handling.