Skip to content

Instantly share code, notes, and snippets.

@kaborso
Created July 30, 2013 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaborso/6114293 to your computer and use it in GitHub Desktop.
Save kaborso/6114293 to your computer and use it in GitHub Desktop.
Put in dotfiles repo
""
"" Trailing space deletion
""
func! DeleteTrailingWS()
exe "normal mz"
%s/\s\+$//ge
exe "normal `z"
endfunc
" Configure affected file types
autocmd BufWrite *.coffee :call DeleteTrailingWS()
autocmd BufWrite *.rb :call DeleteTrailingWS()
autocmd BufWrite *.md :call DeleteTrailingWS()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment