Tip67: Repeat a Change on Contiguous Lines

January 12, 2021 ยท View on GitHub

We want to make a change: tip67_1 tip67_2

Record One Unit of Work

tip67_3

0

normalizes our cursor position by placing it at the start of the line. This means that our next motion always starts from the same place, making it more repeatable.

Note: f. is more repeatability than l

Execute Macro in Series tip67_4

tip67_5

When the f. command is executed, it finds no . characters and the macro aborts.

tip67_6

Execute Macro in Parallel tip67_7

:normal @a

tells Vim to execute the macro once for each line in the selection.

Deciding: Series or Parallel Executing a macro on multiple items in parallel is more robust.

Tip66 Tip68