Created
July 28, 2013 02:10
-
-
Save kyletolle/6097061 to your computer and use it in GitHub Desktop.
Automatically strip trailing whitespace from files within files in VIM.
This file contains 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
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" Automatically strip trailing whitespace from lines within files | |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
autocmd BufWinEnter,BufRead,InsertLeave,BufEnter * call RemoveTrailingWhitespace() | |
function! RemoveTrailingWhitespace() | |
silent! execute '%s/\s\+$//g' | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment