Using Vi Mode Everywhere

By eric

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:

set -o vi

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:

$ echo "bind -v" >> ~/.editrc
$ echo "set editing-mode vi" >> ~/.inputrc

Follow My Travels

Buy My Book


  • 2020
  • 2019
  • 2017
  • 2014
  • 2013
  • 2012
  • 2011
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006

New Posts By Email