mutt/muttrc @ 746ca2de7503

More
author Steve Losh <steve@stevelosh.com>
date Tue, 20 Sep 2022 12:53:14 -0400
parents 18cc4d4f4ac4
children c106ae0760f8
# Paths {{{

set alias_file       = ~/.mutt/alias         # where to store aliases
set header_cache     = ~/.mutt/cache/headers # where to store headers
set header_cache_backend=tokyocabinet
set message_cachedir = ~/.mutt/cache/bodies  # where to store bodies
# set certificate_file = ~/.mutt/certificates  # where to store certs
set mailcap_path     = ~/.mutt/mailcap       # entries for filetypes
set tmpdir           = ~/.mutt/temp          # where to keep temp files

# }}}
# Editor {{{

# Use Vim to compose email, with a few default options.
set editor = "nvim -c 'set ft=mdmail' -c 'normal! }' -c 'redraw'"

# }}}
# Contacts {{{

set query_command = "search-contacts"
bind editor <Tab> complete-query

# }}}
# Basic Options {{{

source ~/.vim/bundle/badwolf/contrib/badwolf.muttrc

set folder = ~/.mail     # mail location

set wait_key = no        # shut up, mutt
set mbox_type = Maildir  # mailbox type
set timeout = 3          # idle time before scanning
set mail_check = 0       # minimum time between scans
unset move               # gmail does that
set delete               # don't ask, just do
unset confirmappend      # don't ask, just do!
set quit                 # don't ask, just do!!
unset mark_old           # read/new is good enough for me
set beep_new             # bell on new mails
set pipe_decode          # strip headers and eval mimes when piping
set thorough_search      # strip headers and eval mimes before searching
set send_charset="us-ascii:utf-8:iso-8859-1"
set use_from             # respect the From: address the editor sends back

set sleep_time=0 # don't take for fucking ever to switch folders

# }}}
# PGP {{{

set pgp_decode_command="gpg %?p?--passphrase-fd 0? --no-verbose --batch --output - %f"
set pgp_verify_command="gpg --no-verbose --batch --output - --verify %s %f"
set pgp_decrypt_command="gpg --passphrase-fd 0 --no-verbose --batch --output - %f"
set pgp_sign_command="gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --detach-sign --textmode %?a?-u %a? %f"
set pgp_clearsign_command="gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --textmode --clearsign %?a?-u %a? %f"
set pgp_verify_key_command="gpg --no-verbose --batch --fingerprint --check-sigs %r"

set pgp_import_command="gpg --no-verbose --import -v %f"
set pgp_export_command="gpg --no-verbose --export --armor %r"
set pgp_list_pubring_command="gpg --no-verbose --batch --with-colons --list-keys %r"
set pgp_list_secring_command="gpg --no-verbose --batch --with-colons --list-secret-keys %r"

set crypt_verify_sig=yes

message-hook '!(~g|~G) ~b"^-----BEGIN\ PGP\ (SIGNED\ )?MESSAGE"' "exec check-traditional-pgp"

# set these in .mutt-local with the appropriate encrypt-to key id
# set pgp_encrypt_only_command="pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to 0x7438228A -- -r %r -- %f"
# set pgp_encrypt_sign_command="pgpewrap gpg --passphrase-fd 0 --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to 0x7438228A -- -r %r -- %f"

# }}}
# Sidebar Patch {{{

set sidebar_divider_char   = '│'
set sidebar_visible = yes
set sidebar_width   = 25
color sidebar_new color221 color233
color sidebar_highlight brightcolor39 color233
color sidebar_indicator brightcolor7 color233

bind index,pager <down>   sidebar-next
bind index,pager <up>     sidebar-prev
bind index,pager <right>  sidebar-open

set mail_check_stats
set sidebar_format = "%B %> %S "

# }}}
# Status Bar {{{

set status_chars  = " *%A"
set status_format = "───[ Folder: %f ]───[%r%m messages%?n? (%n new)?%?d? (%d to delete)?%?t? (%t tagged)? ]───%>─%?p?( %p postponed )?───"

# }}}
# Index View Options {{{

set date_format = "%m/%d"
set index_format = "[%Z]  %D  %-20.20F  %s"
set sort = threads                         # like gmail
set sort_aux = reverse-last-date-received  # like gmail
set uncollapse_jump                        # don't collapse on an unread message
set sort_re                                # thread based on regex
set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*"
set folder_format = "%2C %t %N %8s %f"

# }}}
# Pager View Options {{{

