Bash in vi mode: view shell history with cursor up / down, cursor position not at the end?

I really love vim and really would like to improve my bash experience with vi-mode. Be that as it may, I'm so used to emacs behavior that when viewing the shell history with the up / down cursor, the cursor is at the end of the line.

In vi mode, it's the other way around; the cursor is always positioned at the beginning of the line. It really burned out in the brain to wait for the cursor at the end, using bash in emacs mode for ... too long.

Any opportunity to get the default cursor position at the end of a line in bash vi-mode when viewing shell history?

+3
source share
2 answers

:

bind -m vi-command '"\201": previous-history'
bind -m vi-command '"\202": next-history'
bind -m vi-command '"\203": end-of-line'
bind -m vi-command '"\e[A": "\201\203"'
bind -m vi-command '"\e[B": "\202\203"'

, , . j/k, , . , .

, . . , , vi-insert vi-command .

+5

, , bash ( readline, ).

Shift-A , , ?

emacs, , - , vi . , , : -)

+4

Source: https://habr.com/ru/post/1708021/


All Articles