Tip30: Run Normal Mode Commands Across a Range

January 12, 2021 ยท View on GitHub

:normal

run a Normal mode command on a series of consecutive lines.

tip30_1 tip30_2

Note: we can use :normal to execute any Normal mode commands.

:%normal A;

append a semicolon at the end of every line of the file.

:%normal i//

comment out an entire file.

Tip29 Tip31