LESSKEY(1) — UNIX Programmer’s Manual
NAME
lesskey − specify key bindings for less
SYNOPSIS
lesskey [-o output] [input]
DESCRIPTION
Lesskey is used to specify a set of key bindings to be used by less. The input file is a text file which describes the key bindings, and the output file is a binary file which is used by less. If no input file is specified, standard input is used. If no output file is specified, $HOME/.less is used.
The input file consists of lines of the form: string <whitespace> action <newline> Whitespace is any sequence of one or more spaces and/or tabs. The "string" is the command key(s) which invoke the action. The string may be a single command key, or a sequence of up to 15 keys. The "action" is the name of the less action, from the list below. The characters in the "string" may appear literally, or be prefixed by a carat to indicate a control key. A backslash may be used to cause the following character to be taken literally. Characters which must be preceeded by backslash include carat, space, tab and the backslash itself. A backslash followed by one to three octal digits may be used to specify a character by its octal value. Blank lines and lines which start with a pound sign (#) are ignored.
As an example, the following input file describes the set of default command keys used by less:
kback-line
yback-line
^Kback-line
^Yback-line
^Pback-line
bback-screen
^Bback-screen
\33vback-screen
uback-scroll
^Uback-scroll
?back-search
Eexamine
^X^Vexamine
+first-cmd
eforw-line
jforw-line
^Eforw-line
^Jforw-line
^Mforw-line
^Nforw-line
fforw-screen
^Fforw-screen
\40forw-screen
^Vforw-screen
dforw-scroll
^Dforw-scroll
/forw-search
Ggoto-end
>goto-end
\33>goto-end
ggoto-line
<goto-line
\33<goto-line
’goto-mark
^X^Xgoto-mark
Hhelp
Nnext-file
%percent
ppercent
Pprev-file
qquit
ZZquit
^Lrepaint
^Rrepaint
rrepaint
Rflush-repaint
nrepeat-search
mset-mark
!shell
=status
^Gstatus
-toggle-option
_display-option
Vversion
vvisual
Commands specified by lesskey take precedence over the default commands. A default command key may be disabled by including it in the key file with the action "invalid".
SEE ALSO
7th Edition