Ex command :v to the rescue!

:v/pattern/d

Using :g! will give you the same result as using :v.
:g finds lines that do match a pattern.

I had a large list of locations. I wanted to keep only the locations containing hyphens and delete the rest so I used this: :v/-/d

:v – find lines not matching your pattern
d – delete matches


Recently Loved Articles