-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_muttrc
343 lines (315 loc) · 14.2 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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
#¤º°`°º¤ø,¸¸,ø¤º°`°º¤øø¤º°`°º¤ø,¸¸,ø¤º°`°º¤øø¤º°`°º¤¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø#
#
# Name: $HOME/.muttrc
#
# This file can be chmod 755
#
# To determine a setting e.g.:
# :set ?sort
# To avoid using this .muttrc:
# /bin/mutt -F foo <---foo must exist
#
# Created: 03-Jun-2001 (Bob Heckel)
# Modified: 29-Jul-2023 (Bob Heckel)
#
#¤º°`°º¤ø,¸¸,ø¤º°`°º¤øø¤º°`°º¤ø,¸¸,ø¤º°`°º¤øø¤º°`°º¤¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø#
# Initialize
reset all # variables to system defaults
unhook *
unlists *
source $HOME/.email_addr
source $HOME/.muttprivate # personal config specific to this box
# E.g.
#send-hook . 'my_hdr From: Bob Heckel <[email protected]>
#send-hook . 'my_hdr Reply-To: Bob Heckel <[email protected]>
# Show version at startup; side effect is to give visual confirmation after
# .muttrc has been sourced from its command line.
push V
set abort_unmodified=no # let me send blank emails
set alias_format="%4n%t%-17a %r"
set noarrow_cursor # only for index, it is redefined later
set ascii_chars # use plain ASCII characters when displaying thread, etc.
set attach_format="%u%D%I %t%4n %T%.40d%> [%.7m/%.10M, %.6e%?C?, %C?, %s] "
# On Sun, Mar 24, 2013 at 09:18:43AM -0400, Bob Heckel wrote:
set attribution="On %d, %n wrote:"
set auto_tag # press 't' to select items, next op will apply to all tagged
set write_bcc=no # fix strangeness with occasionally visible Bcc:
###set collapse_unread=no
set charset=utf-8
set confirmappend=no # don't ask me if ok during saves
set copy=yes # copies of outgoing messages will be saved (to $record)
# Messages marked for deletion will automatically be purged without prompting.
set delete=yes
set edit_headers
set editor="vim -c 'set tw=68 et' +/^$"
# Uses attachment detection logic. TODO is it worth it?
###set editor=/arpa/ag/b/bheckel/bin/mutt-editor
# Avoid the tampering that certain mail delivery and transport agents tend to do with 'From' in messages.
set encode_from=yes
set fast_reply=yes
set fcc_attach # save attachments with body of sent msgs
set folder=$HOME/mail
set folder_format="%1N%4C %10F%10u %9s %15f %4C" # file Directory window
set forward_format="Fwd: %s"
set hdrs=yes # user defined header fields are added to every new message
set history=100
set include=yes # quote all, save time, can always del the quoted part in Vim
set ispell="aspell -e -c"
set pager_context=1 # N lines from bot of prev is also on start of new pg
set pager_index_lines=7
# SENDER's date/time on sender's machine when he sent the email.
set pager_format="Bytes:%c" # email message status line
set pager_stop # don't fall thru to next message
#set postponed=$HOME/Mail/postponed
set print=ask-yes
unset mark_old # don't mark as read if I haven't read it
unset markers # no '+' markers at the beginning of wrapped lines (for clipbd)
# Hide .procmailusage and archive files when using file browser. Double
# backslashes!
set mask="!(^\\.|gz$)"
set mbox=$HOME/mail/saved
set metoo=no # remove yourself from To: line during replies
set menu_scroll=yes
set message_format="%s"
set move=ask-yes # ask to move read emails to mbox
set nohelp
set print=ask-yes
set quit=yes
set quote_regexp="^ {0,4}[a-zA-Z]*([^<]*{0,4}[>%])"
set read_inc=5
#set record="$HOME/Mail/sentmail"
set reply_to=ask-yes # use or ignore Reply-To
set reverse_name # reply as the user to whom the mail was sent to
###set sendmail_wait=-1 # don't wait for actual send to occur
set simple_search="~f %s | ~s %s"
###set score_threshold_flag=100 # place ! in front of wanted email
###set score_threshold_read=80 # mark crap not sent directly to me as read
set smart_wrap
# The method that comes second (after the '/' ). 'date-sent' is same as 'date'
#set sort_aux=date-sent
set sort_aux=last-date-received
set sort=threads
set sort_re
# Status line displayed in the index menu.
set status_format="%h %f[Tot:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d? Postp:%p](%s/%S)%> (%P)"
set suspend # allow Ctrl-z
set tilde=yes # like vi
set tmpdir="$HOME/tmp"
set to_chars="-+TCF"
set uncollapse_jump=yes
set nouser_agent # creates User-Agent: Mutt/<Version> header
set wait_key=no # don't want to press CR after creating a tunnel
set wrap_search
# Clean up mails.
###set display_filter="$HOME/bin/muttfilter.pl"
# vim-like
bind alias ' ' next-page
bind alias G last-entry
bind alias L bottom-page # clashes with mailing list L; don't need H, M
bind alias b previous-page
bind alias \Cb previous-page
bind alias g first-entry # clashes with group-reply
bind browser b previous-page
bind browser \Cb previous-page
bind browser G last-entry
bind browser q exit
bind attach ' ' next-page
bind attach G last-entry
bind attach L bottom-page # clashes with mailing list L; don't need H, M
bind attach R group-reply # override default g
bind attach b previous-page
bind attach \Cb previous-page
bind attach e edit-type
bind attach g first-entry
bind attach z noop
bind compose <insert> attach-file
bind compose <delete> detach-file
bind compose D edit-description # swap with d
bind compose p postpone-message # clashes with pgp-menu
bind compose d detach-file # swap with D
bind compose f edit-from # instead of <esc>f
bind compose F edit-fcc # instead of f clashes with filter
bind compose v view-attach
bind compose y noop # avoid accidental send
bind compose Y send-message # avoid accidental send
bind index <down> next-entry
bind index <space> next-page
bind index <tab> change-folder
bind index <up> previous-entry
bind index \eN next-new
bind index \eP previous-new
bind index \CN next-unread
bind index \CP previous-unread
bind index * tag-entry # toggle
# Can't use this due to macros like ,1 which calls less. But I don't usually flag messages anyway.
###bind index ! flag-message # toggle. Clashes with shell-escape (good)
bind index B bounce-message
bind index C collapse-all # clashes with copy-message
bind index D undelete-message # use Tag to select then D to mass undelete
bind index G last-entry
bind index L bottom-page # clashes with mailing list L; don't need H, M
bind index R group-reply
bind index b previous-page
bind index \Cb previous-page
bind index g first-entry # clashes with group-reply
bind index k previous-entry # override previous-undeleted
bind index p search-opposite
###bind index x noop # currently being used as a macro
bind pager <down> next-line
bind pager <up> previous-line
bind pager <tab> change-folder # as in index
bind pager \Cn search-next
bind pager \Cp search-opposite
bind pager \Ce next-line
bind pager \Cy previous-line
bind pager ' ' next-page
bind pager \Cf next-page
bind pager \Cd delete-message
bind pager [3~ delete-message
bind pager / search
bind pager B bounce-message
bind pager D undelete-message
bind pager G bottom
bind pager R group-reply
bind pager b previous-page
bind pager \Cb previous-page
bind pager g top
bind pager h exit # like slrn
bind pager i noop # strangely mapped to exit by default
bind pager j next-line
bind pager k previous-line
bind pager n next-entry
bind pager p previous-entry
bind pager t display-toggle-weed # act like slrn; clashes with tag
###bind pager x noop # currently being used as a macro
# Archive older than 9 months. Must be in folder of interest.
###macro index ,a "<tag-pattern>~r>9m!(~F|~N)<enter><tag-prefix><save-message>mailarch/ARCH"
# Use $ muttman outside of mutt. It is configured as: alias muttman='less
# /usr/doc/mutt/manual.txt' in .bashrc
# Forward spam (including full headers) to SpamCop.
###macro index \Cf ":set display-toggle-weed\n: \
###<forward-message>[email protected]\n\n"
# For SpamCop forwards.
###macro pager S "<enter-command>set invforward_decode<enter>" "Toggle full hdrs on fwd"
macro attach J "<save-entry>~/html/tmp.jpg" "Save JPG image to ~/html for viewing in browser"
macro attach S "<save-entry>~/html/tmp." "Save image to ~/html for viewing in browser"
macro index <F2> ":source $HOME/.muttrc\n" "Source .muttrc"
macro index <F12> "quit" "Quit" # like Vim
# Messages created via <Esc>e do not get copied to sent_messages. This is a
# known "feature" -- here's a workaround:
macro index \ee "<resend-message>f=sentmail\n" \
"Resend message with fcc set to sentmail"
macro index j "<next-entry>@" "View sender's email in statusbar"
# Replied to mail is normally deleted
macro index r "C=repliedto\n<reply>" "Save a copy then reply"
macro index x "c?" "Keystroke saving mailbox browsing"
# TODO is this working?
macro index R "C=repliedto\n<group-reply>" "Save a copy then reply to all"
# TODO hangs mutt don't know why
###macro index \cs "set index_format='%s'" "View subject only"
macro index \cx "<tag-pattern>.*\n<tag-prefix>d" "Delete all"
# Like google Reader
###macro index A "<tag-pattern>.*\n<tag-prefix>d" "Delete all"
# Like gmail
macro index \# "<tag-pattern>.*\n<tag-prefix>d" "Delete all"
###macro pager <F2> ":source $HOME/.muttrc\n" "Source .muttrc"
macro pager <F12> "quit" "Quit" # like Vim
macro pager r "C=repliedto\n<reply>" "Save a copy then reply"
macro pager R "C=repliedto\n<group-reply>" "Save a copy then reply to all"
# Rather be orthagonal with w3m
###macro pager \cb <pipe-entry>'urlview'<enter> "Follow links with urlview"
macro pager \ee "<resend-message>f=sentmail\n" \
"Resend message with fcc set to sentmail"
macro pager w "<enter-command>set invsmart_wrap invmarkers<enter>" "Toggle wrapping"
macro pager \cx "q<tag-pattern>.*\n<tag-prefix>d" "Close current msg and delete all"
###macro pager \cu |urlview\n "View links in urlview"
macro pager \cu |w3m\n "Call w3m to extract URLs then press ':' (urlview improvement)"
macro pager x "c?" "Keystroke saving mailbox browsing"
# ...more in $HOME/.private
# First ignore all lines by default.
ignore *
# Except these (not case sensitive), unless I toggle to view all.
unignore From: Reply-To: To: Cc: Bcc: Subject: Organization: \
Date: User-Agent: X-Operating-System: X-Editor: X-Mailer: \
Newsgroups: X-Resent Followup-To: Mail-Followup-To: Importance: \
X-Message-Flag
hdr_order Sender: From: Reply-To: To: Cc: Bcc: Subject: Organization: \
Date: User-Agent: X-Operating-System: X-Editor: X-Mailer: \
Newsgroups: X-Resent Followup-To: Mail-Followup-To: \
Importance: X-Message-Flag
# Add these custom headers to my outgoing mail.
###my_hdr X-Operating-System: `uname -m -r -s`
###my_hdr X-Editor: `$EDITOR -h` # mutt only parses the first line, so this works
###my_hdr X-Message-Flag: Have more than thou showest, speak less than thou knowest - Shakespeare
###my_hdr Bcc: [email protected]
# Handle unknown types:
###charset-hook x-unknown ISO-8859-1
###charset-hook x-unknown US-ASCII
# Render HTML in mutt
alternative_order text/plain text/enriched text/html
# Mutt knows to use the second one in the pager because of 'copiousoutput'. It uses the first one if we select
# a pdf attachment from the attachment menu.
# from .mailcap:
# text/html; /usr/pkg/bin/links %s; nametemplate=%s.html
# text/html; /usr/pkg/bin/links -dump %s; copiousoutput
# or probably better:
# text/html; w3m -I %{charset} -T text/html; copiousoutput;
#
# #TODO how to toggle in app?
# On for view / off for fwd
#auto_view "text/html"
# To forward as HTML press C-T (after :q but before Y to send) and edit "plain" to something
# like "Content-Type: text/html; charset=utf-8"
# Note: folder-hook requires double backslashes for one space!
# Defaults:
folder-hook . set index_format="%2C%Z%(%b%d)\\ %-10.10n:\\ %s"
#folder-hook . set sort=date-sent
folder-hook . set sort=last-date-received
folder-hook . set sort=threads # want cursor on msg 1
folder-hook . save-hook . =trash
folder-hook '!' save-hook . =Tmp
folder-hook 'Cygwin' set index_format="[%-12.12n]\\ %s"
# TODO folder-hook 'Cygwin' collapse-all .
folder-hook 'Mutt' set index_format="[%-12.12n]\\ %s"
folder-hook 'Perl' set index_format="[%-12.12n]\\ %s"
folder-hook 'Vim' set index_format="[%-12.12n]\\ %s"
# Default simple_search above looks at From: and Subject:
# This uses To: and Subject: since it's all mail from me to others.
# - Quotes mandatory. -
folder-hook sentmail 'set simple_search="~t %s | ~s %s"'
# HTML is the LAST option (Outlook protection).
alternative_order text/plain text/enriched text/html
# Note: double backslashes!
color body blue black "\\* On .*[^:]:" # On Thu, May 21...
color body green black "(ftp|http)://[^ >]+" # URLs
color body yellow black "\\*+[-a-z_0-9 .']+\\*+" # bolded
color body yellow black " _.*_ " # bolded
color body green black "[-a-z_0-9.]+@[-a-z_0-9.]+" # e-mail addresses
color body black black "-+BEGIN PGP SIGNATURE"
color body black black "-+END PGP SIGNATURE"
color attachment blue black
color hdrdefault yellow black
color header green black "^(From|Reply-To|To|TO|Cc|CC|Date):"
color header red black "^Subject: "
color index green black ~N # new
###color index blue black ~O # old
color index magenta black ~D # deleted
color index yellow black ~T # tagged
###color index green black ~F # flagged
color indicator black green
color status white blue
color tilde blue black
color quoted cyan black
color quoted1 green black
color quoted2 yellow black
color quoted3 red black
# Colour definitions when on a mono screen.
mono bold bold
mono underline underline
mono indicator reverse
# Various smilies.
color body brightgreen white "<[Gg]>" # <g>
color body brightgreen white " [;:]-*[)>(<|]" # :-) etc...
color body brightcyan black "(^|[[:space:]])\\*[^[:space:]]+\\*([[:space:]]|$)" # *bold* text
color body brightcyan black "(^|[[:space:]])_[^[:space:]]+_([[:space:]]|$)" # _underlined_ text
color body brightblue yellow "(^|[[:space:]])/[^[:space:]]+/([[:space:]]|$)" # /italic/ text