Search This Blog

Sunday, October 13, 2019

Remove lines using vim

To remove all the lines in vim that contain certain string execute:
:g/string/d

To do the opposite i.e remove the lines that do not contain certain string execute:
:v/string/d