commit ac83a40e84f10ee7d1b39a59d0c59f58aa63a8b5 (patch)
parent 6504827bf52c1d9776f4bbf92f42958e6228099d
Author: Alex Karle <alex@alexkarle.com>
Date: Tue, 7 Jul 2020 23:21:06 -0400
mutt: Add colors for nested quotes and patch diffs
I've been subscribing to a lot of mailing lists recently, and a good few
of them send diffs back and forth regularly. It's significantly easier
to follow the conversation/code when:
1. Nested quotes are colored separately
2. The diffs are green/red colored like `git diff`
This is my first attempt at a color scheme -- fun stuff!
Diffstat:
1 file changed, 26 insertions(+), 10 deletions(-)
diff --git a/mutt/muttrc b/mutt/muttrc
@@ -2,16 +2,11 @@
# In pursuit of an email client that sucks less
################################################################################
-# General
+# General / Behavior
source ~/.config/mutt/muttrc.local
set ssl_force_tls = yes # Require encrypted connection
-# Appearance
-# TODO: maybe one day a color scheme...
-set sort=threads
-set sort_aux=reverse-last-date-received
-
# Attachments
set mailcap_path=~/.config/mutt/mailcap
auto_view text/html # tell mutt to load HTML via mailcap
@@ -31,14 +26,35 @@ my_hdr BCC: $from
# Use the `abook` program for contact management/completions
set query_command="abook --mutt-query '%s'"
-# Show some index in the pager
-set pager_index_lines=6
-
# Enables shelling out in macros without a pause
set wait_key=no
-# Basic colors...
+################################################################################
+# Appearance / Layout
+set sort=threads
+set sort_aux=reverse-last-date-received
+
+# Show some index in the pager
+set pager_index_lines=6
+
+# Restrict quotes to |, :, and > (default has } and # which match code)
+set quote_regexp="^([ \t]*[|>:])+"
color index yellow black ~U
+color quoted green black
+color quoted1 blue black
+color quoted2 magenta black
+color quoted3 yellow black
+color quoted4 red black
+
+# Patch highting
+color body green black "^\\+.*"
+color body red black "^-.*"
+color body magenta black "^\\+\\+\\+ b/.*"
+color body magenta black "^--- a/.*"
+color body magenta black "^@@.*@@"
+color body magenta black "^@@.*@@"
+color body magenta black "^diff --git.*"
+color body magenta black "^index [0-9a-z]{7}\\.\\.[0-9a-z]{7}.*"
################################################################################
# Bindings