From c12bc910ad5be58d8067ee843a8280a9f58b1537 Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Tue, 7 Mar 2023 10:54:07 +0000 Subject: [PATCH] Show if spelling is on or off --- vimrc | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) 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.