< a quantity that can be divided into another a whole number of time />

More Neomutt little hacks

August 26, 2022

Some further tips and tricks on Neomutt after my original post. See also my related post on Tmux hacking.

I will probably never regret switching from mu4e to Neomutt two years ago. Chris Wellons did the same apparently. It’s the same keyboard-driven experience, but with all the functionalities you would expect from a mail processor. Moreover, as they use to say:

All mail clients suck. This one just sucks less. — Michael R. Elkins

I spent a lot of time configuring Neomutt to my liking, and to this end I happened to read a lot of blog posts,1 the online documentation and the man pages, dotfiles available on Github, etc. Neomutt is great, but its configuration is harder than it seems because there are tons of options that you need to define carefully. Of course, default options are quite good, but you know when you start tinkering your setup… My previous post explained how I ended up setting my default config. Here are a few additional tricks that I learned along the way.

Finally, some words about my workflow. The main structure of my mailboxes is shown below:


I now use a single account setup because I found that juggling different accounts was kind of not that funny at times. My typical workflow is that every new mail end up in the INBOX, with some automatic filters to move messages from mailing-lists I subscribed to in their respective folders. Mailing digest may be archived manually into the “digests” folder, and I used to use a weird macro to automate this stuff.2 The “archives” folder is an all-in-one archive of all the messages I received since around 2006 (Gmail time, remember?). It held more than 45K messages at some point, but I did a drastic pruning a few years ago so that now there are just about fifteen thousand messages, which is more manageable, even for Neomutt. I have some handful macros that help keeps the digests and mailing folders clean: one macro allows to delete all message older than a certain amount of days, while another macro is used to mark all messages as read.

macro index <Esc>x "<tag-pattern>~d >6m<enter><tag-prefix-cond><delete-message>" "delete old messages"
macro index \Cx "T~U<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" "mark all messages as read"

TIL some Vim keybindings are defined in /usr/share/doc/neomutt/vim-keys/vim-keys.rc. Unfortunately, there’s not much to see except some bindings for moving around, scrolling and managing threads (sort of).

♪ Maxence Cyrin • As the Darkness Falls

  1. I may even have missed Steve Losh’s excellent blog post at some point. ↩︎

  2. Example of a weird macro, that I converted to more manageable folder hooks a while ago:

    macro index <Esc>s \
      "Tr-devel-request<enter><tag-prefix-cond><save-message>=digests<enter><end-cond> \<enter><tag-prefix-cond><save-message>=digests<enter><end-cond> \
      Tnumpy-discussion-request<enter><tag-prefix-cond><save-message>=digests<enter><end-cond> \
      Tscipy-dev-request<enter><tag-prefix-cond><save-message>=digests<enter><end-cond> \

See Also

» Migrating to Systemd » Starship » Of signals and trap » More Tmux little hacks » Rhythmbox