Effective spelling in Vim
Turn spelling on/offTurn on spelling in vim with:
set spell. Turn it off with:
American English was the default language when I switched spelling on. You can change languages with:
set spell spelllang=en_gb (British English).
To turn on spelling for files with certain extensions (LaTeX .tex files):
autocmd BufNewFile,BufRead *.tex set spell spelllang=en_gb.
Sometimes you might want to turn spelling on for a single buffer (e.g. when modifying a README file). Use
setlocal spell to achieve this.
When programming, I make heavy use of
CTRL-P (see https://github.com/kien/ctrlp.vim) in insert-mode to auto-complete words, you can do the same with spelling with:
Use CTRL-N or CTRL-P in insert-mode for word-completion with
set complete+=kspell to add dictionary scanning:
DictionaryTo add a word to your personal dictionary, navigate to the word you want to add and type:
To do the opposite and mark a word as incorrect, navigate to the word and type:
zw (undo with
To see a list of suggested spelling corrections, navigate to the word you want help with and type:
Jump to bad words
To jump between misspelled words, type:
For more help: