How can I copy lines that is matches a pattern to another line, within a selected part of the document. I can do it for whole document with :g/\s*$data/co24 but I couldn’t figure out how to apply this function to only a selected part of a document.
How can I copy lines that is matches a pattern to another line, within
Share
You can apply a range to the
goperator. For example, you can useVto select a section of your document, then type:, which will get you:Then you can add your
gcommand:You can also apply the range numerically, like this:
(This would apply the
goperation to lines 100-150). You can also apply a range using the search operator, like this:This would apply the
goperation to lines between a match forstartand a match forstop.