From 70e3dcc1d45ae102d161a971ddb1baa9fcbe87be Mon Sep 17 00:00:00 2001 From: Suleyman Farajli Date: Sun, 5 Apr 2026 21:57:49 +0400 Subject: feat: introduce mutt --- config/mutt/muttrc | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++ config/mutt/strip.sh | 7 ++++ 2 files changed, 119 insertions(+) create mode 100644 config/mutt/muttrc create mode 100755 config/mutt/strip.sh (limited to 'config') diff --git a/config/mutt/muttrc b/config/mutt/muttrc new file mode 100644 index 0000000..581b4f2 --- /dev/null +++ b/config/mutt/muttrc @@ -0,0 +1,112 @@ +source "~/.config/mutt/account.muttrc" # To be added manually + +# General settings +alternative_order text/plain text/enriched text/html # prefer plain text over HTML when multiple MIME parts exist +auto_view text/html # automatically display HTML emails +ignore * # ignore all headers by default (cleaner view) +set abort_noattach = ask-yes # warn if sending mail without attachment when it looks like you meant to +set abort_noattach_regex = "(attach|attachment|attached|enclosed|file|pdf|see file|see attached)" # trigger words for above warning +set auto_tag # tagging applies to all tagged messages automatically +set date_format="%d-%m-%Y" # date format in index/pager +set display_filter="~/.config/mutt/strip.sh" # external script to filter/clean message display +set fast_reply = yes # skip prompts when replying +set fcc_attach # include attachments when saving sent mail (FCC) +set forward_quote # quote original message when forwarding +set help = no # disable help line at top +set include # include original message in replies +set index_format="%4C %Z %{%b %d} %-20.20L %?g?[%g] ?%s" # format of message list (index) +set mail_check_stats=yes # show mailbox stats when checking mail +set mark_old = no # don’t mark unread messages as old automatically +set markers = no # disable "+" markers for wrapped lines +set mbox_type = Maildir # use Maildir format for mail storage +set menu_context=5 # number of context lines in menus +set menu_scroll # scroll menus instead of paging +set mime_forward = yes # forward messages as MIME attachments +set pager_format="%{%b %d} | %F | %s" # format in message pager +set pipe_decode=yes # decode messages before piping +set pipe_decode_weed=yes # also apply weed when piping +set query_command="abook --mutt-query '%s'" # use abook for address lookup +set sidebar_format="%D%* %%S" # sidebar mailbox display format +set sidebar_visible = no # sidebar hidden by default +set sidebar_width = 20 # sidebar width +set sig_dashes=yes # add "-- " before signature +set signature="~/.config/mutt/signature" # signature file +set sleep_time=0 # no delay after commands +set sort=reverse-date # newest emails first +set sort_re # sort threads by most recent message +set status_format=" %f | Unread: %u Total: %m " # status bar format +set strict_threads # stricter email threading rules +set use_threads = threads # enable threading +set wait_key = no # don’t wait for keypress after commands +set weed = yes # hide uninteresting headers + +# Mail directories +set spoolfile = +INBOX +set postponed = +Drafts +set trash = +Trash +set record = +Sent + +# Classical mailboxes, useful for mutt build were notmuch is not enabled +# mailboxes +INBOX +Archive +Drafts +Junk +Sent +Trash + +# If notmuch enabled +named-mailboxes \ + "INBOX" "notmuch://?query=folder:INBOX" \ + "Archive" "notmuch://?query=folder:Archive" \ + "Drafts" "notmuch://?query=folder:Drafts" \ + "Junk" "notmuch://?query=folder:Junk" \ + "Sent" "notmuch://?query=folder:Sent" \ + "Trash" "notmuch://?query=folder:Trash" + +# VI keybinds +unbind index,pager G +unbind index,pager g +bind attach l view-mailcap +bind browser l select-entry +bind index l display-message +bind pager j next-line +bind pager k previous-line +bind pager l view-attachments +macro index G "" "go to bottom" +macro index gg "" "go to top" +macro pager G "" "go to bottom of message" +macro pager gg "" "go to top of message" + +# Keybinds and macros +bind editor complete-query +bind index,pager noop +bind index,pager noop +macro index,pager S "!notmuch new" +bind index,pager \CJ sidebar-next +bind index,pager \CK sidebar-prev +bind index,pager \CL sidebar-open +bind index,pager i noop +bind index,pager y modify-labels +bind pager,attach h exit +macro index "m" "?" "save tagged mails or current mail" +macro index f "set use_threads = flat" +macro index t "set use_threads = threads" +macro index,pager "" "save message" +macro index,pager a "set my_pipe_decode=\$pipe_decode pipe_decodeabook --add-emailset pipe_decode=\$my_pipe_decode; unset my_pipe_decode" "add the sender address to abook" +macro index,pager e "" "toggle sidebar" +macro index,pager q "" "notmuch query" +macro index,pager e "unignore from to cc date subject$MUTT_EDITOR -" "open in editor" +macro index,pager i1 "set index_format=\"%4C %Z %{%b %d} %-20.20L %?g?[%g] ?%s\"" "index: default" +macro index,pager i2 "set index_format=\"%4C %Z %-20.20L %?g?[%g] ?%s\"" "index: default" +macro index,pager i3 "set index_format=\"%4C %Z %{%b %d} %-20.20L %-8b %?g?[%g] ?%s\"" "index: default" +macro index,pager i4 "set index_format=\"%4C %Z %-20.20L %s\"" "index: default" +macro index,pager i5 "set index_format=\"%4C %Z %?g?[%g] ?%s\"" "index: default" +macro pager s "ignore *" "do not show headers" +macro pager l "unignore from to cc date subject" "show essential headers" +macro pager u "" "toggle headers" + +# Full URL regex +color body cyan default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]" + +# Dracula-ish palette +color index_number color241 default +color index_flags color215 default +color index_date default default +color index_author color117 default +color index_tags color110 default +color indicator color231 color60 diff --git a/config/mutt/strip.sh b/config/mutt/strip.sh new file mode 100755 index 0000000..72c8324 --- /dev/null +++ b/config/mutt/strip.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +sed '/\[--.*--\]/d' | + sed '/\[\(--[^]]*--\|cid:[^]]*\)\]/d' | + sed '/\[\(twitter\|instagram\|linkedin\|facebook\)\]/d' | + sed '/[^[:space:]]/,$!d' | + awk 'BEGIN{blank=0} /^[[:space:]]*$/{blank++; if(blank<=2) print; next} {blank=0; print}' -- cgit v1.2.3