DEV Community

Discussion on: The "dot" Command in Vim

Collapse
 
blayne profile image
b-layne

Macros are great if you want to repeat commands every now and then, but I find norm to be more convient for editing consecutive lines plus it's much faster over many lines.

:%norm A;

Will add a semicolon to the end of every line. Norm can be combined with other movement commands like:

:1,4norm f ;d0x

For the first 4 lines (or next 4 lines depending on what line mode you are in) deletes from the the second space to the beginning of a line then deletes the space.