Creating and Using Keyboard Macros (Record Macro, Play Macro) to Record and Playback Keystrokes in Emacs

  • Use C-x ( to start the macro (start recording keystrokes)
  • …Perform whatever keyboard actions…
  • Use C-x ) to stop the macro (stop recording keystrokes)
  • Playback the recorded macro anytime using C-x e

You can also assign different hot-keys for convenience:

(global-set-key [f1] 'start-kbd-macro)
(global-set-key [f2] 'end-kbd-macro)
(global-set-key [f3] 'call-last-kbd-macro)

Check out the KeyboardMacros Emacs Wiki page for more in-depth info on Emacs Keyboard Macros.

Share

One thought on “Creating and Using Keyboard Macros (Record Macro, Play Macro) to Record and Playback Keystrokes in Emacs”

Leave a Reply

Your email address will not be published. Required fields are marked *