Last Updated: February 25, 2016
·
423
· jamesleonis

Edit the command line with Vi commands

set -o vi

This little command will give you all the power of Vi[m] while in the terminal.

By default you are in Insert mode. Hitting escape puts you into Normal mode. Going into visual mode will open up a Vim instance, including all of your plugins and aliases specified in your .vimrc file, as well as give you access to the Command mode. When you are finished, typing :wq will execute the command.

To make this a permanent part of your happiness, add the above command to your rc file.

NOTE: Your terminal will stay in the mode it ran the command in, except visual. This is especially disorienting when in the vim environment and you run with :wq, since the terminal will be in Normal mode.