WSU logo


College of Engineering & CS
Wright State University
Dayton, Ohio 45435-0001

CEG 333: Introduction to Unix

Prabhaker Mateti

Emacs: Macros


Key Meaning
C-x ( Start recording a macro.
C-x ) Stop recording a macro.
C-x e Replay the last macro recorded.

Repetitive tasks in Emacs can be recorded as a macro and played back over and over with a single keystroke. Macros can be as simple as entering a string of text, or as complex as any set of Emacs commands.

To begin recording, press C-x (. Any further keystrokes will become part of the macro. When finished, C-x ) to stop recording and store the macro. After that, pressing C-x e will replay the last macro. Macros can be used as many times as desired.