I need to figure out a regular expression to delete all lines that do not begin with either "+" or "-".
I want to print a paper copy of a large diff file, but it shows 5 or so lines before and after the actual diff.
In VIM:
:g!/^[+-]/d
Here is the English translation:
g
lobally do something to all lines that do NOT!
match the regular expression: start of line^
followed by either +
or -
, and that something to do is to d
elete those lines.