Created
April 17, 2014 03:01
-
-
Save nerdyness/10949957 to your computer and use it in GitHub Desktop.
vim shenanigans
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() | |
:let l:winview = winsaveview() | |
%s/\s*$// | |
call winrestview(l:winview) | |
endfunction | |
au FileWritePre * :call TrimWhiteSpace() | |
au FileAppendPre * :call TrimWhiteSpace() | |
au FilterWritePre * :call TrimWhiteSpace() | |
au BufWritePre * :call TrimWhiteSpace() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment