spell checking - Is it possible to toggle a vim option when switching to insert mode? -


i discovered spell option this answer on code review, , feel option both useful (while editing) , annoying (while reading code, because of false positives).

i somehow enable option automatically when switching insert mode:

set spell 

and disable automatically when switching normal mode:

set nospell 

adding following commands in .vimrc should trick (as long not using ctrl+c leave insert mode) :

autocmd insertenter * setlocal spell autocmd insertleave * setlocal nospell 

since great trick, have added these lines .vimrc !

if want rid of words being highlighted, can add them "good" word list putting cursor on them , type zg. see :help spellfor more information


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -