Skip to content

Instantly share code, notes, and snippets.

@fzero
Created Jul 28, 2011
Embed
What would you like to do?
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