Using Vi Mode Everywhere

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
Posted in Tips. Tags: , . 4 Comments »
  • Tejaswi Nadahalli

    Have you tried vimperator? Esp. the ‘f’ key.

  • Rob Benwell

    “vimperator” what about this?

  • Papi Chullo

    setting up a blog
    blog traffic

  • Fire Storm

    I just had to register just to reply…..

    THANK YOU THANK YOU THANK YOU! I’ve been looking for this for YEARS!!!

    That’s the most awesome thing I’ve found in a long time. php console, mysql console, bash console, OH MY!

    Thanks! Nice post!