How to get vi keybindings in bash and the MySQL client

11 Dec 2016 19:22 | vim | bash | mysql | linux

The vim keybindings are wonderful once you get used to them.

What some people don't know is that the same keybindings are available in other
programs, for example bash has a "vi mode" which can be enabled with:

set -o vi

Once enabled you can hit escape and get the familiar keybindings to edit the
commandline.

The MySQL client also has a vi mode which can be enabled by placing the following
into your ~/.inputrc:

set editing-mode vi


With these tricks the power of vim need not be constrained solely to the editor.