next up previous contents
Next: Dealing with non-ASCII Character Up: Advanced Customization Previous: Changing the Index View   Contents

Changing the Pager View

From the index, once you select a message, you're in the pager. By default, mutt uses its own pager, but if you prefer something else (like `less'), you are welcome to use it. In the pager screen, the up and down arrow keys scroll the message up and down, but you can bind additional keys to control scrolling.

set pager="builtin"				
#Use the built-in pager, not `less'

set pager_context=5				
#Paging down a message leaves 5 lines of overlap, so you don't get lost.

ignore *		
# First, ignore all headers.  
# In the next line we specify which ones we'd like to see.

unignore From To Reply-To Subject X-Mailer Cc Date  
#Show these headers (ignoring all, then selecting some is easy)

hdr_order From: Date: To: Cc: Subject		
#Order in which the headers are presented.

At the top of the screen is a small window previewing a few lines of the index, usually 3-5 messages before and after the message you're reading. If you'd like to change that, you can do so with the `pager_index_lines' command. Finally, you can at the same time configure which headers you'd like to be shown by default (remember, you can see all of them by pressing the H key), and alter the order in which the headers are presented.

set pager_index_lines=4				
#Show 2 messages on either side of the message I'm reading.
alternative_order text/enriched text/plain text/html  
#In which order to show the body parts (I leave HTML for last)

Two additional variables are useful to set here. The first is `tilde,' which, if set, pads the screen at the end of the message with tildes to indicate the end of file (the same way vim does). If that's interesting to you, include

set tilde

The other is `resolve.' When you operate on a message, by default, Mutt then takes you to the next message automatically. But if the next message includes a big attachment you will be stuck until Mutt finishes downloading the entire attachment, which might take a while and be annoying if you are working online, i.e. with an IMAP mail account. You can prevent this by unsetting the `resolve' variable, i.e.

unset resolve

Otherwise, redefine the delete command so that it takes you back to the index before deleting the message. That way the cursor will move automatically to the next message but not automatically open/download it. Add this to your .muttrc:6

folder-hook . 'macro pager d "<exit><delete-message>" "Delete the message"'

See section 4.10 for more information about folder hooks and how this folder hook works.

You can add lines like the following to ensure your pager works the way you think it will (up and down scrolling). I also added commands to go rapidly to the next message. Be creative.

bind pager <up> previous-line
bind pager <down> next-line
bind pager [ previous-unread
bind pager ] next-unread


next up previous contents
Next: Dealing with non-ASCII Character Up: Advanced Customization Previous: Changing the Index View   Contents
Randall Wood 2009-12-02