2 ms·
You can combine regexes with macros if you only wish to run your macro on a particular set of lines: :'<,'>g/foobar/norm @q will run the macro only on the
by rav 11y ago
You can combine regexes with macros if you only wish to run your macro on a particular set of lines:
:'<,'>g/foobar/norm @q
will run the macro only on the subset of selected lines that match the regex "foobar". :g/.../ will match the regex against all lines in the file.
- weaksauce 11y agoI love the g command. Very useful to quickly cull out lines of stuff that you don't want in your file. g/foobar/d