I have a few files I wish to spellcheck. Normally I would open these in vim
, run :set spell
and do the changes. It's really teadious to open files and manually check if I've misspelt any words since the last check, however.
Is there a way I can run a spell-check on a lot of files and display any incorrectly-spelt words found, along with the filename, so that I can go and change them? I don't want to open every file, check if it's "clean", then open the next and repeat.
I can't find any POSIX spellcheck utility. Some Red-Hat based Linux distributions allegedly have spell
or similar, but I'd prefer a cross-platform(ish) method. I know vim
can spellcheck - is there any way of spellchecking without doing it all manually? It'd be fantastic if I could shell-script a solution.
I'm running OS X
, for what it's worth.
Type a word in this mode, press enter, and you'll see aspell offering spelling suggestions on stdout. Example 3: Using aspell to check words in bulk. When run, will wait for user input. Add as many words as you want, and when done, press Ctrl+D.
vim Spell checker Spell CheckingTo turn on the vim spell checker run :set spell . To turn it off run :set nospell . If you always want the spell checker to be on, add set spell to your vimrc. You can turn spelling on only for certain filetypes using an auto command.
DESCRIPTION. Ispell is fashioned after the spell program from ITS (called ispell on Twenex systems.) The most common usage is "ispell filename". In this case, ispell will display each word which does not appear in the dictionary at the top of the screen and allow you to change it.
To spellcheck a file, just run it through ispell. For example, if the file that you want to be spellchecked is named 'mispel. txt' , then you can simply run 'ispell mispel. txt' .
You can install aspell with Homebrew on OS X. brew info aspell
lists supported languages.
brew install aspell --lang=en,fi,jp
aspell check
opens a file in an interactive spell checker:
for f in *.txt; do aspell check $f; done
aspell list
prints all unrecognized words:
cat *.txt | aspell list | sort -u
Learned words are stored in .aspell.en.pws
by default. You can also exclude words in ~/Library/Spelling/en
after adding personal_ws-1.1 en
as the first line.
aspell list --personal=$HOME/Library/Spelling/en
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With