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
This doesn't directly answer your question, but you might want to take a look at the dbext plugin.
A database client inside Vim!
Quick google reveals this... don't know if it helps.
Copied here for convenience:
The voted answer is ok, but if you're encountering problems as it happened to me (I'm currently using Slackware 14.x) then editing /etc/inputrc should be your last hope.
I've tested both .inputrc and .editrc on my home, but on my system only editing /etc/inputrc worked.
These two files worked on my previous workstation (not sure of the MySQL version (my old job)). I keep my dotFiles in git.
.editrc
bind -v bind \\t rl_complete
.inputrc (several of these may or may-not be needed)
set editing-mode vi set keymap vi set meta-flag on set input-meta on set convert-meta off set output-meta on set bell-style none
Posting these because I couldn't post them in my comment above.
Also, this is not answer to your question.
You can also use Vimsql like dbext. Vimsql is more convenient way interacting with mysql than
mysql
if you love vim key map.