Wednesday, August 26, 2009

vim: keep or delete lines matching a pattern

This is similar to a grep on the local buffer. To delete all lines matching a certain regular expression pattern, use
To do the opposite, i.e. only keep those lines matching the pattern, use
And to only temporarily print matching lines, use

1 comment:

Anonymous said...

If you want to strip out string OR string1 OR string2 etc, it'll look something like: