Created
January 14, 2016 09:16
-
-
Save drobati/cefbdd182e940d313a46 to your computer and use it in GitHub Desktop.
Strip trailing whitespace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Strip trailing whitespace (,ss) | |
function! StripWhitespace() | |
let save_cursor = getpos(".") | |
let old_query = getreg('/') | |
:%s/\s\+$//e | |
call setpos('.', save_cursor) | |
call setreg('/', old_query) | |
endfunction | |
noremap <leader>ss :call StripWhitespace()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment