Skip to content

Instantly share code, notes, and snippets.

@frogonwheels
Created August 27, 2010 02:02
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save frogonwheels/552638 to your computer and use it in GitHub Desktop.
" Make sure trailing spaces are removed before write
fun! s:NoTrail()
let pos=getpos('.')
silent %s/\s\+$//e
call setpos('.',pos)
endfun
au BufWritePre * call <SID>NoTrail()
" vim: ts=2 et sw=2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment