# Fix Vim Spell Checking Not Working With Dictionary Files
You enable spell checking in Vim with :set spell, but misspelled words are not highlighted, or Vim reports:
Sorry, no spell checker for "en"Or the spell checking works but does not recognize domain-specific terminology, flagging perfectly valid technical terms as errors.
Enabling Spell Checking
First, ensure spell checking is properly enabled:
:set spell
set spelllang=enThe spelllang should be a valid language code. Check which spell files are available:
:spellinfoThis shows the location and status of loaded spell files.
Spell File Not Found
If Vim reports it cannot find the spell file, you need to download it:
:set spelllang=en
:set spellWhen you first enable spell checking for a language, Vim should prompt to download the spell file. If it does not, download manually:
# For British English
mkdir -p ~/.vim/spell
cd ~/.vim/spell
curl -O https://ftp.nluug.nl/pub/vim/runtime/spell/en.utf-8.spl
curl -O https://ftp.nluug.nl/pub/vim/runtime/spell/en.utf-8.sugThe .spl file contains the word list, and the .sug file contains suggestions for misspelled words. Both are needed for full spell checking functionality.
Verify the files are in the correct location:
ls -la ~/.vim/spell/
# Should show: en.utf-8.spl en.utf-8.sugMultiple Languages
For documents with multiple languages:
:set spelllang=en,cjkThis enables English spell checking with CJK (Chinese/Japanese/Korean) character support. For bilingual documents:
:set spelllang=en,deBoth English and German dictionaries are loaded. Words in either language are accepted.
Adding Words to the Dictionary
When Vim flags a word that is actually correct (technical terms, names, acronyms), add it to your personal dictionary:
" Position cursor on the word
zg " Add to internal word list (spellfile)
zG " Add to internal word list (not saved to file)For persistent additions, configure a spellfile:
" In ~/.vimrc
set spellfile=~/.vim/spell/en.utf-8.addThen zg saves the word to this file. The format is simple -- one word per line:
cat ~/.vim/spell/en.utf-8.add
# Kubernetes
# Netrw
# autocommandMarking Words as Bad
To flag a word as always misspelled:
zw " Add to bad word list
zW " Add to bad word list (not saved to file)This is useful for catching common typos you repeatedly make.
Spell Checking Navigation Commands
Once spell checking is enabled:
]s " Jump to next misspelled word
[s " Jump to previous misspelled word
z= " Show spelling suggestions for word under cursor
1z= " Auto-replace with first suggestionThe z= command is the most useful -- it shows a numbered list of suggestions. Press the number to select:
Change "recieve" to:
1. "receive"
2. "relieve"
3. "recline"
4. "recite"
Type number and <Enter> or click with mouse (empty cancels):Spell Checking Only Comments
For programming, you often want spell checking only in comments, not in code:
:set spellVim automatically restricts spell checking to comments and strings for most programming languages. This is controlled by the syntax highlighting rules. Verify:
:syntax on
:set spellIf spell checking highlights code identifiers, the syntax file for your language may not define @Spell regions correctly. Check:
:syntax listLook for contains=@Spell in comment and string definitions.
Disabling Spell Checking
To turn off spell checking:
:set nospellFor filetype-specific control:
```vim " Disable spell checking for code files autocmd FileType python,javascript,go setlocal nospell
" Enable for text files autocmd FileType markdown,text,tex setlocal spell ```
Custom Spell File for Projects
For project-specific terminology, create a project-level spell file:
" In .vimrc.local or project config
set spellfile+=.vim/spell/en.utf-8.addAdd project-specific terms:
mkdir -p .vim/spell
echo "myproject" >> .vim/spell/en.utf-8.add
echo "apiendpoint" >> .vim/spell/en.utf-8.addThis keeps project jargon out of your personal dictionary while still preventing false positives during editing.