aboutsummaryrefslogtreecommitdiff
path: root/mutt/muttrc
blob: f7a5b9d9a9118d88d286c345823ded09d86cad2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# == Locations ==

set folder=~/Mail_inbox
set spoolfile="~/Mail_inbox/INBOX"
# sent mail is bcc'd to me, so this is only a backup
set record="~/temp/sent_backup/"
# don't save draft mail in a place that might get cleaned up unexpectedly
set tmpdir="~/temp/mutt/"
# speeds things up sometimes
set header_cache=~/.cache/mutt_header_cache
# aliases
set reverse_alias
set query_command="lbdbq '%s'"
bind editor \cn complete-query

# == Editor ==
set editor="vim -c ':so ~/config/vim/vimrc_mail' +1 +/^$/"

# == GPG ==
set pgp_autosign
set pgp_replyencrypt
set pgp_use_gpg_agent
set crypt_use_gpgme=no
set crypt_opportunistic_encrypt
message-hook '!(~g|~G) ~b"^-----BEGIN\ PGP\ (SIGNED\ )?MESSAGE"' "exec check-traditional-pgp"

# == Personal stuff ==
# undo the effect of some hooks
send-hook . "unmy_hdr From:"
send-hook . "set pgp_autosign"
send-hook . "set crypt_opportunistic_encrypt"
source "~/.mutt/perso"

# == Encoding ==
set charset=utf-8
set send_charset=utf-8

# == Interface ==
set nohelp
set fast_reply
set norecall
set abort_nosubject
set tilde
set sleep_time=0
set nomarkers
set wait_key
set pager_stop
set pager_index_lines=5

# check mail frequently
set timeout=10
set mail_check=5

# sorting and threading
set sort=threads
set sort_aux="last-date"
set strict_threads
set nocollapse_unread
bind index - collapse-thread
bind index _ collapse-all

# formats
set index_format="%{%d/%m %H:%M}%Z %-15.15L %?M?<#%03M>&? %s"
set pager_format="%4c -%Z- %C/%m: %-20.20n %s"
set status_format="%r%f %?l?%l? %?M?%M/?%m:%?n? N%n?%?o? O%o?%?d? D%d?%?F? !%F?%?t? *%t?%>  %h (%s/%S%?V?-%V?)  (%P)"

# useful with notmuch
unignore Message-Id
# useful to figure out why I received something
unignore List-Id X-Original-To

# == Mail composition ==
set edit_headers
set include

# forward things with mime, i don't care about crappy clients
set mime_forward
set mime_forward_rest

# == Mailbox handling ==
set nomove
set noconfirmappend
set nomark_old
set delete

# == Colors ==
source ~/.mutt/colors

# == Bindings ==

# more vim-like bindings
macro index G <last-entry> 
bind index < first-entry
bind index > last-entry
# remap <help> to elsewhere than ? and <F1>
macro index,pager <F2> <help>
macro index,pager \cf <next-page> 
macro index,pager \cb <previous-page>
macro index,pager ? <search-reverse> 
macro index,pager <Esc>/ "<search>~b "
macro index,pager <Esc>? "<search-reverse>~b "

# no NNTP
bind pager i exit
bind index i noop
bind pager,index F flag-message

# remove unneccessary bindings
bind index,pager p noop
bind index,pager <Esc>b noop
bind index,pager <Down> noop
bind index,pager <Up> noop
bind index,pager <Left> noop
bind index,pager <Right> noop
bind index,pager <Esc>s noop
bind index <End> noop
bind index <Home> noop
bind index M noop
bind index H noop

# == Bindings ==

macro index,pager p "s=hand_spam<enter>" "mark as spam"
macro index,pager x "s!<enter>" "save to inbox"
macro index,pager E "C=useful<enter>" "copy to useful"
macro index,pager I "c!<enter><limit>~(! ~D)<enter>G" "inbox"
macro index,pager S "<change-folder-readonly>~/temp/sent_materialized<enter>G" "sent mail"

bind index,pager , next-unread-mailbox

# notmuch

bind index,pager \\ vfolder-from-query
bind index,pager z entire-thread

macro index + \
"<enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\
<shell-escape>notmuch-mutt -r --prompt search<enter>\
<change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>G\
<enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \
      "notmuch: search mail"

macro index Alt-X \
"<enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\
<pipe-message>notmuch-mutt -r thread<enter>\
<change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>\
<enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \
      "notmuch: reconstruct thread"

# == Postponed mail ==

#macro index,pager R \
#"<enter-command>set my_old_resolve=\$resolve noresolve<enter>\
#d<resend-message>\
#<enter-command>set resolve=\$my_old_resolve <enter>" \
#      "recall"
#set postponed="=draft_written"

# save postponed mail in the inbox
set postponed="=INBOX"
# ugly hack to resume the currently highlighted mail
# may fail messily if you do not create =draft_tmp first
macro index,pager R \
 "<enter-command>set postponed='=draft_tmp' my_old_maildir_trash=\$maildir_trash nomaildir_trash<enter>\
 s=draft_tmp<enter><recall-message><enter-command>set postponed='=INBOX' maildir_trash=\$my_old_maildir_trash<enter>" \
 "recall current message"
# unmodified drafts should be saved back to the inbox, not discarded
set noabort_unmodified

# keep old mail around to complete threads
set maildir_trash

# reset default limit
macro index B "l~(! ~D)<enter>"
# apply it on all folders by default
folder-hook . push 'B=*'

# automatically view html mail using mailcap
auto_view text/html
# still, prefer text if available
alternative_order text/plain text/enriched text/html