The Mutt E-Mail Client : Configuration : Keyboard macros
Previous: Setting variables based upon mailbox
Next: Using color and mono video attributes

3.6. Keyboard macros

Usage: macro menu key sequence [ description ]

Macros are useful when you would like a single key to perform a series of actions. When you press key in menu menu, Mutt will behave as if you had typed sequence. So if you have a common sequence of commands you type, you can create a macro to execute those commands with a single key.

key and sequence are expanded by the same rules as the key bindings. There are some additions however. The first is that control characters in sequence can also be specified as ˆx. In order to get a caret (`ˆ'') you need to use ˆˆ. Secondly, to specify a certain key such as up or to invoke a function directly, you can use the format <key name> and <function name>. For a listing of key names see the section on key bindings. Functions are listed in the function reference.

The advantage with using function names directly is that the macros will work regardless of the current key bindings, so they are not dependent on the user having particular key definitions. This makes them more robust and portable, and also facilitates defining of macros in files used by more than one user (eg. the system Muttrc).

Optionally you can specify a descriptive text after sequence, which is shown in the help screens.

Note: Macro definitions (if any) listed in the help screen(s), are silently truncated at the screen width, and are not wrapped.


The Mutt E-Mail Client : Configuration : Keyboard macros
Previous: Setting variables based upon mailbox
Next: Using color and mono video attributes