Pergunta

With emacs mode the following works:

"(": "\C-v()\e[D"

But if you add the following at the beginning:

set editing-mode vi

it does not work anymore. Any solutions?

Also, where can I find a good reference for editing inputrc file?

Foi útil?

Solução

Adding the following into ~/.inputrc solves the problem:

set editing-mode vi
set keymap vi-insert
"\C-b": backward-char
"(": "\C-v()\C-b"
"[": "\C-v[]\C-b"
"{": "\C-v{}\C-b"
"\"": "\C-v\"\C-v\"\C-b"
"\047": "\C-v\047\C-v\047\C-b"

or in ~/.bashrc:

set -o vi
bind -m vi-insert '"(" "\C-v()\ei"'
bind -m vi-insert '"[" "\C-v[]\ei"'
bind -m vi-insert '"{" "\C-v{}\ei"'
bind -m vi-insert '"\"" "\C-v\"\C-v\"\ei"'
bind -m vi-insert '"\047" "\C-v\047\C-v\047\ei"'
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top