Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When using the MySQL command line interface, is there any way to get it to let you use vi command editing keys instead of emacs?

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

The MySQL command line interface uses readline to edit a command line.

Create a file ~/.inputrc with the following content to use vi mode:

$if mysql
set editing-mode vi
$endif

Of course, if you want to use vi mode in all applications (including e.g. bash) that use readline, you can leave out the $if & $endif ... lines...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.