Skip to content

Instantly share code, notes, and snippets.

@ThiefMaster
Created January 1, 2013 22:09
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 ThiefMaster/4430411 to your computer and use it in GitHub Desktop.
Save ThiefMaster/4430411 to your computer and use it in GitHub Desktop.
" Remove trailing whitespace
fun! StripTrailingSpaces()
if (&ft=='markdown')
finish
endif
normal ms
%s/\s\+$//e
call histdel("/", -1)
normal `s
endfun
au BufWrite * call StripTrailingSpaces()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment