Today I Learned

hashrocket A Hashrocket project

:vglobal helps you find all the other lines

Given a file like:

cat
dog
elephant
dog
mouse

You may want to delete all lines that are not 'dog'

:v/dog/d.

Will find all the lines that are NOT dog, and delete them.

:v is short for :vglobal, also equivalent to :g!

See More #vim TILs
Every developer at Hashrocket is a Vim expert. Check out our development environment, Dotmatrix, and if you are in Chicago, come to the Vim Chicago Meetup hosted at our Chicago office.