Recover and cancel

0 of 3

The technique

Your textVim mode: Normal
Type the wrong word, undo it, then type the right one. Before: note. After: careful note.

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.

Guides on this topic

Exercise 1 of 3

0keys

par 19

Try a mistaken insertion, undo it, then add “Careful ” before Calm.

Your textVim mode: Normal

Desired result

const message = "Careful Calm work";

Yours

Par

Keyboard shortcuts
Ctrl+Enter
Check the result
Ctrl+Alt+U
Undo the last change
Ctrl+Alt+H
Show the next hint
Ctrl+Alt+R
Reset the exercise
Ctrl+Alt+P
Previous exercise
Ctrl+Alt+N
Next exercise
Enter
After a solve: the next step

Ctrl+Alt shortcuts leave Vim's own keys alone. On a Mac, Control and Option.