When in Readline apps with vim mode enabled in ~/.inputrc (set editing-mode vi
) is there a way to bind the <Up>
arrow key in vi-insert
mode? To display previous history item, for example. It seems I have to press ESC key first, only then it works.
Here's my attempt at making it work (~/.inputrc):
$if mode=vi
# INSERT MODE
set keymap vi-insert
"\e[A": history-search-backward # up-arrow
"\e[B": history-search-forward # down-arrow
Also note, that when I press Ctrl+v
and then <Up>
, it prints ^[[A
.
I did manage to have it working like I want in zsh: http://paulgoscicki.com/archives/2012/09/zsh-vi-mode-with-emacs-keybindings/