First edits and modes
The technique
i starts typing before the cursor. Esc ends the insertion and takes you back to Normal mode, where keys are commands again.
Keys in this lesson
- i
- Insert before the cursor.
- Esc
- Back to Normal mode. Also cancels a command you have started.
- hjkl
- Left, down, up, right.
- x
- Delete one character.
- r
- Replace one character with the next one you type.
Before this lesson: Start here: Your first Vim edit.
More about this lesson
Enter and leave Insert mode; move to a character and correct it.
Normal mode gives keys commands; Insert mode gives them text. i inserts before the cursor; Esc completes the insertion. h/j/k/l move left/down/up/right. x removes the character under the cursor. r followed by a character replaces just that character and stays in Normal mode.
Example
From the p in “plan”, i then “A ” then Esc makes “A plan”. From the a in “plam”, move right with l and type rn to repair the final letter. Watch the mode label before typing.
Use Reset to try again.