set pager_index_lines = 10 # number of index lines to show
set pager_context = 3      # number of context lines to show
set pager_stop             # don't go to next message automatically
set menu_scroll            # scroll in menus
set tilde                  # show tildes like in vim
unset markers              # no ugly plus signs
set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"
alternative_order text/plain text/enriched text/html

set display_filter = "clean_mail" # clean up shitty mail

# }}}
# Compose View Options {{{

set envelope_from                    # which from?
set sig_dashes                       # dashes before sig
set edit_headers                     # show headers when composing
set fast_reply                       # skip to compose when replying
set askcc                            # ask for CC:
set fcc_attach                       # save attachments with the body
unset mime_forward                   # forward attachments as part of body
set forward_format = "Fwd: %s"       # format of subject when forwarding
set forward_decode                   # decode when forwarding
set attribution = "On %d, %n wrote:" # format of quoting header
set reply_to                         # reply to Reply to: field
set reverse_name                     # reply as whomever it was to
set include                          # include message in replies
set forward_quote                    # include message in forwards

# }}}
# Attachment View Options {{{

set attach_format = "[%D %t] %2n [%-7.7m/%10.10M] %.40d %> [%s] "

# }}}
# Headers {{{

ignore *                                # ignore all headers
unignore from: to: cc: date: subject:   # show only these
unhdr_order *
hdr_order from: to: cc: date: subject:  # and in this order

# }}}
# Accounts {{{

set sendmail_wait = 0 # no please don't silently fail, email is important
unset record

source ~/.mutt/accounts

# }}}
# Key Bindings {{{

# Index {{{

bind index g noop
bind index \#       noop
bind index R        group-reply
bind index <tab>    sync-mailbox
bind index k        previous-entry
bind index j        next-entry
bind index gg       first-entry
bind index G        last-entry
bind index p        recall-message
bind index <space>  collapse-thread
bind index N        search-opposite
bind index B        sidebar-toggle-visible
# macro index s "<pipe-message>cat > ~/Desktop/"  "save message as"

# Sorting
macro index <f1> "<enter-command>set sort = threads<enter><enter-command>set sort_aux = reverse-last-date-received<enter>" "sort with newest first"
macro index <f2> "<enter-command>set sort = threads<enter><enter-command>set sort_aux = date-received<enter>" "sort with oldest first"
bind  index <f3> sort-reverse

# Mark all as read
macro index \Cr "T~U<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" "mark all messages as read"

# Sync email
macro index O "<shell-escape>offlineimap<enter>"           "run offlineimap to sync all mail"
macro index o "<shell-escape>offlineimap -qf INBOX<enter>" "run offlineimap to sync inbox"

# Saner copy/move dialogs
macro index C "<copy-message>?<toggle-mailboxes>" "copy a message to a mailbox"
macro index M "<save-message>?<toggle-mailboxes>" "move a message to a mailbox"

# Quickly change mailboxes
macro index c "<change-folder>?<toggle-mailboxes>"     "change folder"

# Search with notmuch
macro index S "<enter-command>unset wait_key<enter><shell-escape>mutt-notmuch-py -G ~/.mail/search<enter><change-folder-readonly>~/.mail/search<enter>" "search mail (using notmuch)"

# Unlimit (show [a]ll)
macro index a "<limit>all\n" "show all messages (undo limit)"

# }}}
# Pager {{{

bind pager \# noop
bind pager g noop
bind pager k  previous-line
bind pager j  next-line
bind pager gg top
bind pager G  bottom

bind pager R  group-reply
bind pager N  search-opposite

# macro pager \Cu "|urlview<enter>" "call brows to open links"
macro pager \Cu "|brows<enter>" "call brows to open links"
macro pager s "<pipe-message>cat > ~/Desktop/"  "save message as"

# Quickly change mailboxes
macro pager \' "<exit><change-folder>+sjl/INBOX<enter>"   "go to INBOX"
macro pager \" "<exit><change-folder>+sjl/archive<enter>" "go to archive"

# }}}
# Compose {{{

bind compose p postpone-message
bind compose P pgp-menu

macro compose H "| htmlify-email<enter><attach-file>~/.mutt/temp/neomutt-alternative.html<enter><tag-entry><previous-entry><tag-entry><group-alternatives>"

# }}}
# Attachment {{{

# View, god dammit!
bind attach <return> view-mailcap

# }}}
# "Open in Vim" {{{

macro index,pager V "|nvim -c 'setlocal ft=mail' -c 'setlocal buftype=nofile' -<enter>"              "open in vim"

# }}}

# }}}
# Local Settings {{{
    # source `FILE=$HOME/.mutt-local; if [ ! -s "$FILE" ]; then FILE=/dev/null;fi;echo "$FILE"`
    source ~/.mutt-local
# }}}