[Lowerbounds, Upperbounds]

Algorithms are everywhere.

It has been complained to me that I use long variable names in my code, which I think is a defendable practice. Worse, I also use stupidly long “abbreviations” in LaTeX

\newcommand{\LovaszLocalLemma}{Lov\'asz Local Lemma}

which doesn’t abbreviate at all…

Well, these complaints are understandable, but what if you don’t have to type these long words in full?

Type this_super_very_super_long_word into Emacs. Press Enter. Now type th and then hit Alt-/. Bang!

I can’t imagine how many seconds of my life I have saved with this feature (surely more than the time it takes me to compose this post to share it with you). These days, even when I type moderately long word like moderately, I use completion.

Vim users don’t have to feel left out. Try Ctrl-P and Ctrl-N instead.

P.S. The next complaint I will get is that Alt-/ is not all that easy to hit. I agree. That’s why I have this line in my .emacs:

(global-set-key [(control ?h)] ‘dabbrev-expand)

Your key choice may vary.

2 Comments

  1. AvatarJoshua Dunfield
    22:03 on February 28th, 2006

    Having a macro for Lovász is probably a good idea because of the accent, but I wouldn’t go so far as to have one for the whole phrase.

    I don’t use dabbrev-expand much for random words like “moderately”, but it’s very handy for SML identifiers, TeX macros, and TeX labels (though I have less trouble with those since I got label names to appear in the margins next to where the \label “appears”).

  2. Once you’ve seen “local lemma” in all lowercase, or the other two capitalization possibilities, you will agree to have the whole phrase… :P