Neomutt TO Address NerdFont Gutter Indicator
I’ve been using mutt/neomutt since around 2008 or 2009 with some breaks in-between. Steve Losh’s The Homely Mutt re-invigorated my love for mutt in 2012 and I refer back to this blog post often. It super-charged my usage of mutt from casually getting-by to productively using it for my email.
Over time I have accumulated a variety of email aliases (as one does…I suppose) and recently I’ve gotten back in to using the masked-email feature of Fastmail for random sites that require email so that they can spam me (err I mean validate, yeah definitely validate). The accumulation of these email addresses plus the new influx of masked email had me wishing for a quick visual indicator in neomutt to know who an email was sent to. I use Monolisa as my primary font but have Jetbrains Mono Nerd Font as my fallback for characters not in the Monolisa set, which gave me an idea to use some of the fun icons in the Nerd Font set as indicators.
This is fairly simple to do in Neomutt, the
$index_format
variable determines what each line looks like, and we can combine that with an
index-format-hook which acts on an item to create a variable substitute in the
$index_format. I can now create hooks for each email alias/pattern, assign to
a name, and then prepend that output to the index format.
More concretely it looks like the following (nerd-font used in this blog if you’re blocking fonts you’ll have to trust me).
index-format-hook icon '~t @fastmail\.com$' ''
index-format-hook icon '~t @mac\.com$' ''
index-format-hook icon '~t @me\.com$' ''
set index_format = "%-2@icon@ $index_format"and live, shows up in the leftmost gutter:

This is nice though it’s important to note that if someone CC’s me or uses an
opaque mailing list feature the TO: icon could be blank (unknown) or even wrong
(if the general TO: address was one of the listed domains). That’s fine, this is
good enough for now. Just one little thing that makes my life just a little
better.