Using VIm’s „:v“ to Delete All Lines NOT Containing a Pattern

Addendum to my previous post

Using VIm’s „Negative Lookahead“ to Delete All Lines NOT Containing a Pattern

I received a message from a reader who goes by the name of „bw1“ who points out that my task „to delete all lines in the current file not containing the string foo“ can easily be accomplished by issuing this command

:v/foo/d

🙂 I should read the VIm documentation once in a while!

Imprint RSS