Skip to content

Commit

Permalink
mless: prefer setting LESSKEYIN and .mlesskey
Browse files Browse the repository at this point in the history
  • Loading branch information
leahneukirchen committed Sep 28, 2021
1 parent fcd8428 commit 958e3e0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
8 changes: 8 additions & 0 deletions man/mless.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion mless
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion mlesskey.example
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 958e3e0

Please sign in to comment.