Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I generate a keyboard macro in my Emacs init file?

Tags:

emacs

macros

I am defining a particular keyboard macro quite often, so I thought that it might be handy if it was automatically available every time I load Emacs.

How can I do this?

like image 966
zinking Avatar asked Nov 29 '25 16:11

zinking


1 Answers

How about the save keyboard macros section of the manual?

C-x C-k n
    Give a command name (for the duration of the Emacs session) to the most recently defined keyboard macro (kmacro-name-last-macro).
C-x C-k b
    Bind the most recently defined keyboard macro to a key sequence (for the duration of the session) (kmacro-bind-to-key).
M-x insert-kbd-macro
    Insert in the buffer a keyboard macro's definition, as Lisp code.
like image 129
event_jr Avatar answered Dec 02 '25 07:12

event_jr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!