Skip to content

Instantly share code, notes, and snippets.

@sgharms
Created April 5, 2012 06:33
Show Gist options
  • Save sgharms/2308471 to your computer and use it in GitHub Desktop.
Save sgharms/2308471 to your computer and use it in GitHub Desktop.
function! s:ScourgeWhitespace(flag)
if ( a:flag ==# "!" )
echo "Killing whitespace with fire..."
else
echo "Gently helping you to remove whitespace..."
execute "s/\ \+$//gc"
endif
endfunction
command! -bang ScourgeWS call s:ScourgeWhitespace('<bang>')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment