Removing trailing whitespace with VIM regular expressions
04 Feb
Posted by matt
in oneliner, textmate, vim
While cleaning up old sourcecode that I wrote with TextMate, I'm finding many cases where TextMate left trailing whitespace. To keep with current coding conventions, I am removing these extra spaces.
Here's a quick way to do this in VIM:
:%s/\s\+$//g
This tells VIM to search the entire document for lines that end with one or more whitespace characters. Any matching spaces will be removed.








