Record, stop and replay

0 of 1

The technique

Your textVim mode: Normal
Add ! to the end of all three lines. Before: a / b / c. After: a! / b! / c!.

The macro ends with j0, so each replay starts at the beginning of the next line.

Keys in this lesson

qa
Record a macro into register a. Press q to stop.
@a
Play macro a.
@@
Play the last macro again.

Before this lesson: Insertion; positioning; repetition.

More about this lesson

Record once, account for the edit made while recording, then replay.

qa starts recording into register a; q in Normal mode stops it. @a replays that macro; @@ repeats the last macro used. Recording already performs the first edit. Include positioning for the next line and check one replay before doing many.

Example

A macro that appends a review marker, leaves Insert mode and moves down can process several notes. The first note was changed during recording; only the remaining notes need replay.

Use Reset to try again.

Guides on this topic

Exercise 1 of 1

0keys

par 22

Apply the shown suffix to the 3 current notes. Keep the archive untouched.

Your textVim mode: Normal

Desired result

// First [reviewed]
// A longer second note [reviewed]
// Third note [reviewed]
// Keep the archive unchanged.

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.