Skip to content

Instantly share code, notes, and snippets.

@fzero
Created July 28, 2011 16:22
Show Gist options
  • Save fzero/1111866 to your computer and use it in GitHub Desktop.
Save fzero/1111866 to your computer and use it in GitHub Desktop.
Vim: Remove trailing blanks from all lines in a file
" Removes trailing spaces
function TrimWhiteSpace()
%s/\s*$//
''
:endfunction
" Associates it with F2 key
map! <F2> :call TrimWhiteSpace()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment