Emacs Tip: A Hotkey for “repeat-complex-command”
There's a emacs command repeat-complex-command.
I actually never used it. But in a recent post by Dan Espen (Source groups.google.com), it seems useful.
To make it useful, you should give it a easy hotkey, such as F5.
I'm already starting to use it and found it useful.
Here's why it's useful. In many emacs commands, after you call the command, you have to give arguments. For example, the query-replace. To do the same replacement again, you have to call it again, then use ↑ to go back to previous arg, Enter, then same for replacement.
but with repeat-complex-command, you don't have to input the args again.
In some ancient keyboard such as Sun Microsystem's Type 6 Keyboard, there's a key labeled “Again” that is bound to repeat-complex-command. But that key doesn't exist on PC keyboard today. So, you can bind it to F5 for example, or a single key on the number pad.
If you don't know how to set keys, see: Emacs: How to Define Keyboard Shortcuts.