Herr Bischoff

A One-Step Macro for Properly Integrating mu Like notmuch into mutt

While I’m sure it’s rather trivial, I’m still documenting it here for posterity. I was looking into how to do this properly.

First, create a tiny shell script and put it somewhere in your PATH:

#!/bin/sh

read -p "Query: " query && \
mu find --clearlinks --format=links --linksdir=~/.cache/mutt/search_results "${query}"

Then, add to your .muttrc:

macro index / "<enter-command>unset wait_key<enter><shell-escape>mu-search<enter><change-folder-readonly>~/.cache/mutt/search_results<enter>" "search mail (using mu)"

Now you can globally search for any message content in your index by pressing /.