Spell Checking

Replacing text with z=.

You probably already know that you can enable spell checking in Vim with :set spell. This is great for drafting up blog posts, particularly if you write in a lightweight format like Markdown. If you type :help 'spell' you'll see some other options, like 'spelllang' and 'spellsuggest'. Vim actually has quite a few options for tailoring the behaviour of the spell checker, but I usually find it works fine out of the box.

Something new to me that I learned recently is z=. Typing z= shows a menu of words that are similar to the text under the cursor. You can press a number to quickly select one of the words, so if it's an obvious mistake you may even be able to type z=1.

The :spellr command repeats the previous replacement for all matches in the current window. I've done this where I've pasted text with a consistent error.

I write almost everything in Vim, so I've been mining :help spell more and more.

blog comments powered by Disqus