diff options
Diffstat (limited to '.mutt/muttrc')
-rw-r--r-- | .mutt/muttrc | 84 |
1 files changed, 52 insertions, 32 deletions
diff --git a/.mutt/muttrc b/.mutt/muttrc index 93be99a..6c640b7 100644 --- a/.mutt/muttrc +++ b/.mutt/muttrc @@ -13,22 +13,27 @@ ## 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 +## [5] The Mutt E-Mail Client +## http://www.mutt.org/doc/devel/manual.html ## [6] A Quick Guide to Mutt ## http://srobb.net/mutt.html +## [7] Multi-window Mutt with Screen +## http://op-co.de/blog/posts/mulit-window_mutt/ +## [8] Github - proycon/dotfiles - mutt with tmux +## https://github.com/proycon/dotfiles ## ### 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 +folder-hook . source ~/.mutt/accounts/default +folder-hook 'gmail-aly.*' source ~/.mutt/accounts/gmail-aly +folder-hook 'gmail-li.*' source ~/.mutt/accounts/gmail-li +folder-hook 'outlook-aly.*' source ~/.mutt/accounts/outlook-aly +folder-hook 'outlook-li.*' 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 @@ -51,8 +56,9 @@ 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 use_from # always generate the `From:' header field -set quit = ask-yes # ask for confirmation when quit mutt -set history = 512 +set quit = ask-no # ask for confirmation when quit mutt +set history = 256 +set save_history = 256 set sendmail_wait = 0 # Wait forever for sendmail to finish unset wait_key unset move @@ -60,8 +66,7 @@ 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 editor = "vim +/^$/+1 -c 'set 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 @@ -88,26 +93,28 @@ 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 +set send_charset = "us-ascii:utf-8" +# if no charset given on incoming messages +set assumed_charset = "iso-8859-1:gb2312:gbk:gb18030:utf-8" +set rfc2047_parameters # to fix 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 +# first bang ("!") to expand month week names in the C locale +set date_format = "!%a %m/%d %I:%M" +set index_format = "[%Z] %d %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]+\])?: *)?(\[[^]]+\] *)?)*" +set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*" ### 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 )?---" +set status_format = "---[ Folder: %f %r ]---[ Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l? ]---%>-(%P)---" ### Pager -set pager_format="-%S- %-20.20f %s" +#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 @@ -118,9 +125,6 @@ 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 -### 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 @@ -155,14 +159,14 @@ 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>" \ +macro index S "<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 > ~/" \ +macro index > "<pipe-message>cat > ~/" \ "save message as" # Open in vim macro index,pager V "<pipe-message>vim -c 'setlocal ft=mail buftype=nofile' -<enter>" \ @@ -177,18 +181,17 @@ macro browser <Tab> "<toggle-mailboxes><check-new>" \ macro compose Y pfy \ "send mail without GPG" # urlview -macro pager \Cu "<pipe-entry>urlview<enter>" \ +macro pager \Cu "<pipe-entry>urlview<enter>" \ "Follow links with urlview" -macro pager ';' "<exit><tag-prefix>" \ +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>" \ +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 @@ -202,6 +205,23 @@ set followup_to # generate 'Mail-Followup-To:' header field set honor_followup_to # 'Mail-Followup-To' header is honored source ~/.mutt/mailinglists +## Multiplexing using tmux +# compose mail in tmux window +macro index,pager M '<enter-command>set my_oldeditor=$editor<enter><enter-command>set editor="cp %s %s.2; tmux new-window -a -t mutt \"~/.mutt/compose.sh %s.2\""<enter><enter-command>unset recall<enter><mail><enter-command>set editor=$my_oldeditor<enter>' \ + "mail in new tmux window" +#unset wait_key # already set above +# forward messages +# override the <recall-message> hotkey +macro index,pager P "<shell-escape>tmux new-window -a -t mutt 'mutt -F ~/.mutt/compose.rc -p'<enter>" \ + "recall postponed message in new tmux window" +# Set the editor for for editing messages in-place, +# allows re-editing before sending, e.g. for use in forwarding messages. +macro compose E '<enter-command>set my_oldeditor=$editor<enter><enter-command>set editor="vim"<enter><edit-message><enter-command>set editor=$my_oldeditor<enter>' \ + "edit message in-place" +# open mailbox listing in a new window +macro index,pager Y '<shell-escape>tmux new-window -a -t mutt "mutt -y"<enter>' \ + "open mailbox listing in new tmux window" + ## Attachment searching and counting source ~/.mutt/attachments |