#!/bin/bash set -o pipefail thread_id=$(notmuch search date:1970..2021 | fzf --reverse --preview 'bash -c '\'' id=$(echo "$1" | cut -d" " -f1 | cut -d":" -f2) notmuch show --format=raw "thread:$id" | mshow -A text/plain /dev/stdin | w3m -T text/html -dump '\'' _ {}' | cut -d' ' -f1 | cut -d':' -f2) [[ -z $thread_id ]] && exit 0 notmuch show --format=raw "thread:$thread_id" | nvim -c 'set ft=mail' -c 'nmap q :q!' -