Chapter 13. Other Cool Stuff in Vim
Chapters 8 through 12 covered powerful Vim features and techniques we think you should know to make effective use of the editor. From real-time spellchecking (with suggested corrections) to editing binary files and managing the state of your Vim session, this chapter takes a lighter look at Vim. It’s a catchall for some of the features that didn’t fit into previous topics, ideas about editing and the Vim philosophy, and some fun things about Vim (not that the earlier chapters weren’t fun!).
Spell It! (i-t)
Vim’s spellchecking excels in speed and flexibility. Per Vim’s ownspellchecker
built-in help, Vim recommends replacing the vimspell plug-in with Vim’s
built-in spellchecking features. See the help file spell.txt, or find help
with the ex command:
:helpspell
Vim defaults to no spellchecking. Turn spellchecking on with the ex command:
:setlocalspell
and the spellchecking region:
:setlocalspelllang=en_us
Vim flags “bad” words (because one person’s misspelled word is another one’s “good” word, hence a distinction between “bad” and “good” rather than “correct” and “incorrect”), uncapitalized words starting sentences, “rare” words (don’t ask), and “local” (regional) words. See Figure 13-1 for an example of how Vim highlights “bad” and “cap” flagged words, and see Figure 13-2 for an example of highlighted words.
Figure 13-1. Vim spellchecking ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access