Starting Vi

Since Vi begins in command mode, generally the first thing a person learns is how to enter insert mode. Press i (lower case I), and begin typing. For example: iThis is my first line of text. You can type as much as you like, pressing Enter to break lines, and Backspace to correct mistakes. During insert mode, the letter keys work exactly as in any other editor. If you typed the text above, your editor should show:


This is my first line of text.

To return to command mode, press Esc. All of the keys return to their ``editing'' functions. For example, you can check that the letter b moves the cursor back one word at a time. Similarly the letter w moves the cursor forward by words. The arrow keys should work (which is not always true during insert mode for many Vi editors).

General practice is to enter command mode for cursor movement or editing and then return to insert mode. For example, we could use b and w to move the cursor to the beginning of the word ``text'' and type iplain Esc to insert the word ``plain'' before returning to command mode.