Created
November 3, 2015 22:03
-
-
Save christoomey/56d656db4e718af4c136 to your computer and use it in GitHub Desktop.
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 extraneous whitespace (duplicate or trailing) in current paragraph. | |
function! s:StripDuplicateWhitespace() | |
let save_cursor = getpos(".") | |
normal! {jms | |
normal! }me | |
's,'es/\S\@<=\s\{2,}/ /g | |
's,'es/\s\+$// | |
call setpos('.', save_cursor) | |
endfunction | |
command! StripDuplicateWhitespace call <sid>StripDuplicateWhitespace() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment