Custom backend based Tags Feature

Implements Notmuch tags and Imap keywords

1. Support

Since: NeoMutt 2017-10-16

Dependencies:

2. Introduction

Some backends allow to index and tags mail without storing the tags within the mail envelope. Two backends are currently implementing this feature. Notmuch handles them natively and IMAP stores them in custom IMAP keywords.

3. Variables

Table 25.1. Custom tags Variables

Name Type Default
hidden_tags string unread,draft,flagged,passed,replied,attachment,signed,encrypted

4. Functions

Notmuch adds the following functions to NeoMutt. By default, none of them are bound to keys.

Table 25.2. Notmuch/IMAP Functions

Menus Function Description
index,pager <modify-labels> add, remove, or toggle tags: IMAP: edit the tags list Notmuch: [+]<tag> to add, -<tag> to remove, !<tag> to toggle(notmuch) tags. Note: Tab completion of tag names is available
index,pager <modify-labels-then-hide> add, remove, or toggle tags IMAP: edit the tags list Notmuch: [+]<tag> to add, -<tag> to remove, !<tag> to toggle labels and then hide or unhide the message by changing the "quasi-deleted" to match if it would be shown when requerying. Normal redisplay rules apply here, so the user must call <sync-mailbox> for the changes to be displayed. Note: Tab completion of tag names is available.

5. Commands

tag-transforms tag transformed-string { tag transformed-string ...}
tag-formats tag format-string { tag format-string ...}

6. Colors

Adds these to index-color feature:

Table 25.3. Index Colors

Object Pattern Highlights
index_tag yes an individual message tag, %G, uses tag name
index_tags no the transformed message tags, %g or %J

7. neomuttrc

# Example NeoMutt config file for the custom tags feature.

# VARIABLES - shown with their default values
# --------------------------------------------------------------------------
# This variable specifies private notmuch tags which should not be printed
# on screen (index, pager).
set nm_hidden_tags = "unread,draft,flagged,passed,replied,attachment,signed,encrypted"
# --------------------------------------------------------------------------
# FUNCTIONS - shown with an example mapping
# --------------------------------------------------------------------------
# modify (notmuch/imap) tags
bind index,pager \` modify-labels
# modify (notmuch/imap) tag non-interactively.
bind index,pager tt "<modify-labels>!todo\n" "Toggle the 'todo' tag"
# modify labels and then hide message
# bind index,pager ??? modify-labels-then-hide
# --------------------------------------------------------------------------
# COMMANDS - shown with an example
# --------------------------------------------------------------------------
# Replace some tags with icons
# tag-transforms tag transformed-string { tag transformed-string ...}
# tag-transforms "inbox"   "i"   \
#                "unread"  "u"   \
#                "replied" "↻ "  \
#                "sent"    "➥ "  \
#                "todo"    "T"   \
#                "deleted" "DEL" \
#                "invites" "CAL"

# The formats must start with 'G' and the entire sequence is case sensitive.
# tag-formats tag format-string { tag format-string ...}
# tag-formats "inbox"   "GI" \
#              "unread"  "GU" \
#              "replied" "GR" \
#              "sent"    "GS" \
#              "todo"    "Gt" \
#              "deleted" "GD" \
#              "invites" "Gi"

# Now instead of using '%g' or '%J' in your $index_format, which lists all tags
# in a non-deterministic order, you can something like the following which puts
# a transformed tag name in a specific spot on the index line:
# set index_format='%4C %S %[%y.%m.%d] %-18.18n %?GU?%GU& ? %?GR?%GR& ? %?GI?%GI& ? %s'

# The %G formatting sequence may display all tags including tags hidden by
# nm_hidden_tags.
#
# --------------------------------------------------------------------------
# COLORS - some unpleasant examples are given
# --------------------------------------------------------------------------
# These symbols are added to the index-color feature:
# an individual message tag, %G, uses tag name
# this symbol uses a pattern
color index_tag red white "inbox"
# the transformed message tags, %g
# this symbol does not use a pattern
color index_tags green default
# --------------------------------------------------------------------------
# vim: syntax=neomuttrc

8. Credits

Search by Algolia