In vim I can delete all lines that contain the word "price" with this
How can I delete all lines that do NOT contain the word "price"?
You can use
to delete every line that doesn't contain "price"
You can also use:
to delete lines.
is another option that can be considerably faster than
:v for large files.
Tested on Vim 7.4, Ubuntu 14.04, 1M line log file.