ZZ Command
Marks a block of lines so you can refer to them in any command.
ZZ [ line [ / line ] | OFF ]
ZZ [ [ string range ] | OFF ]
(Q=no display)
(Default: * becomes start or end of block)
ZZ line/line marks a range of lines, while ZZ line marks the start or end of a range. ZZ marks one range only, not a rangelist. To mark a single line, say 5, use zz 5/5
.
ZZ OFF cancels the currently marked range, eliminating the half-bright display enhancement in Visual.
Examples
/zz 5/10 /change "prog"program" zz /find "procedure open" (up) /zz {mark start of block} /find "@end;~{open}@" (pattern up) /zz {mark end of block} /keep savefile zz {save block in a file} /verify zz {check current range} /zz off {cancel current range}
Notes
The marked range is remembered when you Shut and reopen the file and is adjusted for Renum operations. Use Verify ZZ or List ZZ to check the currently marked range. ZZ is also valid as a cut-and-paste operator in Visual mode.
Using a string range on a Find command automatically updates the ZZ marker. For example:
/v zz ZZ OFF /find "start"/"end" [ Lines 5/11 saved in ZZ /v zz ZZ 5/11