Recover and cancel
The technique
Everything typed between i and Esc is one change, so one u removes all of it.
Keys in this lesson
- u
- Undo the last change.
- Ctrl-r
- Redo it.
- Esc
- Back to Normal mode. Also cancels a command you have started.
- 0
- Start of the line.
Before this lesson: First edits and modes.
More about this lesson
Undo a complete change, redo it, and cancel a pending command without damaging text.
u undoes one change in Normal mode. Ctrl-r redoes an undone change; it is different from the platform Reset shortcut. Esc cancels a pending operator such as d and leaves Insert mode. After undo or redo, recheck the cursor position; 0 reaches the line start. A number before l moves that many characters right; 3l is three steps. Reset restores this drill’s starting state and starts a new attempt; it does not undo your saved course progress.
Example
If you insert “wrong ” before “note”, Esc then u removes the whole insertion. Ctrl-r brings it back. To abandon a pending d before giving it a motion, press Esc. Then make the edit you intended.
Use Reset to try again.