1

I am using vi-editing-mode on Bash. According to man readline, there are a couple of default binding keys working on vi-editing-mode. Some keys work well, but some other default keys do not work.

For example, man readline says,

VI Command Mode functions
...
         "C-E"  emacs-editing-mode
...

But bind -p on my linux box says that 'emacs-editing-mode` is not bound on any key.

$ bind -p | grep emacs-editing
# emacs-editing-mode (not bound)

Is this a normal situation? How to turn on all default binding keys of vi-editing-mode on bash? Do I have to bind keys manually on .inputrc?

1

Bash modifies a few default readline bindings including this one. The code is in the initialize_readline function in bashline.c.

/* In Bash, the user can switch editing modes with "set -o [vi emacs]",
   so it is not necessary to allow C-M-j for context switching.  Turn
   off this occasionally confusing behaviour. */

The mode-switching keys are the only ones that are unbound. Some additional keys are bound (e.g. for bash-specific completion like M-$ to complete variable names).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.