How do I jump between misspelled words in Vim?
Answer
]s and [s
Explanation
How it works
When spell checking is enabled in Vim with :set spell, misspelled words are highlighted. You can quickly jump between these highlighted words using:
- ]s moves the cursor forward to the next misspelled word.
- [s moves the cursor backward to the previous misspelled word.
These motions skip over correctly spelled text and land directly on the next error, making it efficient to review and fix spelling across an entire document without scanning line by line.
Both commands accept a count: 3]s jumps forward three misspelled words at once.
There are also variants that distinguish between types of spelling errors:
- ]S and [S only jump to words that are truly misspelled (flagged as bad), skipping words that are merely rare or from another region.
Example
Suppose you are editing a Markdown document with spell check enabled:
This is a documnet with severl speling mistakes
that need to be correted before publishing.
- Run
:set spellto enable spell checking. - Press
]sto jump to the first misspelled word (documnet). - Press
z=to see correction suggestions, or type1z=to accept the first suggestion. - Press
]sto jump to the next misspelled word (severl). - Continue until all errors are fixed.
Useful spell commands
z=shows a numbered list of suggested corrections.zgadds the word under the cursor to the spell file (marks it as good).zwmarks the word under the cursor as wrong.zugundoes azgorzwaction.:set spelllang=en_ussets the spell language to US English.