Sunday, September 26, 2010

Emacs Abbreviation or Autocorrection mode

Long before other editors had auto-correction,  Emacs had a simple mechanism to achieve the same.  It was called abbrevs which may be a reason why it may not be well known by new comers to Emacs.

From the comp.emacs newsgroup, here's a nice little tutorial on Emacs Abbrevs from Xah Lee.  Apart from spell corrections, you could use it as an expansion for your code snippets for any local OR global modes.  You'll soon find yourself using  C-x a i l and C-x a i g a lot to save yourself a lot of typing.  See the manual section for more info on this.

And as a bonus, you could save yourself some more time by adding the following contents to  your .abbrev file.