dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

strip_trailing_whitespace.vim (338B)


      1 function s:StripTrailingWhitespace()
      2   if exists('b:keep_trailing_space')
      3     return
      4   endif
      5   if &filetype != 'diff'
      6     normal m`
      7     %s/\s\+$//e
      8     normal ``
      9   endif
     10 endfunction
     11 command StripTrailingWhitespace call <SID>StripTrailingWhitespace()
     12 nnoremap <Plug>StripTrailingWhitespace
     13       \ :call <SID>StripTrailingWhitespace()<CR>