Created
December 7, 2011 13:24
-
-
Save andreapavoni/1442780 to your computer and use it in GitHub Desktop.
vim: clear whitespaces when saving buffer
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
" clear whitespaces when saving buffer | |
" put it in your .vimrc | |
function! Clear_whitespaces() | |
ma a | |
:%s/\s\+$//e | |
'a | |
endfunction | |
autocmd BufWritePre * :call Clear_whitespaces() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment