zsh-vi-mode
zsh-vi-mode copied to clipboard
How to map ctrl-c to go to quit insert mode
how can I use ctrl+c to quit insert mode and go to normal mode
that doesn't work I tried ZVM_VI_INSERT_ESCAPE_BINDKEY=^c bindkey -M viins '^c' vi-cmd-mode
Hello, I still have the problem, is there any solution?
For anyone having this issue, you can leverage hooks to set ctrl-c as the escape key only when editing and still be able to send SIGINTs when a command is running. Here's an example:
precmd() {
# Set SIGINT to ctrl-e while editing a command
stty intr \^E
}
preexec() {
# Now set it to ctrl-c when a command is running
stty intr \^C
}
ZVM_VI_INSERT_ESCAPE_BINDKEY=^C