aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2021-09-28 16:18:35 +0200
committerLeah Neukirchen <leah@vuxu.org>2021-09-28 16:18:35 +0200
commit958e3e08bd74e6bec3e5baee87041025fe59494d (patch)
tree28014e10bd6e89060eb279c23fa7b0accc269ebc
parentfcd8428b729eb4047f467384b5f9be93ce1419a0 (diff)
downloadmblaze-958e3e08bd74e6bec3e5baee87041025fe59494d.tar.gz
mblaze-958e3e08bd74e6bec3e5baee87041025fe59494d.tar.xz
mblaze-958e3e08bd74e6bec3e5baee87041025fe59494d.zip
mless: prefer setting LESSKEYIN and .mlesskey
Fixes #215.
-rw-r--r--man/mless.18
-rwxr-xr-xmless8
-rw-r--r--mlesskey.example2
3 files changed, 16 insertions, 2 deletions
diff --git a/man/mless.1 b/man/mless.1
index a085946..d446fdd 100644
--- a/man/mless.1
+++ b/man/mless.1
@@ -43,6 +43,14 @@ Use
and
.Sq Ic ":p"
to read the next (resp. previous) message.
+.Sh FILES
+.Bl -tag -width Ds
+.It Pa ${MBLAZE:-$HOME/.mblaze}/mlesskey , Pa $HOME/.mlesskey
+Additional keybindings loaded for convenience.
+.It Pa ${MBLAZE:-$HOME/.mblaze}/mless , Pa $HOME/.mless
+Additional compiled keybindings loaded for convenience.
+(Only needed for less earlier than version 590.)
+.El
.Sh EXIT STATUS
.Ex -std
.Sh SEE ALSO
diff --git a/mless b/mless
index 08ce513..ddead98 100755
--- a/mless
+++ b/mless
@@ -72,7 +72,13 @@ nl="
"
export MLESS_RAW=0
export MLESS_HTML=0
-if [ -f "$MBLAZE/mless" ]; then
+if [ -f "$MBLAZE/mlesskey" ]; then
+ export LESSKEYIN="$MBLAZE/mlesskey"
+elif [ -f "$HOME/.mblaze/mlesskey" ]; then
+ export LESSKEYIN="$HOME/.mblaze/mlesskey"
+elif [ -f "$HOME/.mlesskey" ]; then
+ export LESSKEYIN="$HOME/.mlesskey"
+elif [ -f "$MBLAZE/mless" ]; then
export LESSKEY="$MBLAZE/mless"
elif [ -f "$HOME/.mblaze/mless" ]; then
export LESSKEY="$HOME/.mblaze/mless"
diff --git a/mlesskey.example b/mlesskey.example
index 59e2097..6692b53 100644
--- a/mlesskey.example
+++ b/mlesskey.example
@@ -1,5 +1,5 @@
# mless(1) keybindings
-# to update: lesskey -o ~/.mless ~/.mlesskey
+# to update (only on less <590): lesskey -o ~/.mless ~/.mlesskey
Q quit \1
:cq quit \1
[ prev-file