Xah Lee on Abbrev Mode

Xah Lee has a nice video on abbrev mode that shows you a couple of ways to use the facility. Abbrev-mode is built in so you don’t have to install any packages: you can just start using it.

Lee covers both ways of using abbrev-mode. There’s an “official” way that he’s documented here and the easier “Elisp” way that he’s written about here. The video covers both methods so you can watch them in action and decided which you prefer. The difference really only affects how you edit and maintain the abbrev file; actual use is the same.

Unlike Lee, I prefer to use yasnippet but, as always, Emacs lets you have it your way. I agree with Lee that whichever system you prefer you should definitely be using one of them or, perhaps, both.

I also agree with Lee that the simpler “Elisp” way is easier and better. With that method you just edit a simple text file as usual and don’t have to remember a bunch of commands and their key sequences to maintain your list of abbreviations.

The main thing I don’t like about abbrev-mode is that it gets triggered automatically when you type an abbreviation followed by a space. I don’t like things happening automatically when I’m editing text so I prefer the yasnippet way of triggering the expansion with a Tab after the abbreviation.

As I said, whatever your preferences, you should be using one of the systems. They really do make your life easier even if you use it only for implementing shortcuts to phrases you use all the time: imtin the mean time for instance.

The video is 10 and a quarter minutes so it should fit easily into a coffee break.

Added While Waiting for Publication:

While this post was sitting in my READY queue, I stumbled across a reddit post by rmberYou that reminded me of one abbrev-mode application that yasnippet can’t do: the automatic correction of common spelling errors or typos that you make. Suppose you often misspell “receive” as “recieve.” If you make recieve an abbreviation for receive, it will automatically get corrected for you each time you type it. This is one place where even I would want the translation to happen automatically.

UPDATE [2018-06-20 Wed 11:20]: Deleted superfluous “one.”

This entry was posted in General and tagged . Bookmark the permalink.