# less(1) key bindings.
# <https://greenwoodsoftware.com/less/>
# less <=582, run lesskey(1) to compile.
# 'lesskey -o ~/.less ~/.lesskey'
#
# map "-" to go up one screen like in mutt
# - back-screen
# disables regex
# / forw-search ^R
# l repeat-search
# \40 forw-scroll
# ; toggle-option
# \e quit ESC
# \t   TAB
#
# \eu        undo-hilite
# \eU        clear-search
# ^O^N       osc8-forw-search
# ^On        osc8-forw-search
# ^O^P       osc8-back-search
# ^Op        osc8-back-search
# ^O^O       osc8-open

# hl to move around 1-by-1.
# HJKL to move around by half-a-page.
# DOWN and j will move over EOF.
# Q and :cq will exit with return value 1.
# [ and ] move between files.
# $ goes to last file.
# D moves to the next line starting with "diff" or "commit" or "From " or ^L.
# U in reverse.
# C is the same as D, only for commit.
# ` flips between the last two examined files.

#command
h noaction 1\e(
l noaction 1\e)
j forw-line-force
\kd forw-line-force
J forw-screen
K back-screen
# H noaction 40\e(
# L noaction 40\e)
# r ^R repaint
# R repaint-flush
# ^L undo-hilite
^L undo-hilite
f filter
p set-mark z%'z
^F examine
# o examine
] next-file
[ prev-file
i toggle-option i
$ noaction ?@\n\eug
` noaction E\#\n
\eh help
:h  help
# Q quit \1
:cq quit \1
\\ quit
# <alt-q> exit and print what was currently visible
# ref: https://github.com/gwsw/less/issues/36
# Q toggle-option -!^Predraw-on-quit\nq
\eq toggle-option -!^Predraw-on-quit\nq
# <alt-w> toggle long lines wrapping
# ref: https://github.com/gwsw/less/issues/272
\ew toggle-option ^P-chop-long-lines\n
D noaction j/\^diff|\^commit|\^From |\\014\n\eu
U noaction DNN\eu
C noaction j/\^commit\n\eu
# f9/f10
\e[20~ toggle-option ^pS
\e[21~ toggle-option ^pR

#line-edit
^A home
^E end
^B left
^F right
^G abort
\ef word-right
^N down
^P up
^K word-delete
^W word-backspace
\e\t back-complete
# <esc/esc> abort line editing
\e\e abort

#-XRij.3 --incsearch --no-histdups --shift 5
# #LESS = --no-init --RAW-CONTROL-CHARS --ignore-case --jump-target=3 --rscroll=*n>
# #version >= 590  LESS += --incsearch
# LESSHISTFILE = -
