During my last talk at the ruby underground last week, one of the biggest “aha” moments for the crowd was one I did not anticipate.
I switched to command line mode to explain something and mentioned how cool it was that I am using vim key bindings to edit the command line text. I simply press Esc to start moving around using b or w , then I can use “cow” to edit a current word on the command line etc..
Someone mentioned that was the one thing that made the talk worthy coming to for him.
To make this happen, I was using a .zshrc file from astrails.
but the magic is very simple to accomplish. by default you probably have emacs style key bindings in your command line. but if your’e a vim fan (as were the astrails guys I interned with for 6 months) you can change your .zshrc file to add this little line:
if you’re in bash instead of zsh you can use
set -o vi
that’s it. next time you load a command shell you can Esc away and use vim key bindings.