The ex command
:g -global command, is very useful for acting on lines that match a pattern.
Usually it works like this:
To delete all lines that contain "price" you can use:
If you want to use multiple pattern you can use 'or'
To delete lines that does NOT contain "price" you can use:
Or deleting all lines that are empty or that contain only whitespace:
Deletes any trailing whitespace at the end of each line. If no trailing
whitespace is found nothing changes, and the
e flag means no error is
displayed. Since if nothings is found
E486: Pattern not found error occurs.
:g/^<language comment string>/d
E.g for python: