Skip to content

Files

Latest commit

 

History

History
21 lines (14 loc) · 940 Bytes

tip68.md

File metadata and controls

21 lines (14 loc) · 940 Bytes

Tip68: Append Commands to a Macro

Sometimes we miss a vital step when we record a macro. There's no need to re-record the whole thing from scratch. Instead, we can tack extra commands onto the end of an existing macro. tip68_1

We realize that we should have finished by pressing j to advance to the next line.

Before we fix it, let's inspect the contents of register a: tip68_2

qa

Vim will record our keystrokes, saving them into register a by overwriting the existing contents of that register.

qA

Vim will record our keystrokes, appending them to the existing contents of register a.

tip68_3

Discussion We can use this tech only to tack commands on at the end of a macro. If you want to add something at the beginning or somewhere in the middle of a macro, this technique would be no use to you!