Repeating Commands in Emacs

One of the things that Vi/Vim does much better than Emacs is repeat commands. Pressing . in Vim repeats the last native command. It simple and easy to use and when I was a Vim user, I did, in fact, use it all the time. Its real power, I think, comes from the fact that a single easy to reach key will repeat whatever you just did.

The situation in Emacs is not as nice. If you want to repeat the last simple command (one that didn’t involve the minibuffer) you can do so with Ctrl+x z. But that’s a lot harder to type than a single period and might even be harder to type than the command you want to repeat. As a result, I never bother with it. It’s just too much trouble.

Then there’s the repeat-complex-command function that you can use to repeat a command that involves the minibuffer. Marcin ‘mbork’ Borkowski, who has a knack for discovering obscure Emacs commands, has a nice post on repeating complex commands if you want more details. It has a horrible default key binding but even if you remap it, it’s still too much trouble to bother with. I know this is true because although I wrote about repeat-complex-command four and a half years ago, I had no memory of it or ever using it when I saw Borkowski’s post.

Still, if you’re looking for a way to repeat Emacs commands, take a look at Borkowski’s post. Perhaps you’ll find the Emacs repeat commands more useful than I do.

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