Say I'm editing a file with 1000 lines.
I want to leave lines 1-500 intact.
But I want to delete all lines after line 500 that match "ABC"
How can i do this?
I can do all the lines on the line
:g/ABC/d
And I can delete all rows in a range
:501,$d
But how to remove only lines matching the pattern?
(I have been using vi since 1989. I just can't think how to do this! Sorry if this is obvious)
source share