Color Command — Syntax Reference#
Overview#
The color command defines colors for NeoMutt’s user interface. There are
three kinds of color object, each with different syntax:
Kind |
Syntax |
Matching |
Rules |
|---|---|---|---|
Simple |
|
none |
single |
Regex |
|
regex |
multiple |
Pattern |
|
pattern |
multiple |
Simple objects have a single color. Setting a new color replaces the old one.
Regex and Pattern objects are cumulative. Each
colorcommand adds a rule to a list. All matching rules are applied in order.
General Syntax#
color <object> [<attribute> ...] <foreground> <background> [<regex-or-pattern>]
Color Names#
NeoMutt supports several ways to specify a color:
Format |
Example |
Description |
|---|---|---|
Named color |
|
One of 8 basic terminal colors |
|
|
Bright/bold variant of a named color |
|
|
Light variant (same as bright on most terms) |
|
|
Alert variant (same as bright on most terms) |
|
|
Terminal’s default foreground or background |
Palette |
|
256-color palette (color0 .. color255) |
RGB hex |
|
24-bit true color (requires |
The eight named colors are: black, red, green, yellow, blue, magenta, cyan, white.
Attributes#
Zero or more attributes may be placed before the foreground color:
Attribute |
Effect |
|---|---|
|
Bold text |
|
Underlined text |
|
Italic text |
|
Swap foreground and background |
|
Terminal’s standout mode |
|
Clear all attributes |
Multiple attributes may be combined:
color indicator bold underline white blue
Simple Color Objects#
Simple objects have a single color.
Each color command replaces any previous color for that object.
General UI#
Object |
Description |
|---|---|
|
Plain text, the default color for all text |
|
Error messages on the message line |
|
Warning messages on the message line |
|
Informational messages on the message line |
|
The selected/highlighted line in any menu |
|
Question/prompt text on the message line |
|
Option letters in a prompt (e.g. |
|
Matching text when searching in the pager |
|
The |
|
The progress bar |
|
Bold text in the pager |
|
Italic text in the pager |
|
Underlined text in the pager |
color normal default default
color error red default
color warning yellow default
color message cyan default
color indicator reverse white black
color prompt yellow default
color options brightcyan default
color search black yellow
color markers brightblue default
color progress white blue
color bold brightwhite default
color italic brightyellow default
color underline brightgreen default
Pager & Message Display#
Object |
Description |
|---|---|
|
Default color for message headers |
|
Signature lines at the end of a message |
|
|
|
MIME attachment info lines in the pager |
|
Thread-tree drawing characters |
color attachment magenta default
color hdrdefault cyan default
color signature brightblack default
color tilde brightblack default
color tree red default
Compose Screen#
Object |
Description |
|---|---|
|
Header labels ( |
|
Security indicator: no encryption/signing |
|
Security indicator: message will be signed |
|
Security indicator: message will be encrypted |
|
Security indicator: signed and encrypted |
color compose_header brightblue default
color compose_security_none red default
color compose_security_sign yellow default
color compose_security_encrypt green default
color compose_security_both brightgreen default
Quoted Text#
Quoted text levels 0-9, for nested email replies.
quoted0 (or the deprecated alias quoted) is the outermost level.
Object |
Description |
|---|---|
|
Quoted text, level 0 (outermost) |
|
Quoted text, level 1 |
|
Quoted text, level 2 |
… |
… |
|
Quoted text, level 9 (deepest) |
color quoted0 blue default
color quoted1 cyan default
color quoted2 green default
color quoted3 yellow default
color quoted4 red default
Help Page Stripes#
Object |
Description |
|---|---|
|
Even-numbered lines on the help page |
|
Odd-numbered lines on the help page |
color stripe_even default color234
color stripe_odd default default
Regex Color Objects#
Regex objects are cumulative — each color command adds a rule to a list.
Multiple rules can match the same text; all matching rules apply in order, with later rules overriding earlier ones for overlapping regions.
The regex is a POSIX Extended Regular Expression and is matched against the text being displayed. Case-sensitive matching is used when the regex contains uppercase letters; otherwise matching is case-insensitive.
body#
Colorise text in the message body matching a regex.
color body [<attr> ...] <fg> <bg> <regex>
The regex is matched against each line of the message body.
# URLs
color body brightblue default "(https?|ftp)://[^ >\"]*"
# Email addresses
color body brightyellow default "[a-z0-9._-]+@[a-z0-9._-]+"
# Bold text (*word*)
color body bold default default "\\*[a-z]+\\*"
# Underline text (_word_)
color body underline default default "_[a-z]+_"
# IPv4 addresses
color body cyan default "[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}"
header#
Colorise message headers matching a regex. The regex is matched against the entire header line (name and value).
color header [<attr> ...] <fg> <bg> <regex>
color header brightcyan default "^From:"
color header brightcyan default "^Subject:"
color header cyan default "^To:"
color header cyan default "^Cc:"
color header brightblack default "^Date:"
color header yellow default "^X-Mailer:"
attach_headers#
Colorise MIME attachment header lines in the pager, matching a regex.
color attach_headers [<attr> ...] <fg> <bg> <regex>
color attach_headers brightmagenta default "image/"
color attach_headers green default "application/pgp-signature"
Pattern Color Objects#
Pattern objects are cumulative — each color command adds a rule to a list.
Multiple rules can match the same message; all matching rules apply in order.
The pattern uses NeoMutt’s search pattern language (the same syntax used by limit, tag-pattern, score, hooks, etc.).
Common pattern operators:
Pattern |
Matches |
|---|---|
|
All messages |
|
New (unread, recent) messages |
|
Old (unread, not recent) messages |
|
Unread messages |
|
Read messages |
|
Flagged messages |
|
Deleted messages |
|
Tagged messages |
|
Messages from |
|
Messages to |
|
Messages with subject matching |
|
Messages dated within a range |
index#
Colorise the entire index line for messages matching a pattern.
color index [<attr> ...] <fg> <bg> <pattern>
color index brightgreen default "~N"
color index red default "~F"
color index brightblack default "~D"
color index yellow default "~T"
color index cyan default "~U"
color index magenta default "~f boss@company\\.com"
color index brightred default "~s urgent"
index_* Sub-fields#
Colorise individual fields within the index line.
These all use the same pattern syntax as index.
Object |
Field colored |
|---|---|
|
Author/sender name |
|
Number of messages in a collapsed thread |
|
Date field |
|
Message flags field |
|
X-Label field ( |
|
Index number |
|
Message size |
|
Subject field |
|
Individual tag ( |
|
Tags field ( |
# Highlight the author of new messages
color index_author brightblue default "~N"
# Highlight the subject of flagged messages
color index_subject brightred default "~F"
# Highlight the date of messages from today
color index_date brightgreen default "~d<1d"
# Dim the size of read messages
color index_size brightblack default "~R"
# Highlight flags on deleted messages
color index_flags red default "~D"
Status Bar Colors#
The status object is a special case.
Used without a regex, it is a simple (single) color.
Used with a regex, it is cumulative and supports submatch highlighting.
Simple status color#
color status [<attr> ...] <fg> <bg>
color status black cyan
color status bold white blue
Status bar with regex#
Colorise parts of the status bar matching a regex.
color status [<attr> ...] <fg> <bg> <regex>
# Highlight the mailbox name in the status bar
color status brightwhite blue "INBOX"
# Highlight unread count
color status brightyellow blue "Msgs:[0-9]+"
Status bar with submatch#
Colorise only the Nth parenthesized submatch of a regex.
color status [<attr> ...] <fg> <bg> <regex> <num>
# Colorise just the number inside "Msgs:NNN"
color status brightred blue "Msgs:([0-9]+)" 1
Removing Colors#
uncolor#
Remove color rules.
uncolor <object> { * | <pattern> ... }
uncolor <object> *— remove all rules for that objectuncolor <object> <pattern>— remove a specific rule by its regex/pattern string
Simple objects are reset to the default color. Regex/pattern objects have matching rules removed from their list.
# Remove all body colors
uncolor body *
# Remove a specific index color rule
uncolor index "~D"
# Remove a specific header color rule
uncolor header "^X-Mailer:"
Quick Reference#
Simple (single color, last-one-wins)#
attachment compose_header hdrdefault
bold compose_security_both indicator
error compose_security_encrypt markers
italic compose_security_none message
normal compose_security_sign options
progress search signature
prompt stripe_even tilde
tree stripe_odd underline
warning quoted0..quoted9
sidebar_background sidebar_highlight sidebar_ordinary
sidebar_divider sidebar_indicator sidebar_spool_file
sidebar_flagged sidebar_new sidebar_unread
Regex (cumulative, POSIX regex)#
attach_headers body header
Pattern (cumulative, NeoMutt search pattern)#
index index_date index_number
index_author index_flags index_size
index_collapsed index_label index_subject
index_tag index_tags
Special (both modes)#
status (no regex = simple, with regex = cumulative)