unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: James Cook <falsifian@falsifian.org>
To: Michael J Gruber <michaeljgruber+grubix+git@gmail.com>
Cc: notmuch@notmuchmail.org
Subject: Re: Recommended method to pair Notmuch with Neovim?
Date: Wed, 19 Apr 2023 15:57:03 +0000	[thread overview]
Message-ID: <xucmdhxymx2pcmxrr5bjulahefbhroacgeypkve2ardzhtdjzk@j6gushjn3ahu> (raw)
In-Reply-To: <168188941816.175140.2575980894072905411.michaeljgruber+grubix+git@gmail.com>

> Is there any good documentation on neomutt's notmuch support beyond what
> is on their website? I currently use alot for its great notmuch support
> (in particular tag completion with search and tag inyterfaces, multiple
> "tabs"/views) but find myself switching to neomutt for its better mime
> support (plus s/mime) and features like thread split & join, so far
> mostly maildir backed. neomutt's doc probably tell you everything you
> need to know to set up a notmuch-friendly user experience, but ...
> I know multiple views will not be a thing in neomutt. Easy tagging and
> nm-based search are a must, though. Being able to switch to the "maildir
> view" of a message (so that you can rearrange messages within your
> maildir folder tree) would be a plus.
> 
> Michael

I referred to this page a lot:

https://neomutt.org/feature/notmuch

There was an 11-month gap between releases (due to lingering bugs) so I
suggest trying to get a version released this year (though the 20220429
version was working pretty well for me too).

Searching:

The vfolder-from-query command lets you type a notmuch search query and
shows the results like a folder. To refresh the folder's content (e.g.
after updating tags) I find it helpful to type "c" to switch folders,
and type "^" as the folder name, which means "the folder I'm already
at". For some reason "$" doesn't cause the folder to reload.

The "entire-thread" command is useful too: if your search pulls in some
emails from a thread and you want to see the reast, simply run the
"entire-thread" command (I bind it to "+") with the cursor on one of
them, and the rest will be added to the current virtual mailbox.

Tagging:

The modify-labels command lets you type e.g. "-inbox +spam" to change
tags. It has tab completion. I've been meaning to add custom shortcuts
for comman changes I make, e.g. -inbox.

Maildir view:

I don't know exactly what you mean by switching to the maildir view of a
message. You can freely switch between real maildirs and notmuch search
results when changing folders (see vfolder-from-query). Maybe you want a
way to automatically go to the real Maildir folder containing the
selected search result; I don't know if that's possible (and there could
be ambiguity if files in different folders have the same message id).
You might have to run "notmuch new" after making maildir changes?

Other / example config:

"%g" in the index_format option shows a message's tags.

I've copied most of my own config below the signature.

-- 
James


##
## Folder configuration
##

set folder=~/var/mbsync/falsifian.org
set spool_file="notmuch inbox"
set postponed=+Drafts
set record=+Sent

##
## Notmuch and mailboxes
##

set nm_db_limit=10000
set nm_exclude_tags="spam"
set nm_record=yes

named-mailboxes "notmuch inbox" "notmuch://?query=tag:inbox and not tag:reading"

##
## Aliases
##

alias a-b agora-business@agoranomic.org
# etc...; instead of aliases, I mostly use my address book stored in khard by
# pressing ctrl-T after typing the beginning of a name; see the "query_command"
# option below.

##
## Key bindings, including macros
##

# Make it (hopefully) really hard to accidentally delete messages.
unbind * d
unbind * "\Cd"

bind index S vfolder-from-query

# From https://neomutt.org/feature/custom-tags
bind index,pager \` modify-labels

# From https://neomutt.org/feature/notmuch
bind index,pager + entire-thread

##
## Miscellaneous
##

set forward_format="Fwd: %s"
set from="James Cook <falsifian@falsifian.org>"
set index_format="%[%g%m%d %H%M] %Z %-15.15L %s%* |%g %?E?%e/%E?"
set pager_index_lines=5
set pager_stop
set query_command="khard email --parsable %s"
set send_charset="utf-8"
# Without this, sending mail from a DragonflyBSD machine via my SMTP server to the Agora mail lists fails because the envelope-from ends up being falsifian@<machine hostname> instead of agora@falsifian.org.
set use_envelope_from=yes

# I don't know if these are relevant to notmuch; I added these lines when I was
# using IMAP with neomutt.
#
# Caching. header_cache_backend is appended later by drist script.
# Use the same directory for both caches. (The manual says this will work.)
set header_cache="~/.cache/neomutt"
set message_cachedir="~/.cache/neomutt"

# Per-recipient settings, and generic default settings. (Without the default
# send-hook, the per-recipient settings would stick, since they last until the
# end of the session.)

send-hook . 'unmy_hdr From: ; set signature="echo James|"'
send-hook '~t ^(agora-.*@agoranomic.org\|agora@listserver.tue.nl)$' 'my_hdr From: Falsifian <agora@falsifian.org> ; set signature="echo Falsifian|"'

# Header weeding and ordering
ignore *
unignore from date subject to cc list-id reply-to
hdr_order subject from date to cc list-id reply-to
set header_cache_backend="kyotocabinet"

  reply	other threads:[~2023-04-19 15:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-17  2:57 Recommended method to pair Notmuch with Neovim? Ralph Seichter
2023-04-17 12:41 ` Felipe Contreras
2023-04-17 13:34   ` inwit
2023-04-17 22:22     ` Ralph Seichter
2023-04-17 23:44       ` Jon Fineman
2023-04-18 19:12         ` Ralph Seichter
2023-04-18 21:31           ` Jon Fineman
2023-04-18 22:47             ` Ralph Seichter
2023-04-19  2:19               ` James Cook
2023-04-19  7:30                 ` Michael J Gruber
2023-04-19 15:57                   ` James Cook [this message]
2023-04-17 19:35   ` Ralph Seichter
2023-04-18  0:21     ` Felipe Contreras
2023-04-18  6:03       ` Ralph Seichter
2023-04-18  7:22         ` Felipe Contreras
2023-04-18 18:03           ` Ralph Seichter
2023-04-18 23:43             ` Felipe Contreras
2023-04-23 23:45 ` Ralph Seichter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xucmdhxymx2pcmxrr5bjulahefbhroacgeypkve2ardzhtdjzk@j6gushjn3ahu \
    --to=falsifian@falsifian.org \
    --cc=michaeljgruber+grubix+git@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).