Created
July 19, 2012 12:16
-
-
Save adri/3143450 to your computer and use it in GitHub Desktop.
Remove trailing whitespace in VIM
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 | |
autocmd FileWritePre * :call TrimWhiteSpace() | |
autocmd FileAppendPre * :call TrimWhiteSpace() | |
autocmd FilterWritePre * :call TrimWhiteSpace() | |
autocmd BufWritePre * :call TrimWhiteSpace() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment