VimSpellcheckery

src: https://upload.wikimedia.org/wikipedia/commons/thumb/9/9f/Vimlogo.svg/240px-Vimlogo.svg.png

Everyonceinawhile, you realize you've been brute forcing your way around some tool that you use every day. Too often, for me, that tool ends up being vim...

While I was mass editing the transcripts I used to create the FSF30 wordclouds, I realized I was doing too much manual movery to get to the next misspelled word. In a moment of clarity, I was like "hey, I bet vim has a way to properly do this!" And of course it did!

http://vimdoc.sourceforge.net/htmldoc/spell.html#spell-quickstart

TIL:
]s = move cursor to next misspelled word
[s = move cursor to previous misspelled word


Even cooler than that: YOU CAN ADD N-GRAMS TO YOUR LOCAL SPELLCHECK DICTIONARY!!1!

The word 'harry' is a proper word, and the word 'potter' is a proper word, but if they are right next to eachother, likely you are not talking about someone persistently accosting a claysmith...

Luckily, vim will let you visually select the words together 'v2e', and then type 'zw' to mark the duo as a "wrong" word. You can then add the correctly capitalized duo of "Harry Potter" to your local dictionary by typing 'v2ezg'.

This will make "harry the potter" not show any misspellings, but "harry potter" will come up as misspelled, and when you spellcheck it, will give the proper caps.

Comments

Comments powered by Disqus