mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit 803665b9b2fbd4b131758ebefcb1eb77aa46d00b
parent 430bb0d74c9157cdbd1e8ca5619b5c8241ec7fad
Author: Christian Neukirchen <chneukirchen@gmail.com>
Date:   Thu, 28 Jul 2016 23:46:02 +0200

mless: experimental shortcuts

Compile mlesskey.example into ~/.mless to use them.

Diffstat:
mless | 20++++++++++++++++++--
mlesskey.example | 11+++++++++++
2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/mless b/mless @@ -71,5 +71,21 @@ fi nl=" " -LESSOPEN="|$0 --filter %s" exec less -Ps"mless %f?m (message %i of %m).." -R \ - "+:e $(mseq -n .)$nl" //scan $(mseq -n :) +while :; do + [ -f $HOME/.mless ] && export LESSKEY=$HOME/.mless + LESSOPEN="|$0 --filter %s" \ + less -Ps"mless %f?m (message %i of %m).." -R \ + "+:e $(mseq -n .)$nl" //scan $(mseq -n :) + case "$?" in + 0|1) exit $?;; + 78) # N go to next unsen message + mseq -C "$(mseq -r .: | + awk -F':2,' '$1 !~ /^</ && $2 !~ /S/ { print; exit }')";; + 107) # k next thread + mseq -C "$(mseq .+1: | grep -m1 '^[^ <]')";; + 100) # d mark read + mflag -S . + mseq -f | mseq -S + mseq -C + + esac +done diff --git a/mlesskey.example b/mlesskey.example @@ -0,0 +1,11 @@ +# mless(1) keybindings +# to update: lesskey -o ~/.mless ~/.mlesskey +Q quit \1 +:cq quit \1 +[ prev-file +] next-file +S noaction E//scan\n +` noaction E\#\n +N quit N +k quit k +d quit d