Joseph Scott

The basic approach to deleting all lines that match a pattern in Vim is very simple:

 :g/[pattern]/d  

If you want to do more, you can switch modes. Here is how you would delete all the lines matching a pattern, along with the line below each match:

 :g/[pattern]/normal 2dd