If you want to write technical documentation in Vim with spell check enabled, but do not want to put project-specific jargon in global spell check files, you can create project-specific spellfiles.
First, ensure that markdown files have spell check enabled (either via autocmd
or an ftplugin
file): setlocal spell spelllang=en_us
,
Then create a file with some project-specific words in it (it can be empty
in the beginning as well, it's okay!)
monadic
microservice
planeswalker
Save this file under ~/.vim/spell/project-jargon.utf-8.add
. Then, in your
a config file add the following:
autocmd BufRead,BufNewFile /PROJECT/ROOT/*.md setlocal spellfile=~/.vim/spell/project-jargon.utf-8.add
Note: the location of the spellfile does not matter.
You can now press zg
in markdown documents when cursor is over a "valid
jargon name" & it will be added to the jargon file. See :help spell
for more
info on spell checking.