A quick and powerful Emacs tip: Repeat last complex command

by

Emacs never fails to surprise me. I think I’ve discovered this much later than I should have, and pretty much by fluke, but here goes:

C-x ESC ESC runs the function repeat-complex-command which will let you “edit and re-evaluate last complex command”. A complex command is one which uses the mini-buffer. Using this, you can easily re-execute commands when you want to without having to type the whole thing out again. The command to be executed is shown to you in elisp form, so you can even modify it if you need to. What if I don’t want to execute the last complex command? What if I want to execute a command I have used a bit earlier? Well, you can traverse the mini-buffer history by using M-n and M-p! Super-cool!

Leave a comment