In zsh with vi bindings, I want to leave insert mode not only using Esc
but also using Ctrl-c
. I tried this as suggested in another answer.
bindkey -M viins '^C' vi-cmd-mode
Pressing Ctrl-c
still just creates a new prompt below the last one. How can I bind to Ctrl-c
in insert mode in zle?
Zsh has no
vim` bindings, it hasvi
bindings. There is nothingvim
-specific (as far as I know) about them.vi
and only know standardvi
. The only reason I usevim
today is because it's the most conveniently availablevi
variant that isn't totally broken by Unicode and such; but I have to usevim
's compatible mode because otherwise it greatly breaks my expectations.C-c
handling is already hilariously complicated, as the shell process is actually reacting to anINT
signal that may or may not be blocked depending on what the shell is doing at that moment.zsh
actually does support some vim(-like) features, such as text objects and visual mode.