Delete lines matching a pattern in VimEdit
Deleting matching lines
For example, to delete all lines starting with a #
(ie. Ruby comments starting in column 0):
:g/^#/d
Deleting non-matching lines
To delete non-matching lines we substitute g!
or v
for g
:
:g!/^#/d
Or:
:v/^#/d