Skip to content

Instantly share code, notes, and snippets.

View nerdyness's full-sized avatar

Stefan Krist nerdyness

View GitHub Profile
@nerdyness
nerdyness / gist:10949957
Created April 17, 2014 03:01
vim shenanigans
" 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()