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

Delete all spaces at the end of every line:


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


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

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