Status Color Feature

Custom rules for theming the status bar

1. Support

Since: NeoMutt 2016-03-07

Dependencies: None

2. Introduction

The status-color feature allows you to theme different parts of the status bar (also when it's used by the index).

Unlike normal color commands, color status can now take up to 2 extra parameters (regex, num).

3. Commands

color status foreground background [ regex [ num ]]

With zero parameters, NeoMutt will set the default color for the entire status bar.

With one parameter, NeoMutt will only color the parts matching the regex.

With two parameters, NeoMutt will only color the num'th sub-match of the regex.

4. Colors

Table 38.1. Status Colors

Name Default Color Description
status reverse Status bar

5. neomuttrc

# Example NeoMutt config file for the status-color feature.

# The 'status-color' feature allows you to theme different parts of
# the status bar (also when it's used by the index).

# For the examples below, set some defaults
set status_format='-%r-NeoMutt: %f [Msgs:%<M?%M/>%m%<n? New:%n>%<o? Old:%o>%<d? Del:%d>\
%<F? Flag:%F>%<t? Tag:%t>%<p? Post:%p>%<b? Inc:%b>%<l? %l>]---(%s/%S)-%>-(%P)---'
set index_format='%4C %Z %{%b %d} %-15.15L (%<l?%4l&%4c>) %s'
set use_threads=yes
set sort=last-date-received
set sort_aux=date
# 'status color' can take up to 2 extra parameters
# color status foreground background [ regex [ num ]]
# 0 extra parameters
# Set the default color for the entire status line
color status blue white
# 1 extra parameter
# Set the color for a matching pattern
# color status foreground background regex
# Highlight New, Deleted, or Flagged emails
color status brightred white '(New|Del|Flag):[0-9]+'
# Highlight mailbox ordering if it's different from the default
# First, highlight anything (*/*)
color status brightred default '\([^)]+/[^)]+\)'
# Then override the color for one specific case
color status default default '\(threads/last-date-received\)'
# 2 extra parameters
# Set the color for the nth submatch of a pattern
# color status foreground background regex num
# Highlight the contents of the []s but not the [] themselves
color status red default '\[([^]]+)\]' 1
# The '1' refers to the first regex submatch, which is the inner
# part in ()s
# Highlight the mailbox
color status brightwhite default 'NeoMutt: ([^ ]+)' 1
# Search for 'NeoMutt: ' but only highlight what comes after it

# vim: syntax=neomuttrc

7. Known Bugs

None

8. Credits

David Sterba, Thomas Glanzmann, Kirill A. Shutemov, Richard Russon

Search by Algolia