Created
September 22, 2015 07:49
-
-
Save plucury/84f600640593a3e3eae8 to your computer and use it in GitHub Desktop.
Delete trailing white space on save
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
" Delete trailing white space on save, useful for Python ;) | |
augroup DeleteTrailing | |
autocmd BufWrite *.py :call DeleteTrailingWS() | |
augroup END | |
" Delete trailing whitespaces | |
func! DeleteTrailingWS() | |
exe "normal mz" | |
%s/\s\+$//ge | |
exe "normal `z" | |
endfunc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment