Command-line Spell Checking with Aspell

Scott J Roberts
Jan 20, 2014 · 2 min read

In an effort to improve my “Unix” skills I’m trying to do more and more on the command line, such as writing this blog. This has worked out for me in a lot of ways, making much of my work faster, less environment dependent, and easier to reproduce/script. I’ve learned lots of tricks to help with this, but recently came across one of the best ones: Aspell.

First a confession: people get into the computer industry for lots of reasons. My reasons were kind of different: I couldn’t spell and have terrible handwriting. In 4th grade being told this magic box would make my ideas legible and spelled correctly was game changing for me. But I digress.

So while Vim is great and all one of the things I struggled with is being able to spell check documents. Then I found Aspell:

GNU Aspell is a Free and Open Source spell checker designed to eventually replace Ispell. It can either be used as a library or as an independent spell checker. Its main feature is that it does a superior job of suggesting possible replacements for a misspelled word than just about any other spell checker out there for the English language. Unlike Ispell, Aspell can also easily check documents in UTF-8 without having to use a special dictionary.

I’ve been really impressed with Aspell and after using it a few days it’s gotten a place on my “must have software” list. It’s pretty simple:

$ aspell -c _posts/2014-01-20-commandline-spellchecking-with-aspell

Brings up a straight forward text interface:

Image for post
Image for post

The suggestions are usually spot on and it has most of the features you’d expect from a mature spell checker in an application like Microsoft Word or Apple Pages, both of which I rarely touch anymore given the strong the combination of Vim, Aspell, and Markdown. If you’re working on lots of text documents on the command-line I cannot recommend it enough.

Bonus: If you’re just getting into Vim, as I am, I cannot recommend Vim-Adventures (billed as “Learning VIM while playing a game”) and Square’s Maximum Awesome (billed as “Config files for vim and tmux, lovingly tended by a small subculture of peace-loving hippies. Built for Mac OS X.”) enough. They’ve made getting into Vim straight forward and fun.


Originally published at sroberts.github.io on January 20, 2014.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store