next up previous contents
Next: Writing Macros Up: Advanced Customization Previous: Configuring Colors   Contents


Rebinding Keyboard Shortcuts

By binding keys to certain functions you can add shortcuts to maneuvering through your message list. For example, `j' and `k' are configured out of the box as up and down keys for moving around in the index. But you can just as easily bind them to something else if you like (for example if you use a non-standard keyboard layout like Dvorak). The `bind' command allows you to configure mutt the way you like to work. The command takes the following form: ``bind `map' `key' `function.' ''

Maps can be one of the following: generic, alias, attach, browser, editor, index, compose, pager, pgp, and postpone, and determines in which context the key is to be bound, i.e. when you are maneuvering around the index, when you are in the pager, when you are searching for an alias in your address book, and so on.

Key is the key (or key sequence) you wish to bind. To specify a control character, use the sequence $\backslash$Cx, where x is the letter of the control character (for example, to specify control-A use ``$\backslash$Ca''). Note that the case of x as well as $\backslash$C is ignored, so that $\backslash$CA, $\backslash$Ca, $\backslash$cA and $\backslash$ca are all equivalent. Mutt allows you to use non alpha-numeric keys on a lot of platforms, but I was unable to get the F keys (F1, F2, etc.) to work on my Macintosh, so it's not universal. Using the brackets shown below you can access any key listed in table 10 below:

Figure 10: Special keys to which you can bind functions
\begin{figure}\begin{tabular}{l\vert l}
\par
Code & Produces: \\
\hline
\par
$\...
...& function key 1 \\
<f10> & function key 10 \\ \hline
\end{tabular}\end{figure}

These are some of the shortcuts I have bound keys to in order to facilitate easy navigation, but you can bind just about anything you like. See section B for a list of all the functions available to you when programming keys.

bind generic - first-entry		
#minus sign takes me to the top of the list

bind generic = last-entry		
#equals sign takes me to the bottom of the list

bind generic L bottom-page		
#to the bottom,

bind generic M middle-page		
#       middle, and

bind generic H top-page			
#       	top of the screen

bind index [ previous-unread		
#to the previous unread message in the list

bind index ] next-unread		
#or the next unread message.

The keys bound to `generic' are configured for usage throughout the program. So above we have two key bindings that only function in the index, and in the pager while you're reading a message, the [ and ] keys will have no effect.


next up previous contents
Next: Writing Macros Up: Advanced Customization Previous: Configuring Colors   Contents
Randall Wood 2009-12-02