This page has moved to vi cheat sheet


vi has 2 modes, command mode and insert mode. In command mode, everything you type is a command, in insert mode what you type is written to the screen (file buffer). vi starts in command mode. The more complex commands start with : and appear at the bottom of the screen, you need to press ENTER to execute them.

To enter insert mode you can press:

To exit command mode you press ESCAPE

To move around in command mode you can use the arrow keys in modern vi implementation. Otherwise the keys to move around are:

Other useful movement commands

Some editing commands. They can be prepended by a number of times to repeat the command, i.e. 4dd will cut 4 lines.

File commands (remember to follow by ENTER)

Other miscelaneous commands

I personally recommend the use of vim, which gives you many useful features over simple vi such as:


Ignacio Solis - [ @igso ] [ @ucsc ] [ @sluglug ] [ knowledgebase ] [ blog ]
Mail any questions or comments to isolis @ igso.net
Last updated Mar 31, 2004