From fddbbf252c622c63675b78b23965a6dfce6689d2 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 18 May 2020 03:42:04 +1200 Subject: Completely rewrite muttrc --- mutt/muttrc | 256 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 126 insertions(+), 130 deletions(-) (limited to 'mutt/muttrc') diff --git a/mutt/muttrc b/mutt/muttrc index fc04886f..517773d9 100644 --- a/mutt/muttrc +++ b/mutt/muttrc @@ -1,135 +1,118 @@ -# Addresses -set query_command = 'abook --mutt-query %s' -set reverse_name -set use_domain -set use_from +# Prefer the plain text part of multipart emails, followed by the HTML part, +# followed by any other parts. Decode the text/html part with .mailcap's +# chosen program (I favour Lynx). +# +alternative_order text/plain text/html * +auto_view text/html -# Alerts +# If an outgoing message looks like I meant to attach something, and there +# isn't an attachment, prompt me to make sure I haven't forgotten it. +# I normally don't like this sort of nagging, but I'm making an exception in +# this case, as I really do trip up on this a lot. The default pattern of just +# 'attach' is a bit too aggressive, so I write a slightly softer one. +# +set abort_noattach = ask-no +set abort_noattach_regexp = "attached is|find attached|i've attached" + +# Don't send terminal bells on errors, but do send them when new mail arrives, +# because that should light up my tmux window label and/or urxvt window. +# +unset beep set beep_new -# Attachments -attachments +A */.* -attachments -A text/x-vcard application/pgp.* -attachments -A application/x-pkcs7-.* -attachments +I text/plain -attachments -A message/external-body -attachments -I message/external-body - -# Caching -set header_cache = '~/.cache/mutt/headers' - -# Colors -color attachment brightyellow default -color hdrdefault cyan default -color indicator black white -color markers brightred default -color normal default default -color quoted green default -color signature cyan default -color status default color22 -color tilde brightblack default -color tree default default - -# Completion -bind editor complete-query -bind editor ^T complete - -# Files -set delete = ask-yes -unset move - -# Flags -unset mark_old - -# Headers -ignore * -unignore Date: From: To: Cc: Bcc: Subject: -hdr_order Date: From: To: Cc: Bcc: Subject: -set edit_headers - -# Index -set index_format = '%4C %Z %{%b %d %Y} %-15.15L (%?l?%4l&%4c?) %?H?[%H] ?%s' - -# Interaction -unset abort_unmodified +# Don't prompt me for confirmation if I move messages into an existing mailbox; +# just do it. +# unset confirmappend -unset wait_key -set quit = ask-yes -# Intervals -set mail_check = 5 -set sleep_time = 0 - -# Mailboxes -set confirmcreate +# Use the GPGME library for PGP. Sign replies to messages that are themselves +# signed or encrypted. +# +set crypt_use_gpgme +set crypt_replysign +set crypt_replysignencrypted -# Menus -set menu_context = 1 +# Default to a subject format for forwarded messages that's more familiar to +# most mail users, unless sending mail to a list where they're more likely to +# appreciate the nicer default that uses square brackets and the author email +# address. +# +send-hook ~A \ + 'set forward_format = "Fw: %s"' +send-hook ~l \ + 'reset forward_format' + +# Cache message headers for speed; this really helps. +# +set header_cache = '~/.cache/mutt/headers' -# MIME -mime_lookup application/octet-stream +# I don't really need the major functions' key mappings displayed to me all the +# time; I'll look them up in when I do need them. This buys me another +# row of screen space. +# +unset help + +# Save command history; this saves other kinds of history as well, but all +# I really want is to be able to run the same commands again even after I quit +# Mutt. We can afford to keep 2^8 of these, since it's the future and all. +# +set history = 256 +set history_file = ~/.cache/mutt/history +set save_history = $history + +# Always put a quoted copy of the whole message in a reply text for me to chop +# up and respond to in Vim--no need to prompt me (the default does that). +# +set include -# Pager -set pager_context = 1 -set pager_format = '%4C %Z %[!%b %e at %I:%M %p] %.20n %s%* -- (%P)' -set pager_stop +# Tweak the index format to include spam tagging information, if any, with the +# %H format string +# +set index_format = '%4C %Z %{%b %d %Y} %-15.15L (%?l?%4l&%4c?) %?H?[%H] ?%s' -# Presentation/formatting +# Don't show any nasty little markers at the start of wrapped lines. That's +# the sort of thing Vim cares about, if need be. +# unset markers -set smart_wrap -set text_flowed -set tilde -alternative_order text/plain text/html * -auto_view text/html -# Quoting -set quote_regexp = '^(>[ \t]*)+' +# Don't move on to the next message if we're at the end of the current one just +# because I executed . +# +set pager_stop -# Responses -set fast_reply -set forward_attachments -set forward_format = 'Fw: %s' -set include -set use_envelope_from +# Use the abook program for finding and completing addresses with ^T. I do use +# the aliases system for regular correspondents, too. +# +set query_command = 'abook --mutt-query %s' + +# Don't delay on switching or altering mailboxes so that I see the messages; +# just do it straight away. +# +set sleep_time = 0 -# Searching/sorting -set sort = 'threads' -set sort_aux = 'last-date-received' +# Only use the headers with proper references to link messages in a thread; +# don't try to use pattern matches on subjects, which might be rubbish like +# "hi". If I need to link a thread together because it's been broken somehow, +# I'll do that manually. +# set strict_threads -set thorough_search -# SSH -set time_inc = 250 +# Use format=flowed, continuing paragraphs for lines that end with a single +# space, and use that wrapping information to use the full width of the +# terminal for the wrapping display. +# +set text_flowed +set reflow_wrap = 0 + +# Don't wait for me to press a key after running a command if it exited +# successfully; this still warns me if something failed, though. +# +unset wait_key -# Encryption settings -set crypt_replysign -set crypt_replyencrypt -set crypt_replysignencrypted -set crypt_use_gpgme -set crypt_use_pka -set crypt_verify_sig - -# Do decode classic PGP messages, though we'll never write them -set pgp_auto_decode - -# Vim-ish bindings -bind index gg first-entry -bind index G last-entry -bind pager gg top -bind pager G bottom -bind index,pager \Cu half-up -bind index,pager \Cd half-down -bind generic,index,browser,pager \Cf next-page -bind generic,index,browser,pager \Cb previous-page - -# Turn off annoying mailbox lock feature -bind index '%' noop - -# Swap j/k (next/prev undeleted) with J/K (next/prev item) -bind index j next-entry -bind index k previous-entry -bind index J next-undeleted -bind index K previous-undeleted +# Save message to whatever box Mutt guesses, without confirmation +macro index,pager S \ + '' \ + 'Move message to default mailbox without confirmation' # Shortcuts to jump to mailboxes macro generic,index,browser,pager gi \ @@ -141,21 +124,9 @@ macro generic,index,browser,pager gs \ macro generic,index,browser,pager gb \ '-' \ 'Change to previous' -# The format here is pretty weird, but it copes correctly with changes to the -# variable that occur *after* the macro is defined, and there isn't -# a punctuation shortcut for it like there is for the previous three. I'd love -# to know if there's a better way to do this that I've missed in the manual. -macro generic,index,browser,pager gd '\ -push "$postponed"' \ - 'Change to drafts' - -# Blindly save message to whatever box is suggested -macro index,pager S \ - '' \ - 'Save message blindly' # Shortcut to add addresses to abook -macro index,pager A \ +macro index,pager \\A \ 'abook --add-email-quiet' \ 'Add sender address to abook' @@ -166,5 +137,30 @@ macro generic,index,browser,pager \\R '\ echo "Reloaded with $alias_file"' \ "Clear hooks and reload" -# Machine or account specific settings +# Shortcut to toggle thread display +set my_sort_alt = threads +macro index \\t '\ +set my_sort_cur = $sort\ +set sort = $my_sort_alt\ +set my_sort_alt = $my_sort_cur' \ + "Toggle thread display" + +# Set a few simple colors just for a quick visual cue of which tool I'm looking +# at and for some visual distinction between text, signature, and quote. The +# navigation bar is a nice dark green. +# +color attachment \ + brightyellow default +color hdrdefault \ + brightcyan default +color quoted \ + brightgreen default +color signature \ + cyan default +color status \ + default color22 + +# Load machine-specific or account-specific settings from the helper script in +# muttrc.d, and w're done. +# source ~/.config/mutt/muttrc.d/src| -- cgit v1.2.3