This is the third part in the series on Reading Mail in the Terminal.
By default (neo)mutt will list emails rather bluntly like this:
The first step is to change the sorting to go by date of arrival and have the most recent mail at the top:
Better yet, if you want to see replies as threads, you can set
reverse-threaded. See sort for all options.
Now let’s change the way the mails are listed. The variable for that is called index_format. Suppose you want to see the status of the email (is it new, replied to, marked for deletion, has attachments?), the subject, who it sent and when it arrived, and all of that in this order, the configuration would look like this:
The format string piece by piece:
%4C– reserve 4 characters for the index
%?X?@& ?– if
%X(the number of MIME attachments) is bigger than 0, show the
@sign, otherwise not. That’s close enough to a paper clip.
%S– the status of an email (
rmeans you wrote a reply,
Nmeans it’s new,
Ostands for “not exactly new, but you didn’t read it yet”, etc.)
%.70s– use up to 70 characters to show the subject
%>– right align the rest of this line
%L– the sender
%D– date and time of the message
I’m not a fan of the help line on the top, so let’s replace it with some status information about the currently open mailbox:
# ~/.config/neomutt/neomuttrc # disable the help display set help = no # move the status bar to the top set status_on_top = yes # and show some useful status information there set status_format = " %u new mail%?p? - %p drafts&?%?F? - %F important mail&? %> %m "
Again, a walk-through for status_format, because it’s a real mess:
%u new mail– that’s the number of new emails in this mailbox. When you look in the screenshot you can see that mail 7 is new, is has the
%?p? - %p drafts&?– if there are any postponed emails (
%pis not 0), this will show their number here.
%?F? - %F important mail&?– you can flag emails, which usually means they are important. See email 8 for example, it is flagged and therefore the status shows a
%>– the rest of the line will be right aligned
%m– that’s just the number of emails in this mailbox
Use of Nerd Fonts
At this point it really pays off to use the Nerd Fonts in your terminal, because you can replace the
@ with an actual paperclip and the status characters with corresponding icons.
And the email status character is also configurable through the flag_chars:
# ~/.config/neomutt/neomuttrc set index_format = "%4C %?X?& ?%S %.70s %> %L %D" set flag_chars = "d " set status_format = " %u %?p? %p&?%?F? %F&? %> %m "