Created
July 28, 2011 16:22
-
-
Save fzero/1111866 to your computer and use it in GitHub Desktop.
Vim: Remove trailing blanks from all lines in a file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Removes trailing spaces | |
function TrimWhiteSpace() | |
%s/\s*$// | |
'' | |
:endfunction | |
" Associates it with F2 key | |
map! <F2> :call TrimWhiteSpace()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment