Compare commits

..

2 Commits

Author SHA1 Message Date
7653f052b7 alt-v: view source of email 2026-03-11 23:16:19 +01:00
f703bc487a ctrl-d,ctrl-u keys 2026-03-11 22:58:04 +01:00
3 changed files with 16 additions and 8 deletions

View File

@@ -16,11 +16,11 @@ BEGIN {
/^header{/ {
header = $0
}
/^part}/ {
/^(part|attachment)}/ {
level--
}
/^part{/ {
parts = sprintf("%s\n%"(2*level)"s%s", parts, "", substr($1, 7))
/^(part|attachment){/ {
parts = sprintf("%s\n%"(2*level)"s%s", parts, "", substr($1, index($1, "ID")))
level++
}
# /^part{ ID: [[:digit:]]+, Content-type: multipart\/alternative/ {

View File

@@ -3,11 +3,6 @@ BEGIN {
FS = "\n"
}
# message{ id:eb93d845-6fc7-4181-9848-7411ed999b3c@indyfac.ch depth:0 match:1 excluded:0 filename:/home/amin/.email/indyfac/INBOX/cur/1773225033.821818_4.fredkin,U=4172:2,S
# header{
# lobo loco <loboloco@indyfac.ch> (Today 10:12) (inbox)
/^message{/ {
id = ""
depth = -1

View File

@@ -58,6 +58,13 @@ if [ "${1:-}" = "--preview-message" ]; then
exit
fi
if [ "${1:-}" = "--view-source" ]; then
shift
messageid="$1"
less $($NOTMUCH search --output=files id:$messageid)
exit
fi
# FZF default configs
FZF_DEFAULT_PREVIEW_WINDOW="right,80,border-line,wrap-word"
FZF_ALTERNATE_PREVIEW_WINDOW="bottom,80%,border-line,wrap-word"
@@ -76,10 +83,12 @@ if [ "${1:-}" = "--show-thread" ]; then
--bind="alt-s:change-with-nth({1} {2} {3} ({4})|$FZF_DEFAULT_THREAD_LINE)" \
--accept-nth=5 \
--bind='alt-j:preview-down,alt-k:preview-up' \
--bind='ctrl-d:half-page-down,ctrl-u:half-page-up' \
--bind='page-up:preview-half-page-up,page-down:preview-half-page-down' \
--bind="enter:" \
--bind="ctrl-h,backward-eof:abort" \
--bind="alt-/:change-preview-window($FZF_ALTERNATE_PREVIEW_WINDOW|$FZF_DEFAULT_PREVIEW_WINDOW)" \
--bind="alt-v:execute:$0 --view-source {5}" \
--preview="$0 --preview-message {5}" \
--preview-window="$FZF_DEFAULT_PREVIEW_WINDOW" || true)
exit
@@ -113,6 +122,7 @@ while true; do
--bind="alt-R:print($CMD_SEARCH_ADDRESS$ADDRESS_TO$APPEND)+accept" \
--bind="alt-q:print($CMD_EDIT_QUERY)+accept" \
--bind='alt-j:preview-down,alt-k:preview-up' \
--bind='ctrl-d:half-page-down,ctrl-u:half-page-up' \
--bind='page-up:preview-half-page-up,page-down:preview-half-page-down' \
--bind="enter,ctrl-l:execute:$0 --show-thread {4}" \
--bind="alt-/:change-preview-window($FZF_ALTERNATE_PREVIEW_WINDOW|$FZF_DEFAULT_PREVIEW_WINDOW)" \
@@ -124,6 +134,7 @@ while true; do
tag=$(__notmuch_list_tags | fzf \
--ansi \
--cycle \
--bind='ctrl-d:half-page-down,ctrl-u:half-page-up' \
--margin='20%' \
--bind='enter:accept-or-print-query' \
--border=double \
@@ -146,6 +157,7 @@ while true; do
--ansi \
--tiebreak=index \
--cycle \
--bind='ctrl-d:half-page-down,ctrl-u:half-page-up' \
--margin='20%' \
--bind='enter:accept-or-print-query' \
--border=double \
@@ -164,6 +176,7 @@ while true; do
nmquery=$(fzf \
--ansi \
--tac \
--bind='ctrl-d:half-page-down,ctrl-u:half-page-up' \
--margin='20%' \
--query="$nmquery" \
--disabled \