aboutsummaryrefslogtreecommitdiffstats
path: root/.mutt/muttrc
diff options
context:
space:
mode:
Diffstat (limited to '.mutt/muttrc')
-rw-r--r--.mutt/muttrc314
1 files changed, 168 insertions, 146 deletions
diff --git a/.mutt/muttrc b/.mutt/muttrc
index 7d593d0..93be99a 100644
--- a/.mutt/muttrc
+++ b/.mutt/muttrc
@@ -1,130 +1,138 @@
-# $Id$
-#
-###########################################################
-## mutt configuration file ##
-## ##
-## Weitian LI <liweitianux@gmail.com> ##
-## 2014/07/13 ##
-###########################################################
-
-### personal settings
-set realname = "Weitian LI"
-### mailboxes
-# from 'offlineimap'
-source ~/.mutt/mailboxes
-### gmail, use as default
-source ~/.mutt/gmail.muttrc
-### account specific sources
-folder-hook 'gmail.*' source ~/.mutt/gmail.muttrc
-folder-hook 'lavabit.*' source ~/.mutt/lavabit.muttrc
-folder-hook 'autistici.*' source ~/.mutt/autistici.muttrc
-
-### files and directories
+##
+## Mutt configuration
+##
+## Weitian LI <liweitianux@gmail.com>
+## 2015/02/02
+##
+## Reference:
+## [1] The Homely Mutt
+## http://stevelosh.com/blog/2012/10/the-homely-mutt/
+## [2] Mutt + offlineimap + notmuch + nottoomuch
+## http://blog.tshirtman.fr/2013/3/17/mutt-offlineimap-notmuch-nottoomuch
+## [3] ArchWiki - Mutt
+## https://wiki.archlinux.org/index.php/Mutt
+## [4] Using Two IMAP Accounts in Mutt
+## http://pbrisbin.com/posts/two_accounts_in_mutt
+## [5] The Mutt E-Mail Client: Reference
+## http://www.mutt.org/doc/manual/manual-6.html
+## [6] A Quick Guide to Mutt
+## http://srobb.net/mutt.html
+##
+
+### Mail boxes
+source ~/.mutt/mailboxes # Generated by OfflineIMAP
+
+### Mail accounts
+folder-hook 'gmail-aaronly\.me.*' source ~/.mutt/accounts/gmail-aly
+folder-hook 'gmail-liweitianux.*' source ~/.mutt/accounts/gmail-li
+folder-hook 'outlook-aaronly\.me.*' source ~/.mutt/accounts/outlook-aly
+folder-hook 'outlook-liweitianux.*' source ~/.mutt/accounts/outlook-li
+folder-hook 'sjtu.*' source ~/.mutt/accounts/sjtu
+folder-hook 'autistici.*' source ~/.mutt/accounts/autistici
+# Default account
+source ~/.mutt/accounts/default
+
+### Files and directories
set alias_file = ~/.mutt/aliases
-#set header_cache = ~/.mutt/cache/headers # needs external db lib
-set message_cachedir = ~/.mutt/cache
set certificate_file = ~/.mutt/certificates
set mailcap_path = ~/.mutt/mailcap
-set signature = ~/.mutt/signature
set history_file = ~/.mutt/history
+set header_cache = ~/.mutt/cache/headers
+set message_cachedir = ~/.mutt/cache/bodies
set tmpdir = ~/.mutt/tmp
-### settings
+### General settings
set mbox_type = Maildir
-set folder = ~/Maildir
-set mail_check = 300 # how often (in s) look for new mail
-set timeout = 15 # prompt timeout until abort waiting for input
-#set sendmail_wait = -1 # always put sendmail in the bkg without waiting
-set sleep_time = 0 # time to pause while displaying certain info msgs
-set wait_key # wait after an external cmd invoked
-set history = 128 # control the size of the string history buffer
-set save_history = 128 # control the size of the 'history_file'
-unset confirmappend # don't ask me if i want to append to mailboxes
-set beep_new # beep when receive a new msg while mailbox open
+set folder = ~/Mail
+set timeout = 3
+set mail_check = 0
+set beep_new
+set wrap_search # searches wrap around the end
set copy # always save a copy of outgoing messages
set delete # purge deleted messages without asking
-set quit = ask-yes # ask for confirmation when quit mutt
-set wrap_search # searches wrap around the end
-set help # show the help lines
set use_from # always generate the `From:' header field
-set read_inc = 25 # specify at which rate to update progress counters
-set write_inc = 25
-set print = ask-yes # ask me if I really want to print messages
-set print_command = /usr/bin/false # how to print things (I like to save trees)
-
-### index settings
-#set date_format = "%m/%d/%y at %I:%M"
-#set index_format = "%4C %Z %{%m/%d} %-15.15F (%4c) %s" # format of the index
-set to_chars = " +TCFL" # char used to indicate mail addressed to you
-set sort = threads # primary sorting method
-set sort_aux = reverse-date-received
-set uncollapse_jump # don't collapse on an unread message
-set sort_re # thread based on regex
-set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*"
-
-### pager settings
-set pager_format="-%S- %-20.20f %s" # format of the pager status bar
-set pager_index_lines = 5 # number of index lines to show
-set pager_context = 5 # number of context lines to show
-set pager_stop # don't go to next message automatically
-set menu_scroll # scroll in menus
-set smart_wrap # don't split words
-set tilde # show tildes like in vim
-unset markers # no ugly '+' signs for wrapped lines
-set noprompt_after # ask me for a command after the external pager exits
-set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"
-
-### composing mail
-set editor = "vim +/^$ -c 'set syntax=mail ft=mail enc=utf-8'"
-set visual = "vim +/^$ -c 'set syntax=mail ft=mail enc=utf-8'"
+set quit = ask-yes # ask for confirmation when quit mutt
+set history = 512
+set sendmail_wait = 0 # Wait forever for sendmail to finish
+unset wait_key
+unset move
+unset confirmappend
+unset mark_old
+
+### Compose view
+set editor = "vim +/^$ -c 'set syntax=mail ft=mail enc=utf-8 tw=72'"
+set visual = "vim +/^$ -c 'set syntax=mail ft=mail enc=utf-8 tw=72'"
set envelope_from # which from?
set sig_dashes # dashes before my 'signature'
set autoedit # go to the editor right away when composing
# set, cannot use 'send-hooks' depend on recipients
set edit_headers # show headers when composing
set askcc # ask for CC:
-set askbcc # ask for BCC:
set fcc_attach # save attachments with the body
-set forward_format = "Fwd: %s"
+set forward_format = "Fwd: %s"
set forward_quote # include message in forwards
set forward_decode # decode when forwarding
-unset mime_forward # forward attachments as part of body
-set attribution = "On %d, %n wrote: "
-#set metoo # sends a copy to all recipients and myself
+set attribution = "On %d, %n wrote:"
set fast_reply # skip to compose when replying
set reply_to # reply to 'Reply to:' field
set reverse_name # reply as whomever it was to
-set nosave_empty # remove files when no messages are left
+set include # include message in replies
#set postpone # auto postpone message not sent when exit
#set recall # prompt to recall postponed messages
-set include # include message in replies
-#set post_indent_string = '---end quoted text---'
-unset bounce_delivered # not include 'Delivered-To' headers, 'postfix'
-## charset
-set send_charset = "utf-8" # for messages that we send
-set assumed_charset = "iso-8859-1" # if no charset given on incoming messages
+unset mime_forward # forward attachments as part of body
-### headers settings
-ignore * # ignore all headers
-unignore from: to cc bcc date subject # show only these headers
-hdr_order from: to cc date subject
+### Headers
+ignore *
+unignore from: to: cc: bcc: date: subject:
+unhdr_order *
+hdr_order from: to: cc: date: subject:
+
+### Encoding
+set send_charset = "utf-8"
+set assumed_charset = "iso-8859-1" # if no charset given on incoming messages
+#set rfc2047_parameters # attachment filename encoding
+
+### Index view
+#set date_format = "%m/%d"
+set index_format = "%Z %{%a %d %b %Y} %3M %-15.15L (%4c) %s"
+set folder_format = "%2C %t %N %8s %f"
+set sort = threads
+set sort_aux = reverse-last-date-received
+set uncollapse_jump # don't collapse on an unread message
+set sort_re # thread based on regex
+set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*"
-### aliases
-# set alias_file = ~/.mutt/aliases
-set sort_alias = alias # sort alias file by alias
-set reverse_alias # show names from alias file in index
-#set alias_format = "%4n %t %-20a %r"
-source $alias_file # enable auto-completion
+### 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 )?---"
-### abook
-set query_command = "abook --mutt-query '%s'"
-macro generic,index,pager \Ca "<shell-escape>abook<return>" "launch abook"
-macro index,pager A "<pipe-message>abook --add-email<return>" "add the sender address to abook"
+### Pager
+set pager_format="-%S- %-20.20f %s"
+set pager_index_lines = 8 # number of index lines to show
+set pager_context = 8 # number of context lines to show
+set pager_stop # don't go to next message automatically
+set menu_scroll # scroll in menus
+set smart_wrap # don't split words
+set tilde # show tildes like in vim
+set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"
+unset markers # no ugly '+' signs for wrapped lines
+alternative_order text/plain text/enriched text/html
-### key bindings
-bind index,pager \# noop
-bind index i noop
+### Attachment view
+set attach_format = "[%D %t] %2n [%-7.7m/%10.10M] %.40d %> [%s] "
+### Key bindings
+bind index i noop
+bind index <TAB> sync-mailbox
+bind index <SPACE> collapse-thread
+bind index p recall-message
+bind index K previous-unread
+bind index J next-unread
+bind index,browser gg first-entry
+bind index,browser G last-entry
+bind index,pager R group-reply
+bind index,pager N search-opposite
+bind index,pager \# noop
bind pager i exit
bind pager / search
bind pager <UP> previous-line
@@ -135,68 +143,82 @@ bind pager gg top
bind pager G bottom
bind pager K previous-undeleted
bind pager J next-undeleted
-bind index,browser gg first-entry
-bind index,browser G last-entry
-bind index K previous-unread
-bind index J next-unread
-bind index,pager R group-reply
-
-### macros
-macro pager ';' "<exit><tag-prefix>" "q+ ;"
-macro index q "<sync-mailbox><change-folder>?<toggle-mailboxes>" "Leaves Index to folder list"
-macro browser q "<exit><quit>" "Exit mutt"
-macro browser <Tab> "<toggle-mailboxes><check-new>" "Check New"
-macro index \Cr "<tag-prefix><clear-flag>N" "mark tagged messages as read"
-macro index B "<limit>~b " "search message bodies"
-macro index I "<change-folder>!<enter>" "go to Inbox"
-# save a decoded copy in ~
-macro index P "<pipe-message>cat > ~/" "save message as"
-# quick-sync with offlineimap
-macro index,browser Z "<shell-escape>offlineimap -o -u ttyui<enter>" "offlineimap sync ..."
+bind attach <RETURN> view-mailcap
+bind compose p pgp-menu
+bind editor <TAB> complete-query
+bind editor ^T complete
+
+### Macros
+macro index q "<sync-mailbox><change-folder>?<toggle-mailboxes>" \
+ "Leaves Index to folder list"
+macro index \Cr "<tag-prefix><clear-flag>N" \
+ "mark tagged messages as read"
+macro index C "<copy-message>?<toggle-mailboxes>" \
+ "copy a message to a mailbox"
+macro index M "<save-message>?<toggle-mailboxes>" \
+ "copy a message to a mailbox"
+macro index B "<limit>~b " \
+ "search message bodies"
+macro index I "<change-folder>!<enter>" \
+ "go to Inbox"
+# Save a decoded copy in ~/
+macro index s "<pipe-message>cat > ~/" \
+ "save message as"
+# Open in vim
+macro index,pager V "<pipe-message>vim -c 'setlocal ft=mail buftype=nofile' -<enter>" \
+ "open in vim"
+# Sync mails with offlineimap
+macro index,browser Z "<shell-escape>offlineimap -o -u ttyui<enter>" \
+ "offlineimap sync ..."
+macro browser q "<exit><quit>" \
+ "Exit mutt"
+macro browser <Tab> "<toggle-mailboxes><check-new>" \
+ "Check New"
+macro compose Y pfy \
+ "send mail without GPG"
# urlview
-macro pager \Cu "<pipe-entry>urlview<enter>" "Follow links with urlview"
+macro pager \Cu "<pipe-entry>urlview<enter>" \
+ "Follow links with urlview"
+macro pager ';' "<exit><tag-prefix>" \
+ "q+ ;"
+# notmuch
+macro index S "<enter-command>unset wait_key<enter><shell-escape>~/.mutt/mutt-notmuch.py -G $folder/search<enter><change-folder-readonly>+search<enter>" \
+ "search mail (using notmuch)"
+
+### aliases
+set sort_alias = alias # sort alias file by alias
+set reverse_alias # show names from alias file in index
+#set alias_format = "%4n %t %-20a %r"
+source $alias_file # enable auto-completion
+### abook
+set query_command = "abook --mutt-query '%s'"
+macro generic,index,pager \Ca "<shell-escape>abook<return>" "launch abook"
+macro index,pager A "<pipe-message>abook --add-email<return>" "add the sender address to abook"
-###########################################################
-## Misc settings ##
-###########################################################
-## mailing lists: lists and subscribe
+### Misc settings
+## Mailing lists: lists and subscribe
set followup_to # generate 'Mail-Followup-To:' header field
set honor_followup_to # 'Mail-Followup-To' header is honored
source ~/.mutt/mailinglists
-## mutt colors definitions
+## Attachment searching and counting
+source ~/.mutt/attachments
+
+## Colors
source ~/.mutt/colors
-#set arrow_cursor # use '->' instead of hiliting the whole line
## GnuPG
source ~/.mutt/gpg.rc
## auto view
-auto_view text/html application/x-gunzip application/x-bzip application/x-tar-gz \
- application/x-compressed-tar application/msword application/postscript
-
-## MIME multipart/alternative
-## The 'multipart/alternative' container type only has child MIME parts
-## which represent the same content in an alternative way. often used to
-## send HTML msgs which contain an alternative plain text representation.
-alternative_order text/plain text/enriched text/html application/postscript
-
-## MIME lookup, mime-lookup
-## specifies a list of MIME types that should *not* be treated
-## according to their mailcap entry
-mime_lookup application/octet-stream application/X-Lotus-Manuscript
+auto_view text/html application/x-gunzip application/x-bzip \
+ application/x-tar-gz application/x-compressed-tar
-## attachment searching and counting
-## attachments { +|- } disposition mime-type
-## 'disposition': inline(I), attachment(A)
-source ~/.mutt/attachments
+## MIME types that should *not* be treated according to their mailcap entry
+mime_lookup application/octet-stream application/X-Lotus-Manuscript
-## cope with encodings
-# attachment encodeing
-set rfc2047_parameters = yes
-# some mail without 'charset', then set 'us-ascii' as an alias to 'gb2312'
-charset-hook ^us-ascii$ gb2312
+### Local Settings
+source `FILE=$HOME/.muttrc.local; if [ ! -s "$FILE" ]; then FILE=/dev/null; fi; echo "$FILE"`
-#
# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=muttrc: #