While inserting text, you may type as many lines as you wish (pressing
the Enter key after each, of course), and you may correct mistakes
using the Backspace key. To end edit mode and return to command mode,
press the Esc key).
While in command mode, you can use the arrow keys to move around the
file. Alternatively, you may use h,
j, k, and l,
which move the cursor left, down, up, and right, respectively.
There are several ways to insert text other than using the
i command. The a command (for
"append") inserts text after the
current cursor position. For example, use the left arrow key to move
the cursor between the words good and men:
Now is the time for all good men to come to the aid of the party.
~
~
~
~
~
Press a, type wo, and then press
Esc to return to command mode:
Now is the time for all good women to come to the aid of the party.
~
~
~
~
~
To open a line below the current one and begin inserting text, use
the o command. Press o and type another line or two:
Now is the time for all good women to come to the aid of the party.
Afterwards, we'll go out for pizza and beer.
~
~
~
~
Remember that at any time you're either in command mode (where
commands such as i, a, or o are valid) or in
edit mode (where you're inserting text, followed by Esc to
return to command mode). If you're not sure which mode you're in,
press Esc. This takes you out of edit mode, if you are in it, and
does nothing except beep if you're already in command mode.