How to get vi keybindings to work in mysql client?

dan picture dan · Feb 7, 2010 · Viewed 7.2k times · Source

I have vi bindings working in my bash shell using set -o vi in my .bash_profile. But I can't seem to get them to work in the mysql command line client. I only get emacs style bindings. How do you do this?

I also put these lines in my .inputrc, but to with no effect:

set editing-mode vi
set keymap vi

Answer

John Weldon picture John Weldon · Feb 7, 2010

Quick google reveals this... don't know if it helps.

Copied here for convenience:

Add the following on OS X 10.5:

$ cat .editrc
bind -v

This will work for OS X 10.4 and other operating systems:

$ cat .inputrc
set editing-mode vi