prepare for new laptop
[dotfiles.git] / email / .config / mutt / muttrc
1 # source net on first open
2 source ~/.config/mutt/net.muttrc
3
4 # Basic information
5 alternates "(mart@cs\.ru\.nl|m\.lubbers@cs\.ru\.nl|mart@martlubbers\.net|Mart\.Lubbers@ru\.nl)"
6 set use_from=yes
7 set reverse_name=yes
8 set envelope_from=yes
9 set mbox_type=Maildir
10 set mask="!^\\.[^.]"
11 source ~/.local/share/offlineimap/mailboxes
12
13 # Receiving, sending and searching
14 set sendmail="checkattach.sh msmtp -a net"
15 set send_charset="us-ascii:utf-8"
16 macro index,pager $ "<shell-escape>sync_mail.sh<enter><sync-mailbox>" "Force refresh"
17
18 # viewing and printing
19 macro attach B "<pipe-entry>firefox \"data:text/html;base64,$(base64 -w 0 <&0)\"<enter>"
20 set print_command='set -e; f=`mktemp -p "$HOME"/.cache/mutt`; \
21 muttprint -P A4 -p TO_FILE:"$f"; evince "$f"; rm "$f"'
22
23 # Set the correct msmtp account for the different addresses
24 send2-hook '~f mart@martlubbers.net'\
25 'set sendmail="checkattach.sh msmtp -a net"'
26 send2-hook '((~f m.lubbers@cs.ru.nl)|(~f m.lubbers@science.ru.nl)|(~f mart@cs.ru.nl))'\
27 'set sendmail="checkattach.sh msmtp -a ru"'
28 send2-hook '((~f mart.lubbers@ru.nl))'\
29 'set sendmail="checkattach.sh msmtp -a ru"'
30
31 # Macro for switching to the ru address
32 alias identity_1 Mart Lubbers <mart@martlubbers.net>
33 alias identity_2 Mart Lubbers <mart@cs.ru.nl>
34 macro compose v "<edit-from>^Uidentity\_<tab>" "Select from"
35 macro compose <esc>1 "<esc>f^UMart Lubbers <mart@martlubbers.net><enter>ps"
36 macro compose <esc>2 "<esc>f^UMart Lubbers <mart@cs.ru.nl><enter>ps"
37 macro compose <esc>3 "<esc>f^UMart Lubbers <mart.lubbers@ru.nl><enter>pc"
38
39 macro index,compose <esc>1 "<enter-command>source ~/.config/mutt/net.muttrc<enter><change-folder>=INBOX<enter>"
40 macro index,compose <esc>2 "<enter-command>source ~/.config/mutt/ru.muttrc<enter><change-folder>=INBOX<enter>"
41 folder-hook ~/.local/share/offlineimap/mail/net/* 'source ~/.config/mutt/net.muttrc'
42 folder-hook ~/.local/share/offlineimap/mail/ru/* 'source ~/.config/mutt/ru.muttrc'
43
44 # Key bindings
45 bind index gg first-entry
46 bind index G last-entry
47 bind pager k previous-line
48 bind pager j next-line
49 bind pager gg top
50 bind pager G bottom
51 bind index,pager R group-reply
52 bind index,pager F flag-message
53
54 # Misc options
55 set timeout=2
56 set sleep_time=0
57 set mail_check=0
58 set include=yes
59 set delete=yes
60 set confirmappend=no
61 set fast_reply=yes
62 set mark_old=no
63
64 # Display options
65 unset wait_key
66 unset markers
67 set sort_browser=alpha
68 set sort=threads
69 set sort_aux=date
70 set editor="vim"
71 set duplicate_threads=yes
72 ignore headers *
73 unignore headers from to subject date cc
74 set mailcap_path=~/.config/mutt/mailcap
75 set mailcap_sanitize=yes
76
77 # w3m --dump
78 auto_view text/html
79 # pdftotext
80 auto_view application/pdf
81 # khal
82 auto_view application/ics
83 auto_view text/calendar
84 # libreoffice --cat
85 auto_view application/vnd.openxmlformats-officedocument.wordprocessingml.document
86 auto_view application/vnd.oasis.opendocument.text
87 auto_view application/msword
88 # vcards
89 auto_view text/x-vcard
90
91 # Pager options
92 #set pager=/usr/share/vim/vim82/macros/less.sh
93 set pager_index_lines=5
94 set pager_context=3
95 set pager_stop
96 set menu_scroll
97 set tilde
98 set quote_regexp="^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"
99
100 # Address book
101 set query_command= "khard email --parsable '%s'"
102 bind editor <Tab> complete-query
103 bind editor ^T complete
104 macro index,pager A \
105 "<pipe-message>khard add-email<return>" \
106 "add the sender email address to khard"
107
108 # sidebar
109 #source ~/.config/mutt/sidebar.muttrc
110
111 # notmuch
112 source ~/.config/mutt/notmuch.muttrc
113
114 # Crypto
115 source ~/.config/mutt/gpg.muttrc
116
117 # Colors
118 source ~/.config/mutt/colors.muttrc