Tip 65 Record and Execute a Macro

Practical Vim, Second Edition — by Drew Neil (93 / 171)

Macros allow us to record a sequence of changes and then play them back. This tip shows how.

Many repetitive tasks involve making multiple changes. If we want to automate these, we can record a macro and then execute it.

Capture a Sequence of Commands by Recording a Macro