How do I navigate between spelling errors and fix them in Vim?
Answer
]s / [s / z=
Explanation
Vim has a built-in spell checker that highlights misspelled words and provides correction suggestions — all without plugins. Once enabled, a small set of commands lets you navigate errors and apply fixes without breaking your editing flow.
How it works
First, enable spell checking:
:set spell spelllang=en_us
Then use these commands:
]s— jump to the next misspelled word[s— jump to the previous misspelled wordz=— open a numbered list of correction suggestions for the word under the cursorzg— mark the word as good (adds it to your personal dictionary)zw— mark the word as wrong (flags a word you want highlighted even if correct)
Example
With a document containing the word teh on line 5:
:set spell spelllang=en_usto enable spell highlighting- Press
]sto jump toteh - Press
z=to open the suggestion menu - Press
1then<Enter>to acceptthe
Tips
1z=applies the top suggestion instantly without showing the full menu- Add to
.vimrcto always enable:set spell spelllang=en_us :set spellfile=~/.vim/spell/en.utf-8.addpersists custom dictionary words across sessions:set nospelldisables spell checking for the current buffer