Apply a macro to every line in a selected range.

Section: Macros

Run a macro over a range

vim
vim
:'<,'>normal @q
Explanation

A very efficient way to transform multiple lines using one recording.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Macros
Record a macro
Start recording keystrokes into a register.
OpenIn sheetvimsame section
Play a macro
Execute a recorded macro once or many times.
OpenIn sheetvimsame section
Repeat last macro
Run the last-executed macro again.
OpenIn sheetvimsame section
Substitute inside visual selection
Restrict replacement to a selected range.
OpenIn sheetvim2 tag match
Search forward
Find the next match after the cursor.
OpenIn sheetvim1 tag match
Substitute on current line
Replace matches only on the current line.
OpenIn sheetvim1 tag match