mutt/muttrc @ 296cbe9165ec

Fix isen mutt mapping
author Steve Losh <steve@stevelosh.com>
date Fri, 28 Aug 2015 21:22:00 +0000
parents 25ffd1bd1092
children 1ff33bef5984
# Paths {{{

set alias_file       = ~/.mutt/alias         # where to store aliases
set header_cache     = ~/.mutt/cache/headers # where to store headers
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
set signature        = ~/.mutt/sig           # my signature file

# }}}
# Editor {{{

# Use Vim to compose email, with a few default options.
set editor = "/usr/local/bin/vim -c 'normal! }' -c 'redraw'"

# }}}
# Contacts {{{

# Use the OS X address book
set query_command = "contacts -Sf '%eTOKEN%n' '%s' | sed -e 's/TOKEN/\t/g'"
bind editor <Tab> complete-query
bind editor ^T    complete

# }}}
# Basic Options {{{

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

set folder = ~/.mail/steve-stevelosh.com # mailbox 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

# }}}
# 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_delim   = '  │'
# set sidebar_visible = yes
# set sidebar_width   = 26
# color sidebar_new color221 color233
# bind index,pager <down>   sidebar-next
# bind index,pager <up>     sidebar-prev
# bind index,pager <right>  sidebar-open
# 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 realname = "Steve Losh"          # who am i?
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

# }}}
# steve@stevelosh.com {{{

# Default inbox.
set spoolfile = "+INBOX"

# Alternate email addresses.
alternates sjl@pculture.org still\.?life@gmail.com steve@ladyluckblues.com steve@pculture.org steven15@ru.is

# Mailboxes to show in the sidebar.
mailboxes +INBOX \
          +vim \
          +clojure \
          +python \
          +mercurial \
          +archive \
          +sent \
          +drafts \
          +temporary/search \

# Other special folders.
set mbox      = "+steve-stevelosh.com/archive"
set postponed = "+steve-stevelosh.com/drafts"

# Sending email.
set from     = "steve@stevelosh.com"
set sendmail = "/usr/local/bin/msmtp -a stevelosh"
set sendmail_wait = 0 # no please don't silently fail, email is important
unset record

# }}}
# Key Bindings {{{

# Index {{{

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
macro index s "<pipe-message>cat > ~/Desktop/"  "save message as"

# 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"
macro index \' "<change-folder>+INBOX<enter>"   "go to INBOX"
macro index \" "<change-folder>+archive<enter>" "go to archive"

# 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 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 urlview to open links"
macro pager s "<pipe-message>cat > ~/Desktop/"  "save message as"

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

# Translate from Icelandic
macro pager T "<pipe-message>trans is:en -b -u firefox | less<enter>"  "translate message from Icelandic"

# }}}
# Compose {{{

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

# }}}
# Attachment {{{

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

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

macro index,pager V "|vim -c 'setlocal ft=mail' -c 'setlocal buftype=nofile' -<enter>"              "open in vim"
macro index,pager M "|mvim -c 'setlocal ft=mail' -c 'setlocal buftype=nofile' - >/dev/null<enter>"  "open in macvim"

# }}}

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