~gpanders/dotfiles

ref: c8e63bac959db19c138dcc3198a56514f0b444ff dotfiles/.config/mutt/bindings.rc -rw-r--r-- 2.5 KiB
c8e63bacGreg Anders Manage dotfiles directly in home directory 1 year, 4 months ago
                                                                                
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
# g is group-reply by default, we'll map that to R instead
bind  index,pager g noop
bind  index,query gg first-entry
bind  index,query G last-entry
bind  index ^ imap-fetch-mail
bind  index <space> collapse-thread

# Navigate like vim
bind  index,pager,query \Cu previous-page
bind  index,pager,query \Cd next-page
bind  index j next-entry
bind  index k previous-entry
bind  pager j next-line
bind  pager k previous-line
macro pager gg <top><refresh>
macro pager G <bottom><refresh>

# Bind R to group-reply
bind  index,pager R group-reply

# Deleting a message should also clear the 'new' flag
macro index d <clear-flag>N<delete-message> "delete the current entry"

# View attachments properly
bind attach <return> view-mailcap

# Convert markdown emails to HTML
macro compose K \
"<enter-command>set my_wait_key=\$wait_key<enter><enter-command>unset wait_key<enter>\
<enter-command>set my_resolve=\$resolve<enter><enter-command>unset resolve<enter>\
<enter-command>set my_pipe_decode=\$pipe_decode<enter><enter-command>set pipe_decode<enter>\
<pipe-entry>pandoc -s -f markdown-blank_before_blockquote -o /tmp/mutt-msg.html 2>/dev/null<enter>\
<attach-file>/tmp/mutt-msg.html<enter>\
<tag-entry><previous-entry><tag-entry><group-alternatives>\
<enter-command>set pipe_decode=\$my_pipe_decode<enter>\
<enter-command>set resolve=\$my_resolve<enter>\
<enter-command>set wait_key=\$my_wait_key<enter>" \
"convert Markdown email to HTML and send as multipart/alternative"

# Save new addresses to address book
macro index,pager a "<pipe-message>khard add-email<enter>" "add the sender email address to khard"

# Show mailbox listing by default
macro index,pager c <change-folder>?<tab> "open a different folder"

# For some reason the screen gets borked after closing a message and requires
# a redraw
macro pager q <exit><refresh>

# Return to the inbox from anywhere
macro index,pager gi <change-folder>!<enter> "go to inbox"
macro index,pager ga <change-folder>\><enter> "go to archive"

# Change accounts
macro index,pager ]a "<sync-mailbox><enter-command>source ~/.config/mutt/$my_next_account.rc<enter><change-folder>!<enter>" "next account"
macro index,pager [a "<sync-mailbox><enter-command>source ~/.config/mutt/$my_prev_account.rc<enter><change-folder>!<enter>" "previous account"

# View urls within a message with urlview
macro index,pager \Cb <pipe-message>urlview<enter> "call urlview to extract URLs out of a message"
macro attach,compose \Cb <pipe-entry>urlview<enter> "call urlview to extract URLs out of a message"

ifdef notmuch "bind index \Cs vfolder-from-query"

# vim: ft=neomuttrc