So, it’s come to the point in my Ph.D where I need to spell check. The problem is that a large number of the technical words I use aren’t in the default dictionary now provided by vim.
Time to add some!
This is actually quite easy to do, originally I tried compiling dictionaries as vim .spl files but this proved less simple thanj I had hoped. In the end I found a simple way of doing this using vim’s .add files.
Note: This assumes you’re using some form of english dictionary as base. Vim uses language (ignoring location) when loading the files so replace “en” with your language’s abbreviation.
In the ~/.vim/spell/ folder, and words you add to your dictionary using
zg get added to a file here called en.utf-8.add. I’ve simply added any extra words I wanted in my dictionary a .add file in this folder.
Firstly grab the medical dictionary for open office from here (chemical dictionary here) and extract the contents using your archive manager of choice. You specifically need the .aff and .dic files for vim to compile them into a dictionary.
Once you’ve got both of these it’s a simple command to combine them all into one new file:
mv ~/vim/spell/en.utf-8.add ~/vim/spell/en.utf-8.temp
cat ~/.vim/spell/en.utf-8.temp ~/path/en_US_OpenMedSpel.dic ~/path/ChemDictOOo.dic > ~/.vim/spell/technical.utf-8.add
Lastly, you need to compile the en.utf-8.add file into the en.utf-8.add.spl file that vim will load. Load up vim and run…
Test you got this right by opening your en.utf-8.add file and turning spell on (:set spell). Hopefully none of the words should be glowing red!
Alternatively: If you can’t be bothered to do all that, download this and place it in