I recently discovered the spell option thanks to this answer on Code Review, and I feel that the option is both really useful (while editing) and really annoying (while reading code, because of all the false positives).
I would like to somehow enable the option automatically when switching to insert mode:
set spell
and disable it automatically when switching back to normal mode:
set nospell
Adding the following commands in your .vimrc
should do the trick (as long as your not using CTRL+C to leave insert mode) :
autocmd InsertEnter * setlocal spell
autocmd InsertLeave * setlocal nospell
Since this is a great trick, I have added these lines to my .vimrc
!
if you want to get rid of words being highlighted, you can add them to the "good" word list by putting the cursor over them and type zg
. See :help spell
for more information
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With