Skip to content

Commit

Permalink
Add StripTrailingWhitespace function
Browse files Browse the repository at this point in the history
  • Loading branch information
hSATAC committed Nov 25, 2014
1 parent 963985e commit b0a3766
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions vimrc
Expand Up @@ -113,6 +113,16 @@ endfunction

"}

" Remove trailing white spaces
function StripTrailingWhitespace()
if !&binary && &filetype != 'diff'
normal mz
normal Hmy
%s/\s\+$//e
normal 'yz<CR>
normal `z
endif
endfunction

" C/C++ specific settings
autocmd FileType c,cpp,cc set cindent comments=sr:/*,mb:*,el:*/,:// cino=>s,e0,n0,f0,{0,}0,^-1s,:0,=s,g0,h1s,p2,t0,+2,(2,)20,*30
Expand Down

0 comments on commit b0a3766

Please sign in to comment.