Skip to content

Instantly share code, notes, and snippets.

@skazhy
Created March 24, 2020 09:45
Show Gist options
  • Save skazhy/b31aa94fab147da11bb7c80172be76e9 to your computer and use it in GitHub Desktop.
Save skazhy/b31aa94fab147da11bb7c80172be76e9 to your computer and use it in GitHub Desktop.
Creating project-specific spellcheck files for Vim

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment