How do I jump between spelling errors and fix them using Vim's built-in spell checker?
Answer
]s / z=
Explanation
With :set spell enabled, ]s jumps to the next misspelled word and [s jumps to the previous one. Once on a misspelled word, z= opens a numbered list of suggested corrections — type the number to replace the word. This is Vim's complete built-in spell-checking workflow.
Navigation
| Motion | Action |
|---|---|
]s |
Jump to next misspelled word |
[s |
Jump to previous misspelled word |
]S |
Next misspelled word (only bad words, skip rare/regional) |
[S |
Previous misspelled word (only bad) |
Correction
| Command | Action |
|---|---|
z= |
Show spelling suggestions for word under cursor |
1z= |
Accept the first suggestion immediately |
zg |
Mark word as good (add to spellfile) |
zw |
Mark word as wrong (add to bad-word list) |
zug |
Undo zg — remove word from spellfile |
Setup
:set spell " enable spell checking
:set spelllang=en_us " set language
:set spellfile=~/.vim/spell/en.utf-8.add " custom word list
Example workflow
:set spell— misspelled words get highlighted]s— jump to first errorz=— review suggestions, type number to fix]s— jump to next errorzg— if it is a valid word (e.g., a name), add it to your dictionary
Tips
- Enable spell checking only for prose files:
autocmd FileType markdown,text setlocal spell z=with a count skips the menu:1z=picks the top suggestion instantly- Spell checking highlights:
SpellBad(errors),SpellCap(uncapitalized),SpellRare,SpellLocal— customize colors with:highlight - Download additional languages:
:set spelllang=en,defor English + German