-
Notifications
You must be signed in to change notification settings - Fork 0
/
.muttrc
239 lines (179 loc) · 7.04 KB
/
.muttrc
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# this isn't really used, but to keep mutt shut up
set folder=$MAILDIR
# define virtual folders
set nm_default_uri=notmuch://$MAILDIR
virtual-mailboxes \
"inbox" "notmuch://?query=tag:inbox" \
"backlog" "notmuch://?query=tag:backlog" \
"todo" "notmuch://?query=tag:todo" \
"syslog" "notmuch://?query=tag:syslog" \
"spam" "notmuch://?query=tag:spam AND NOT tag:archive" \
# open first virtual mailbox when starting
set virtual_spoolfile=yes
# pgp settings
set pgp_autosign=yes
set pgp_replyencrypt=yes
set pgp_replysignencrypted=yes
set pgp_verify_sig=yes
set pgp_use_gpg_agent=yes
# my addresses
alternates "[email protected]"
alternates "[email protected]"
alternates "(kevindeprey|info|vraagje)@online-urbanus.be"
alternates ".*@noreply.github.com"
alternates "[email protected]"
# set from header
set realname="Kevin Velghe"
set from=$EMAIL
# reply using identity sent to
set reverse_name=yes
# edit headers in vim
set edit_headers=yes
# don't show spam and deleted mails when searching
set nm_exclude_tags="spam,deleted,new"
# set index format
set index_format="%Z %[%R %b %d] %-15.15L %s %> (%g)"
# set order of index
set sort_aux=last-date-received
# enable sidebar
set sidebar_visible=yes
set sidebar_width=20
set sidebar_divider_char=│
set sidebar_format="%B%?F? [%F]?%* %S%?N?(%N)?"
# periodically update number of new messages for sidebar
set mail_check_stats=yes
# set sent folder in mutt, and index for notmuch
set nm_record=yes
set nm_record_tags="-inbox -todo sent"
send2-hook '~f ^[email protected]$' 'set record="$MAILDIR/senso2me/Sent"'
send2-hook !'~f ^[email protected]$' 'set record="$MAILDIR/prive/Sent"'
# set send command
send2-hook '~f ^[email protected]$' 'set sendmail="/usr/bin/msmtp -a senso2me"'
send2-hook !'~f ^[email protected]$' 'set sendmail="/usr/bin/msmtp -a prive"'
# just use default reply rules
set fast_reply=yes
set include=yes
# use utf-8
set send_charset="utf-8"
# don't show pluses on wrapped lines
set markers=no
# set time to refresh mutt when idle
set timeout=10
# enable caching
set header_cache=~/.cache/mutt
# postpone messages in mutt folder
set postponed="~/.mutt/postponed"
# automatically apply action to all tagged messages
set auto_tag=yes
# use format=flowed
set text_flowed=yes
# only use html mails if nothing else
alternative_order text/plain text/enriched text/html
auto_view text/html
# don't open the next message when the end is reached
set pager_stop=yes
# use muttprint to print mail
set print_command="muttprint"
# automatically sync mailbox on timeout
# timeout-hook 'exec sync-mailbox'
# no need to press key after executing shell command
set wait_key=no
# set title
set ts_enabled=yes
# try to decode attachment filenames using the deprecated rfc2047 format
set rfc2047_parameters=yes
# mark github notifications as read
message-hook '~U ~f ^[email protected]$' 'push <Esc>mgr'
macro pager <Esc>mgr '<pipe-entry>$HOME/.mutt/ghn-read<Enter>'
# show tags
ignore *
unignore from: subject to cc bcc date x-mailer x-url user-agent tags
# do not jump to next message after command
set resolve=no
# vi keybindings (thanks to Arch wiki)
bind pager j next-line
bind pager k previous-line
bind attach,index,pager \CD half-down
bind attach,index,pager \CU half-up
bind pager g top
bind pager G bottom
bind attach,index,browser g first-entry
bind attach,index,browser G last-entry
# enable backward search
bind alias,attach,browser,index,compose,pager,pgp,postpone,mix N search-opposite
# keybindings to navigate in sidebar
bind index,pager \CN sidebar-next
bind index,pager \CP sidebar-prev
bind index,pager \CO sidebar-open
# use abook address book
macro index,pager a '<pipe-message>abook --add-email<return>' "add the sender address to abook"
bind editor <tab> complete-query
# better bindings for basic notmuch actions
bind index <tab> entire-thread
bind index,pager s vfolder-from-query
# some muttator-like keybindings
bind index,pager c mail
bind index,pager l modify-labels
macro browser o '<current-bottom><last-entry><search>^ <Backspace>'
macro index,pager o '<change-vfolder>?<sort>n<exit><change-vfolder>?o'
# basic labeling of mails
macro index,pager A '<modify-labels-then-hide>+archive -inbox -unread -todo -spamy<return><sync-mailbox>' "archive mail"
macro index,pager I '<modify-labels-then-hide>-inbox -unread -spamy<return><sync-mailbox>' "remove from inbox"
macro index,pager S '<modify-labels-then-hide>-inbox -unread -spamy +spam<return><sync-mailbox>' "mark as spam"
# go to next mailbox with unread mails
macro index <space> '<change-vfolder><enter>'
# easy selection of thread
bind index T tag-thread
# sync new mail status immediately when opening message
macro index <return> '^T<display-message><modify-labels>-backlog<enter><sync-mailbox>' "display message and sync flags to mailbox"
macro pager J '<next-entry><sync-mailbox>' "move to the next entry"
# pager keybindings
bind index,pager d half-down
bind index,pager u half-up
# disable mutt's delete, and just tag with notmuch
macro index D '<modify-labels-then-hide>+deleted -inbox -todo -unread<return><sync-mailbox>' "delete mail"
# add binding to reply to send reply to all recipients
bind index,pager r group-reply
bind index,pager R reply
# add macro to fetch new mails
macro index \CF '<shell-escape>pkill -USR1 maildaemon<enter>'
# follow links in mail using urlscan
macro pager f '<pipe-message>urlscan<enter>'
macro pager F '<pipe-message>urlview<enter>'
# show home directory alphabetically sorted when adding attachment
macro compose a '<attach-file>~/<tab><tab><sort>a'
# add keybindings to change order
bind index O sort-mailbox
bind browser O sort
# add binding to select all mails
macro index \CA '<tag-pattern>~A<return>'
# hacky way to repeat previous labeling
macro index . '<modify-labels><up><return>'
# remove all tags
macro index \CT '<untag-pattern>~A<return>'
# add bindings to cycle trough history
bind editor \CP history-up
bind editor \CN history-down
# add tab to select completion
bind query <tab> next-entry
bind query <backtab> previous-entry
# add key to copy sender email address
bind index,pager y noop
macro index,pager yy '<pipe-message>fgrep -m 1 From: | sed "s/^\s*From:\s*[^<]*\s*<\([^>]*\)>\s*$/\1/" | xsel -i --clipboard<enter>'
# advanced labeling of mails
bind index,pager m noop
macro index,pager md '<modify-labels-then-hide>-todo -inbox -unread<return><sync-mailbox>'
macro index,pager mt '<modify-labels>todo -unread<return>'
macro index,pager mh '<modify-labels>-spamy<return>'
macro index,pager mr '<modify-labels>-unread<return>'
macro index,pager mb '<modify-labels>backlog -unread<return>'
bind generic z noop
macro index,pager zI '^T<tag-thread><tag-prefix>I'
macro index,pager zA '^T<tag-thread><tag-prefix>A'
macro index,pager zb '^T<tag-thread><tag-prefix>mb'
# jump to next message after tagging
macro index t '<tag-entry><next-undeleted>'
macro index \CR '<tag-pattern>~N<return>mr^T'
# some hack for support mails
subscribe [email protected]
set ignore_list_reply_to=yes