With a little side of applesauce...

Tuesday, January 30, 2007

emacs define a macros

Precede the macros with:

ctrl-x (

Close macros with:

ctrl-x )

For example:

ctrl-x ( ;; start macro
M-> ;; select region from point to end of buffer
ctrl-w ;; kill region (cut)
ctrl-x ) ;; close macro

To recall the last macros:

ctrl-x e

Or, you can bind a keyboard shortcut to the last macros by placing the following in your .emacs:

;; repeat last keyboard macro
(global-set-key [(shift f1)] ‘call-last-kbd-macro)

Taken from:

http://linuxgazette.net/issue47/pedersen.html

No comments: