aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-28 21:56:40 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-28 21:56:40 +1300
commit46be8760df20d934b15616c0f97a7c5bb55c6227 (patch)
treede5c51116d3e127da656423b08689678a4f8c26e
parentMove list .vimrc config into subfile (diff)
downloaddotfiles-46be8760df20d934b15616c0f97a7c5bb55c6227.tar.gz
dotfiles-46be8760df20d934b15616c0f97a7c5bb55c6227.zip
Move whitespace .vimrc config into subfile
The StripTrailingWhitespace() function should perhaps be its own plugin.
-rw-r--r--vim/config/whitespace.vim14
-rw-r--r--vim/vimrc15
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
diff --git a/vim/vimrc b/vim/vimrc
index 58eb3a5f..948de359 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -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