Your web-browser is very outdated, and as such, this website may not display properly. Please consider upgrading to a modern, faster and more secure browser. Click here to do so.
Keyboard macros can be crazy helpful in emacs, and allow you to automate repetitive processes you come across when coding. if you have a sequence of keystrokes you use day-to-day, here is how to convert them to a function and bind it to a key:
C-x (to start your macro
C-x )to end the macro
C-x C-k nto call
kmacro-name-last-macroand assign a name to your macro
M-x insert-kbd-macroto output the lisp code of your new macro
(global-set-key <key> '<macro_name>)to bind it to a key. C-x C-k 0-9/a-z are reserved for personal key bindings. you can also use the f1 - f12 keys
and your done! now you have compressed several keystrokes into just one, and it’ll also be there when you need it.