ambevar-dotfiles/.mutt/muttrc

264 lines
8.3 KiB
Plaintext
Raw Normal View History

## Mutt Configuration
## This configuration is made for Mutt with embedded IMAP support.
## These folders are assumed to exist:
## ~/.mutt.d: personal stuff (contacts, account information).
## ~/.mutt: public stuff (config, theme, mailcap).
## ~/.cache/mutt: cache for headers and messages.
2015-09-22 10:23:37 +02:00
################################################################################
## General options.
2013-03-02 16:53:37 +01:00
## Beep on new incoming mails.
set beep_new=yes
2013-03-02 16:53:37 +01:00
## PGP options.
set crypt_replyencrypt=yes
set crypt_replysign=yes
set crypt_replysignencrypted=yes
set crypt_use_gpgme=yes
set pgp_timeout=3600
2015-09-30 16:41:00 +02:00
2013-03-02 16:53:37 +01:00
## Headers are editable in editor.
set edit_headers=yes
2013-05-24 11:44:23 +02:00
## Set EDITOR dynamically.
source "~/.mutt/maileditor.sh|"
## Don't ask for recipient. We usually don't want to include mail unless we want
## to quote it.
2015-10-13 14:13:45 +02:00
set fast_reply=yes
set include=ask-no
set include_onlyfirst=yes
2013-03-02 16:53:37 +01:00
## Store message headers locally to speed things up. Gentoo wiki says that if a
## folder is specified, it is even faster. If no folder exists, the cache will
## be a single file.
set header_cache=~/.cache/mutt/headers
set message_cachedir=~/.cache/mutt/messages
source "~/.mutt/purgecache.sh $message_cachedir|"
## Tell Mutt to check all IMAP folders. This will add all of them to the sidebar
## (if used). Contrary to the 'mailboxes' menu, sorting order cannot be
## controlled, so you should set 'sidebar_sort' to yes. This will sort the
## folders alphabetically, ignoring punctuation.
2013-03-02 16:53:37 +01:00
set imap_check_subscribed
## Keep imap connection alive by polling intermittently (time in seconds).
set imap_keepalive=30
2013-03-02 16:53:37 +01:00
## Allow mutt to open new imap connection automatically.
unset imap_passive
## How often to check for new mail (time in seconds).
set mail_check=60
2013-03-02 16:53:37 +01:00
## Mailcap
set mailcap_path=~/.mutt/mailcap
2013-03-02 16:53:37 +01:00
auto_view text/html
alternative_order text/plain text/html
## Mailbox type.
set mbox_type=Maildir
## Forward attachment as well.
2013-12-18 12:37:32 +01:00
set mime_forward=yes
set mime_forward_rest=yes
2013-09-24 08:09:34 +02:00
## Keep showing the list of mails while in pager.
set pager_index_lines=8
## Show context lines when going to next page and stop at the end instead of
## displaying next mail.
# set menu_context=3
set pager_context=3
set pager_stop=yes
2013-09-24 08:09:34 +02:00
## Encoding.
set rfc2047_parameters=yes
set send_charset="us-ascii:utf-8"
2013-03-02 16:53:37 +01:00
## Remove delay between mailbox switches.
set sleep_time=0
## Group mail into conversations, sort by last mail from conversation.
set sort=threads
set sort_aux=last-date-received
set strict_threads=yes
2015-09-30 16:41:00 +02:00
2015-09-22 10:23:37 +02:00
################################################################################
## Multiple accounts
2014-04-21 19:22:04 +02:00
## Store passwords as follows in .mutt.pwds:
# set my_pw_personal = foo
# set my_pw_work = foo
##
## CCRYPT:
2014-09-09 19:10:21 +02:00
## $ ccencrypt .mutt.pwds
##
## GNUPG: Generate a key pair with:
## $ gpg2 --gen-key
## Encrypt them with:
2014-09-09 19:10:21 +02:00
## $ gpg2 -e -r <user> ".mutt.pwds"
## 'accountrc' should contain the following config:
## Fetch passwords
# source "ccat ~/.mutt.pwds.cpt |"
## Or
# source "gpg2 -dq ~/.mutt.pwds.gpg |"
##
## Source accounts. Default account is last.
# source "~/.mutt.d/personal"
# folder-hook $folder 'source ~/.mutt.d/personal'
# source "~/.mutt.d/work"
# folder-hook $folder 'source ~/.mutt.d/work'
##
## You can add an optional binding to switch mailboxes:
# macro index,pager <f2> '<enter-command>source ~/.mutt.d/personal<enter><change-folder>!<enter>'
# macro index,pager <f3> '<enter-command>source ~/.mutt.d/work<enter><change-folder>!<enter>'
source "~/.mutt.d/accountrc"
2015-09-22 10:23:37 +02:00
################################################################################
## Aliases.
## Mutt native support.
# set alias_file = "~/.mutt.d/aliases"
# set sort_alias = alias
# set reverse_alias = yes
# source $alias_file
## Abook.
2013-05-24 11:44:23 +02:00
## We redirect the error stream in case the config file in not compatible with
## current Abook version.
set query_command="abook --mutt-query '%s' 2>/dev/null"
macro index,pager a "<pipe-message>abook --add-email-quiet<return>" "Add this sender to Abook"
bind editor <Tab> complete-query
2015-09-22 10:23:37 +02:00
################################################################################
## Key bindings.
## Security issue: if 'enter-command' is available from the GUI, it is possible
## to see the password unencrypted. We disable it for this reason. Every command
2013-03-02 16:53:37 +01:00
## that the user intends to use must be bound to a key in advance, otherwise it
## will never be accessible.
bind generic,alias,attach,browser,editor,index,compose,pager,pgp,postpone ':' noop
## HTML mail view with graphical Internet browser.
macro attach 'V' "<pipe-entry>~/.mutt/view-html.sh<enter>"
2013-03-02 16:53:37 +01:00
## Remap bounce-message function to "B"
bind index B bounce-message
## Always reply to group.
2015-10-13 14:13:45 +02:00
bind index,pager r group-reply
## Fix the 'change-dir' issue with multiple accounts. When change-dir was called
## with account A, then use switched to account B, change-dir will still point
## to account A by default.
2013-03-04 17:31:57 +01:00
# macro index 'c' '<change-folder>?<change-dir><home>^K=<enter>'
## Manual fetch.
bind index "^" imap-fetch-mail
## Fix the backspace wrong binding that happens on some terminals.
#bind index,pager  previous-page
## Fix Backspace -- Shell alternative.
2013-03-02 16:53:37 +01:00
## $ infocmp > termbs.src
## Changed kbs=^H to kbs=\177, then:
2013-03-02 16:53:37 +01:00
## $ tic -x termbs.src
## Remove N/O flag in one key stroke.
macro index <Esc>n '<clear-flag>N'
## Do not quit accidentally
bind index "Q" quit
bind index "q" query
## Vi/Emacs bindings.
bind pager j next-line
bind pager k previous-line
bind attach,index,pager \CD next-page
bind attach,index,pager \CU previous-page
bind attach,index,pager ? search-reverse
bind attach,index,pager h help
bind attach,index,pager \Ch display-toggle-weed
bind attach,index,pager N search-opposite
bind index <Esc>x collapse-thread
bind index <Esc>X collapse-all
bind attach,index,pager \CV next-page
bind attach,index,pager <Esc>v previous-page
bind pager g top
bind pager G bottom
bind pager <Esc>< top
bind pager <Esc>> bottom
bind attach,index g first-entry
bind attach,index G last-entry
bind attach,index <Esc>< first-entry
bind attach,index <Esc>> last-entry
2015-09-22 10:23:37 +02:00
################################################################################
## Custom header for outgoing mail.
## Undo any custom headers that may have been put in by the global Muttrc
# unmy_hdr *
2013-03-02 16:53:37 +01:00
## Remove any global 'From:' header
# unset use_from
## Don't append a domain to my outgoing mails
2013-03-02 16:53:37 +01:00
# unset use_domain
# my_hdr From: Firstname Lastname <myfirstname@mymailserver>
## Extra info.
my_hdr X-Info: Simplicity is the ultimate sophistication.
## OS Info.
# my_hdr X-Operating-System: `uname -s`, kernel `uname -r`
## This header only appears to MS Outlook users
# my_hdr X-Message-Flag: Warning: Outlook sucks!
## Custom Mail-User-Agent ID.
set user_agent=yes
# my_hdr User-Agent: Every email client sucks, this one just sucks less.
2015-09-22 10:23:37 +02:00
################################################################################
## Theme.
## Index format
2013-08-04 17:35:27 +02:00
## We use my_col_* to get dynamic column size.
## See 'man 3 strftime' and 'man 3 printf'.
# set index_format="%?M?_%M_ ?%Z %2C %.13d (%-68.68F) %-68.68s %?M?_%M_&(%c/%l?"
set date_format="%y-%m-%d %T"
set my_index_format_pre='set my_col_from = `echo $((30 * ($(tput cols)-35-24) / 100))`; set my_col_subject = `echo $((70 * ($(tput cols)-35-24) / 100))`; set index_format="%2C | %Z [%d] %-$my_col_from.${my_col_from}'
set my_index_format_post=' (%-4.4c) %?M?<%M> ?%-$my_col_subject.${my_col_subject}s"'
folder-hook .*[sS]ent.* "$my_index_format_pre"t"$my_index_format_post"
folder-hook ! .*[sS]ent.* "$my_index_format_pre"F"$my_index_format_post"
## Original status_format, with dash line removed.
2013-11-09 17:44:22 +01:00
set status_format="-%r-Mutt: %f [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?] (%s/%S) %> (%P) "
## This will redraw screen and justify the index.
macro index,pager \CL "<enter-command>$my_index_format_pre"F"$my_index_format_post<enter><redraw-screen>"
## Set color variables from a theme.
# source "~/.mutt/colors.classic"
source "~/.mutt/colors.zenburn"
## Fallback for terminals without 256 colors. This needs to be a shell script so
## that it can check for terminal capabilities.
source "~/.mutt/colors.fallback.sh |"
## Apply theme.
source "~/.mutt/theme"
2015-09-22 10:23:37 +02:00
################################################################################
## Sidebar.
2013-11-09 17:15:03 +01:00
## We use a script to test if sidebar is installed. Needs to be loaded _after_
## the theme.
source "~/.mutt/sidebar.sh|"