Sunday 13 April 2014

Custom dictionary for spell check on Vim




I have recently change my work flow to use Vim as my editor for all creation of content and like the spell checking feature. One thing I wanted to be able to do was set up a custom dictionary for words that I commonly use that the Vim Spell checker does not know about.

To set up I initially created a directory and empty file :

$ mkdir ~/vim/
$ touch ~/vim/mySpellFile.en.utf-8.add


Next I updated my .vimrc file with a 'set spellfile' :

$ cat ~/.vimrc
:map <F5> :setlocal spell! spelllang=en_ca
set spellfile=~/vim/mySpellFile.en.utf-8.add

Use ]s and [s as normal to move between the incorrect words according to vim's spell checker with z= to change with the selected words

To add a file to the dictionary when highlighted select zg


No comments:

Post a Comment