diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-28 21:56:40 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-28 21:56:40 +1300 |
commit | 46be8760df20d934b15616c0f97a7c5bb55c6227 (patch) | |
tree | de5c51116d3e127da656423b08689678a4f8c26e /vim | |
parent | Move list .vimrc config into subfile (diff) | |
download | dotfiles-46be8760df20d934b15616c0f97a7c5bb55c6227.tar.gz dotfiles-46be8760df20d934b15616c0f97a7c5bb55c6227.zip |
Move whitespace .vimrc config into subfile
The StripTrailingWhitespace() function should perhaps be its own plugin.
Diffstat (limited to 'vim')
-rw-r--r-- | vim/config/whitespace.vim | 14 | ||||
-rw-r--r-- | vim/vimrc | 15 |
2 files changed, 14 insertions, 15 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 @@ -61,26 +61,11 @@ set complete-=i " happened to me but who knows, it might one day set fileformats+=mac -" 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 - " Don't jump my screen around when I join lines, keep my cursor in the same " place; this is done by dropping a mark first and then immediately returning " to it; note that it wipes out your z mark, if you happen to use it nnoremap J mzJ`z -" 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 - " Keep plenty of command and search history, because disk space is cheap set history=2000 |