How can I make my shell behave like vim?

5

How can I make my shell behave like vim? I've seen other developers do it but I never got it installed/set up on my machine.

Ubuntu 11.04

Ramy

Posted 2012-10-08T19:06:54.990

Reputation: 1 005

Answers

9

Put this in your ~/.bashrc:

set -o vi

Then you can edit your command line using vi keys/commands instead of emacs keys/commands.

garyjohn

Posted 2012-10-08T19:06:54.990

Reputation: 29 085

................yes! – Ramy – 2012-10-08T19:31:50.263

1And for zsh: bindkey -v – Heptite – 2012-10-08T19:43:58.493

1

I didn't have to edit my .bashrc. I just set this on the command line.

$ set -o vi

For more info with examples and a downloadable cheat sheet please see http://www.catonmat.net/blog/bash-vi-editing-mode-cheat-sheet/

dmasi

Posted 2012-10-08T19:06:54.990

Reputation: 132