From 9c689b4c78b0b651f2e79d27a0d602b380a90c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Benencia?= Date: Fri, 28 Jun 2019 09:12:18 -0700 Subject: Add mutt config --- .mutt/muttrc.macros | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .mutt/muttrc.macros (limited to '.mutt/muttrc.macros') diff --git a/.mutt/muttrc.macros b/.mutt/muttrc.macros new file mode 100644 index 0000000..2dc8eba --- /dev/null +++ b/.mutt/muttrc.macros @@ -0,0 +1,52 @@ +# Common macros +macro index \eR "|~/bin/mutt-remember-mail\n" +macro pager \cu 'urlview' 'Follow links with urlview' + +macro index,pager \cb " urlscan" "call urlscan to extract URLs out of a message" +macro attach,compose \cb " urlscan" "call urlscan to extract URLs out of a message" + +# Sidebar +macro index,pager B 'toggle sidebar_visible' + +macro index "toggle sidebar_visible" +macro pager "toggle sidebar_visible" + +macro index,pager D "" "Delete message" + +macro index \ +"unset wait_keynotmuch new" \ +"notmuch: Index new messages" + + +macro index \ + "unset wait_key~/bin/mutt-fetchbug --prompt search~/.cache/mutt_btsresultsset wait_key" \ + "fetch bug(s) (using bts show)" + +macro index \ +"set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key\ +notmuch-mutt -r --prompt search\ +`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`\ +set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key" \ + "notmuch: search mail" + +macro index \ +"set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key\ +notmuch-mutt -r thread\ +`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`\ +set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key" \ + "notmuch: reconstruct thread" + +macro index m "T~N;WN^T~TT~O;WN^T~T" "mark all messages read" + + +# toggle TOFU protection with ESC-0 (off) and ESC-1 (on) +macro generic \e0 ":unset display_filter\n" "Turn TOFU protection off" +macro generic \e1 ":set display_filter='t-prot -cmekatlS --max-lines=250 --bigq --pgp-short --pgp-move --pgp-move-vrf -Mmutt -L/etc/t-prot/footers -A/etc/t-prot/ads'\n" "Turn TOFU protection on" + +# same in pager mode - ugly but what the hell... +macro pager \e0 ":unset display_filter; exec exit\n:exec display-message\n" "Turn TOFU protection off" +macro pager \e1 ":set display_filter='t-prot -cmekatlS --max-lines=250 --bigq --pgp-short --pgp-move --pgp-move-vrf -Mmutt -L/etc/t-prot/footers -A/etc/t-prot/ads'; exec exit\n:exec display-message\n" "Turn TOFU protection on" + +macro attach 'V' "cat > ~/tmp/mail.html && xdg-open ~/tmp/mail.html && rm -f ~/tmp/mail.html" + +source "$HOME/.mutt/muttrc.macros.env|" \ No newline at end of file -- cgit v1.2.3