O'Reilly logo
  • Lukasz Wójcik thinks this is interesting:

Delete all spaces at the end of every line:

From

Cover of Learning the vi and Vim Editors, 7th Edition

Note

There is a bug in this example.
Greedy .* will match some whitespaces so they will not be removed.

It should be rather:
:%s/\ *$//