vimtricks.wiki Concise Vim tricks, one at a time.

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

  1. :set spell — misspelled words get highlighted
  2. ]s — jump to first error
  3. z= — review suggestions, type number to fix
  4. ]s — jump to next error
  5. zg — 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,de for English + German

Next

How do I run a search and replace only within a visually selected region?