Skip to content

[set -o vi] what's the easiest way to cancel the current entered command? Control-C does not work #510

Answered by akinomyoga
jmlucjav asked this question in Q&A
Discussion options

You must be logged in to vote

Control-C is supposed to work by default if you use the emacs editing mode. If you use the vi editing mode, the way to configure it is described here and here.


To quote them,

(Normal/insert mode) C-c: cancel / discard-line

The default mapping of C-c is vi_imap/normal-mode-without-insert-leave (in vi_imap), vi-command/cancel (in vi_nmap).
If you instead want to discard the current line and go to the next line, you can bind C-c to 'discard-line':

ble-bind -m vi_imap -f 'C-c' discard-line
ble-bind -m vi_nmap -f 'C-c' discard-line

ble.sh/blerc.template

Lines 1217 to 1224 in 32f290d

## The default mapping of C-c is vi_imap/normal-mode-without-insert-leave
## (imap), v…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jmlucjav
Comment options

Answer selected by jmlucjav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants