Skip to content

Instantly share code, notes, and snippets.

@frogonwheels
Created August 27, 2010 02:02
Show Gist options
  • Save frogonwheels/552638 to your computer and use it in GitHub Desktop.
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