aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-28 21:45:25 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-28 21:52:10 +1300
commit07fc8ce2fdd565fdbb082ee120b4d0d574c72df3 (patch)
tree7a0aa405c16558f0c55dab74b7afbffbf6aa420f
parent7a80deca0cf0e8c53b4fdde6f5bd921b1eed7877 (diff)
downloaddotfiles-07fc8ce2fdd565fdbb082ee120b4d0d574c72df3.tar.gz
dotfiles-07fc8ce2fdd565fdbb082ee120b4d0d574c72df3.zip
Move spelling .vimrc config into subfile
-rw-r--r--vim/config/spell.vim26
-rw-r--r--vim/vimrc27
2 files changed, 26 insertions, 27 deletions
diff --git a/vim/config/spell.vim b/vim/config/spell.vim
new file mode 100644
index 00000000..50b3f657
--- /dev/null
+++ b/vim/config/spell.vim
@@ -0,0 +1,26 @@
+" Configure spell checking features, if available
+if has('spell')
+
+ " Don't check spelling by default, but bind \s to toggle this
+ set nospell
+ nnoremap <leader>s :setlocal spell!<CR>
+
+ " Use New Zealand English for spelling by default (it's almost identical
+ " to British English), but bind \u to switch to US English and \z to
+ " switch back
+ set spelllang=en_nz
+ nnoremap <leader>u :setlocal spelllang=en_us<CR>
+ nnoremap <leader>z :setlocal spelllang=en_nz<CR>
+endif
+
+" Don't keep .viminfo information for files in temporary directories or shared
+" memory filesystems; this is because they're used as scratch spaces for tools
+" like sudoedit(8) and pass(1) and hence could present a security problem
+if has('viminfo') && has('autocmd')
+ augroup viminfoskip
+ autocmd!
+ silent! autocmd BufNewFile,BufReadPre
+ \ /tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*,*/shm/*
+ \ setlocal viminfo=
+ augroup END
+endif
diff --git a/vim/vimrc b/vim/vimrc
index 1a4c916d..55a7a9bd 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -176,33 +176,6 @@ set autowrite
set scrolloff=0
set sidescrolloff=16
-" Configure spell checking features, if available
-if has('spell')
-
- " Don't check spelling by default, but bind \s to toggle this
- set nospell
- nnoremap <leader>s :setlocal spell!<CR>
-
- " Use New Zealand English for spelling by default (it's almost identical
- " to British English), but bind \u to switch to US English and \z to
- " switch back
- set spelllang=en_nz
- nnoremap <leader>u :setlocal spelllang=en_us<CR>
- nnoremap <leader>z :setlocal spelllang=en_nz<CR>
-endif
-
-" Don't keep .viminfo information for files in temporary directories or shared
-" memory filesystems; this is because they're used as scratch spaces for tools
-" like sudoedit(8) and pass(1) and hence could present a security problem
-if has('viminfo') && has('autocmd')
- augroup viminfoskip
- autocmd!
- silent! autocmd BufNewFile,BufReadPre
- \ /tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*,*/shm/*
- \ setlocal viminfo=
- augroup END
-endif
-
" Preserve the flags for a pattern when repeating a substitution with &; I don't
" really understand why this isn't a default, but there it is
nnoremap & :&&<CR>