diff options
Diffstat (limited to 'vim/config/whitespace.vim')
-rw-r--r-- | vim/config/whitespace.vim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vim/config/whitespace.vim b/vim/config/whitespace.vim new file mode 100644 index 00000000..2202f47b --- /dev/null +++ b/vim/config/whitespace.vim @@ -0,0 +1,14 @@ +" Don't join lines with two spaces at the end of sentences; I don't two-space, +" despite the noble Steve Losh's exhortations +set nojoinspaces + +" Strip trailing whitespace with \x +if has('eval') + function! StripTrailingWhitespace() + let l:search = @/ + %substitute/\s\+$//e + let @/ = l:search + nohlsearch + endfunction + nnoremap <silent> <leader>x :<C-U>call StripTrailingWhitespace()<CR> +endif |