]> Tony Duckles's Git Repositories (git.nynim.org) - dotfiles.git/blob - .vim/bundle/whitespace/plugin/whitespace.vim
.vim: Switch to use junegunn/vim-plug as plugin manager
[dotfiles.git] / .vim / bundle / whitespace / plugin / whitespace.vim
1 " thanks to http://vimcasts.org/e/4
2 function! whitespace#strip_trailing()
3 let previous_search=@/
4 let previous_cursor_line=line('.')
5 let previous_cursor_column=col('.')
6 %s/\s\+$//e
7 let @/=previous_search
8 call cursor(previous_cursor_line, previous_cursor_column)
9 endfunction