Show if spelling is on or off

This commit is contained in:
Anthony Rose 2023-03-07 10:54:07 +00:00
parent c561fca8d6
commit c12bc910ad

24
vimrc
View file

@ -44,8 +44,8 @@ nnoremap <F10> :call ACPToggleMargins()<CR>
nnoremap <F11> :Limelight!!<CR>
nnoremap <F12> :w<CR>
nnoremap <F2> :call ACPNModeTodo()<CR>
nnoremap <F7> :setlocal spell! spelllang=en_us<CR>
nnoremap <S-F7> :setlocal spell! spelllang=en_gb<CR>
nnoremap <F7> :call ACPToggleSpellEnUs()<CR>
nnoremap <S-F7> :call ACPToggleSpellEnGb()<CR>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
@ -234,6 +234,26 @@ function! ACPToggleMargins()
execute "set colorcolumn=" . (&colorcolumn == "0" ? "73,81" : "0")
endfunction
function! ACPToggleSpellEnUs()
if &spell == 0
setlocal spell spelllang=en_us
echo "Spelling ON (en_US)"
else
setlocal nospell
echo "Spelling OFF"
endif
endfunction
function! ACPToggleSpellEnGb()
if &spell == 0
setlocal spell spelllang=en_gb
echo "Spelling ON (en_GB)"
else
setlocal nospell
echo "Spelling OFF"
endif
endfunction
function! ACPNModeTodo()
" Toggles between TODO, WORK, WAIT, DONE, and blank.
" All are highlighted except DONE and blank.