diff --git a/vimrc b/vimrc index 6d5b952..04ac66f 100644 --- a/vimrc +++ b/vimrc @@ -44,8 +44,8 @@ nnoremap :call ACPToggleMargins() nnoremap :Limelight!! nnoremap :w nnoremap :call ACPNModeTodo() -nnoremap :setlocal spell! spelllang=en_us -nnoremap :setlocal spell! spelllang=en_gb +nnoremap :call ACPToggleSpellEnUs() +nnoremap :call ACPToggleSpellEnGb() nnoremap nnoremap nnoremap @@ -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.