about

writing

contact

Using Vi Mode Everywhere

By eric

2011-03-15

Not literally everywhere, but more places than usual. I have been looking for this solution for a long time and finally found it. Anyone who has ever worked around me knows that I do basically everything in Vi.
Not only do I use it to edit files, but I use it as an IDE for development (even on my Mac instead of Textmate). So the natural extension is for me to use it in the command prompt as well. So in my .bashrc file, I have the line:

1

set-ovi

This allows me to navigate the bash console with the usual vim suspects: h, j, k, l. In addition to that, I also get some fun ones like word movement w and the dw that goes along with it.

But the big winner for me is now I am able to use the vim environment and movement keys inside the irb (Ruby), Mongo, MySQL consoles (still not Redis though). To do that, just add the following lines to the following files: