I work a lot in vim and the thing that frustrates me is when I have to switch to the shell, that I lose a lot of the keyboard control that vim has.
For example I have to use home and end to get to beginning and end of the line.
How do you deal with this annoyance?
According to the Bash manual, Bash natively supports a "vi-style command line editing interface". To use it, add
set -o vi
to your~/.bashrc
file.By default you'll be in input mode; press Esc to enter command mode. This cheatsheet lists the commands available to you.
Home
andEnd
in Vim too.Usually, Ctrl-A and Ctrl-E go to the beginning and end of the line, respectively. You can define any number of shortcuts in your
.inputrc
file, and even switch to vi-mode. Tryman bash
and look forREADLINE
.