aboutsummaryrefslogtreecommitdiff
path: root/vim/config/spell.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-30 23:47:33 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-30 23:49:45 +1300
commit92f2c78524d1e446aa2ab08b12b54a56dfbbbd26 (patch)
tree57d0aee3424ef87e5794168cab341c9be6fc34a3 /vim/config/spell.vim
parentToggle Vim 'hlsearch' and 'incsearch' locally (diff)
downloaddotfiles-92f2c78524d1e446aa2ab08b12b54a56dfbbbd26.tar.gz
dotfiles-92f2c78524d1e446aa2ab08b12b54a56dfbbbd26.zip
Show Vim option values after leader-key toggle
Using the very weird syntax: :setlocal option! option? We can toggle the option and print its new value in the same line. For the line breaking options, we only show the value of the 'linebreak' option, because otherwise we print three lines of messages, which requires an <Enter> press, even if we put all three `option?` calls on one :setlocal line.
Diffstat (limited to 'vim/config/spell.vim')
-rw-r--r--vim/config/spell.vim6
1 files changed, 3 insertions, 3 deletions
diff --git a/vim/config/spell.vim b/vim/config/spell.vim
index c34a6cc3..046b50ff 100644
--- a/vim/config/spell.vim
+++ b/vim/config/spell.vim
@@ -3,12 +3,12 @@ if has('spell')
" Don't check spelling by default, but bind \s to toggle this
set nospell
- nnoremap <leader>s :setlocal spell!<CR>
+ nnoremap <leader>s :setlocal spell! 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>
+ nnoremap <leader>u :setlocal spelllang=en_us spelllang?<CR>
+ nnoremap <leader>z :setlocal spelllang=en_nz spelllang?<CR>
endif