Given a word list, I would like to delete all lines that do not have a specific content.
For illustration, In the following list, I would like to delete all lines that do not end in s
.
bird
chairs
dogs
cars
cat
elephant
elephants
After running the macro, the new list should be
chairs
dogs
cars
elephants
Does it matter that I am looking for a single character? If it does, then delete lines not ending in rs
which would yield the following new list.
chairs
cars
:h :global
and:h :vglobal
? Either would work, just depends on which pattern you use. The latter is the easier one for your particular case.