I’ve made an effort to shift to Vim as my one text editor for all occasions. One of the features I should make more use of is the spell-checker, but the commands and controls often slip my memory. I thought I would take a little time to write them all out in hope of improving my muscle memory.
Toggle spell checking on or off:
Jump moving to misspellings:
- Forward to next potential misspelling.
- Backward to previous potential misspelling.
- Forward to next potential misspelling, skipping regional spelling variants.
- Backward to previous potential misspelling, skipping regional spelling variants.
Move to a word to correct, while on or with a highlighted misspelling, press:
From the menu of replacement options that appears, type the number of the replacement you want and press Enter key and selection will replace original word.
Adding words to dictionary (good words):
Move to a word which is highlighted as potentially misspelled, double check the spelling is indeed correct, and add word to dictionary by pressing:
If you change your mind about having added the word to your dictionary, then you can remove it again by pressing:
Adding words to dictionary (wrong words):
To add a word to Vim’s list of words to be highlighted as if misspelled even if they are not, move to a ‘wrong’ word and press:
The word should now be highlighted as if it was misspelled.
If you change your mind about wanting the word flagged as wrong, then you can remove it again by pressing:
The word should again no longer be highlighted as wrong. A word should not be added to both the ‘good’ and ‘wrong’ lists, lest Vim become confused.
Changing dictionary language
On the command line in Vim, type the following, replacing the ?? with the letter language code of the language dictionary you wish to switch to:
Vim will offer to download the dictionary if you do not already have it installed.
You can also select the language to use when you toggle spell-checking on by using the following in the Vim command line: