Using Emacs - 15 - Macros
I originally planned on do some videos on C++ development but I'm just not feeling it. Probably because I'm excited to be working with my new class and we're working in Python. We're not going to be using C+++ for a few months so I'll get to those videos a little later.
Today, I want to cover what I consider a leatherman or multi-tool for Emacs. Something that isn't perfect for any particular job but can get almost any job done: Macros.
In their simplest form, macros let you record and play back keystrokes.
The video goes over the specifics.
Here are the main functions / keystrokes.
Command | Key |
---|---|
kmacro-start-macro-or-insert-counter | F3 |
kmacro-end-and-call-macro | F4 |
kmacro-name-last-macro | |
insert-kbd-macro |
This covers most of my use of macros but there's more. You can adjust or set the counter, edit old macros and there's even a way to have a macro pause for input in the middle.
Here are some links with more information:
- Emacs manual on macros
- http://ergoemacs.org/emacs/emacs_macro_example.html
- http://emacs-fu.blogspot.com/2010/07/keyboard-macros.html
If you're interested in checking out Repl.it, which I reference in the video, check out my blog post.
Relevant links:
- Video series overview page:
- http://cestlaz.github.io/stories/emacs
- Code:
- https://github.com/zamansky/using-emacs/tree/master