From 98b1b24ced932919af366821813405c485fc3596 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Sat, 19 Feb 2022 00:01:44 -0500 Subject: [PATCH] mblaze: Add initial mblaze setup Wow. mless(1) just blew my mind. On so many levels. I should write a blog post about it... 1. Call less with just the _numbers_ of the files and use LESSOPEN to convert number -> file (or just the scan) 2. less(1) allows non-default key bindings? lesskey(1) is new to me (and so cool!) 3. Using a combo of lesskey's and exit status, the user can modify state (i.e. mark read) and respawn mless(1) It's recursing on itself to preprocess, to iterate, and just generally a brilliant use of small utils together! --- .gitignore | 1 + .mblaze/filter | 3 +++ .mblaze/mless.in | 23 +++++++++++++++++++++++ Makefile | 3 +++ 4 files changed, 30 insertions(+) create mode 100644 .gitignore create mode 100644 .mblaze/filter create mode 100644 .mblaze/mless.in create mode 100644 Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..327f01d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.mblaze/mless diff --git a/.mblaze/filter b/.mblaze/filter new file mode 100644 index 0000000..af2d6be --- /dev/null +++ b/.mblaze/filter @@ -0,0 +1,3 @@ +# .mblaze/filter -- used by mshow(1) to display certain MIME types +# (hint: run mless(1) and toggle HTML-view with `H` (lesskey must be installed) +text/html: w3m -T text/html diff --git a/.mblaze/mless.in b/.mblaze/mless.in new file mode 100644 index 0000000..0d2d38b --- /dev/null +++ b/.mblaze/mless.in @@ -0,0 +1,23 @@ +# mless(1) keybindings, compiled with mlesskey(1). See ./Makefile +# +# mless(1) takes its commands via the exit codes below: +# +# 36) # $ goto end +# 78) # N go to next unseen message +# 107) # k next thread +# 100) # d mark read +# 82) # R toggle raw mode +# 72) # H toggle HTML mode +# 94) # ^ goto parent +Q quit \1 +$ quit $ +S noaction E//scan\n +` noaction E\#\n +H quit H +N quit N +R quit R +T quit k +r quit d +\^ quit \^ +J next-file +K prev-file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..48e268d --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +# Makefile -- to compile binary config files +.mblaze/mless: .mblaze/mless.in + lesskey -o $@ .mblaze/mless.in -- libgit2 1.1.1