Skip to content

Instantly share code, notes, and snippets.

@brandonpittman
Last active November 18, 2022 12:59
Show Gist options
  • Save brandonpittman/9d15134057c7267a88a8 to your computer and use it in GitHub Desktop.
Save brandonpittman/9d15134057c7267a88a8 to your computer and use it in GitHub Desktop.
Toggle spellcheck on/off in vim
" Toggle spellchecking
function! ToggleSpellCheck()
set spell!
if &spell
echo "Spellcheck ON"
else
echo "Spellcheck OFF"
endif
endfunction
nnoremap <silent> <Leader>S :call ToggleSpellCheck()<CR>
@kawa-kokosowa
Copy link

This works well. I had to bind it to \c for some reason \S would just clear line and insert on that same line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment