I just discover the magic of using vi style in bash. Immediately, I'm trying to use C-c to escape from insert mode (into what's called movement mode) as I'm used to C-c to escape to command mode in vim.
I searched around and found the command to rebind key in bash:
"bind -m vi-insert C-c:vi-movement-mode"
Then, I used "bind -P" to check the binding status and it showed:
"..."
"vi-movement-mode can be found on "\C-c", "\e"."
However, when I tried to escape from insert mode, it cleared the entire line instead (the default behavior), instead of escape to movement mode... Any thought how can I use C-c to escape from insert mode?
Thanks in advance.
You can rebind the interrupt key:
stty intr ^X
Now to interrupt something that's executing you'll have to press Ctrl-x. I don't know if changing this might have other side effects.
The reason that vim can do that is that it traps the Ctrl-c interrupt.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With