I add these following lines to ~/.inputrc
and now the Postgres client, psql, uses Vim keybindings.
set keymap vi
set editing-mode vi
However, this does not work for MySQL. I understand that MySQL no longer uses readline and instead uses editline. I've tried adding the above to ~/.editrc
but it still doesn't work.
How can I get Vim key bindings with MySQL?
I'm on Mac OS X 10.9.5 with MySQL 5.6.21 installed via Homebrew.
Best Answer
Turns out I needed
bind -v
in my~/.editrc
. Now it works!