Wednesday, February 25, 2009

vim: how to delete lines matching regex


I recently wanted to delete all lines which matched a regex somewhere in the line. Here's the easy way to do it in vim:

:g/pattern/d


2 comments:

Mutuelle sante said...

Thanks a ton it was a fantastic help, now to delete lines matching regex is without a doubt simple utilizing your guidance. Thank you

rr said...

you're welcome!