:[range]v/{pattern}/[command]

:v/foo/d Delete lines not containing foo(also :g!/foo/d)
Comments