sponsor Vim development Vim logo Vim Book Ad

autocorrect.vim : Correct common typos and misspellings as you type

 script karma  Rating 138/126, Downloaded by 7484  Comments, bugs, improvements  Vim wiki

created by
Anthony Panozzo
script type
Looking through the examples in Vim, there are examples of correcting typos and misspellings like:

iabbrev teh the
iabbrev het the

However, it is very time-consuming to create this list by hand.  You also have to enter the correct capitalization, which is a pain.  ('teh->the' is not equal to 'Teh->The')

It seems silly for everyone to create their own autocorrect file, so hopefully we can work together to make a sweet list.  I found a nice list from Wikipedia and cleaned it up a bit as a basis, and incorporated the typo fixes from Vim Cream.  I also added some words that I commonly misspelled or mistyped, and have taken additional contributions from users of the script.

I'm sure there are some mistakes, or common mistakes that aren't in here yet, so if you find any, please contact me and I will gladly change things.  There are some additional details or thoughts as well as a shortcut to a word-processing mode at http://22ideastreet.com/blog/2008/11/06/vim-word-processing.

I find this script invaluable when using Mozex to edit forms online (blog posts, web mail, etc.)

There is a GitHub repository that you can contribute to at http://github.com/panozzaj/vim-autocorrect/tree/master
install details
You can just type :source /path/to/the/autocorrect.vim to load up the corrections.

I recommend putting autocorrect.vim in your vimfiles directory somewhere and then sourcing it when you want autocorrect to be enabled.  The other two files included in the .tar file are just to generate the list.  I would not recommend adding directly to autocorrect.vim, as these changes will get wiped out whenever you regenerate.  Ruby is necessary to generate from the data file, but a generated file is included in the .tar, so you can start immediately!

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
autocorrect.tar 1.03 2009-04-19 6.0 Anthony Panozzo Thanks to Gilles Bertrand for sending me a list containing a bunch of new corrections!  Many of the corrections are longer or more technical in nature.  In addition, I created a file in the GitHub repository that contains multiple word corrections in case this is ever easy to do in the future with Vim.  I also added a README in the tar file itself.
autocorrect.tar 1.02 2009-02-01 6.0 Anthony Panozzo Found that Cream had an abbreviation file, so I took any words that were in there that I didn't already have and added them (about thirty, with some day of the week capitalization.)  Changed output of generator to recognize when a fix was just a capitalization.  Reduced size of final file by changing from 'iabbrev' to 'ia' (8000*5 characters!)  Also went through and deleted corrections of dubious quality and fixed some problems in the source file.  Added a couple of things that I've made mistakes on in the past two months.  All in all, a bunch of nice changes, less lines and size and more autocorrectionness.
autocorrect.tar 1.01 2008-12-06 6.0 Anthony Panozzo Added mistakes that I have made over the last month that should have been autocorrected.

Converted from dos line endings to unix ones.  Before I did this, it worked fine on the Windows box, but would cause a line break to be inserted on other operating systems when space was pressed.
autocorrect.tar 1.0 2008-11-07 6.0 Anthony Panozzo Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.