the superior text editor

Find and replace

:g/foo/d Delete all lines matching foo

:g!/foo/d Delete all lines not matching foo