programs.neovim.defaultEditor=true kills bindkey for autosuggest-accept in zsh

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 or EDITOR environment variables contain the string vi when the shell starts up then it will be viins, otherwise it will be emacs. 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.