lesskey(1) lesskey(1)
NAME
lesskey - define key bindings for less or more
SYNOPSIS
lesskey [-o outputfile] [inputfile]
DESCRIPTION
lesskey is used to specify key bindings which should be used by less
or more. inputfile is a text file which describes the key bindings.
outputfile is a binary file which is used by less or more. If no
inputfile is specified, the default input is used. If no outputfile is
specified, the file $HOME/.less is created.
The inputfile file consists of lines of the format:
string <space> action [extra-string] <newline>
<space> is any sequence of one or more spaces and/or tabs. string
describes the command key(s) which invoke the action. string can be a
single command key or a sequence of up to 15 keys. action is the name
of the action to be executed by less. The names are listed below.
string can contain normal characters and control characters. Control
characters begin with a carat. A backslash means that the following
character is regarded as a normal character. The carat, space and tab
as well as the backslash must be preceded by a backslash. A backslash
followed by one to three octal digits can be used to specify a charac-
ter by its octal value. Blank lines and lines which start with a #
sign are ignored.
An action can be followed by an extra-string. extra-string is parsed
after the command is entered, as if it were an entry in the command
line. This can be useful to extend the functionality of a command. For
example, the following entries create a pair of commands to turn
on/off line numbering using the vi synopsis:
:set\ nu toggle-option -N
:set\ nonu toggle-option +N
ACTIONS
In action you specify the function of more or less which is to be ini-
tiated by the command key(s). lesskey recognizes the following key-
words (each with an explanation):
Page 1 Reliant UNIX 5.44 Printed 11/98
lesskey(1) lesskey(1)
______________________________________________________________________
| back-bracket | search bracket backward |
|____________________|________________________________________________|
| back-line | back a line |
|____________________|________________________________________________|
| back-line-force | back a forced line |
|____________________|________________________________________________|
| back-screen | back a screen |
|____________________|________________________________________________|
| back-scroll | scroll backward |
|____________________|________________________________________________|
| back-search | search backward |
|____________________|________________________________________________|
| back-window | back a window |
|____________________|________________________________________________|
| debug | activate debug mode |
|____________________|________________________________________________|
| display-flag | like display-option |
|____________________|________________________________________________|
| display-option | display value of an option |
|____________________|________________________________________________|
| end | quit less or more |
|____________________|________________________________________________|
| examine | display file |
|____________________|________________________________________________|
| first-cmd | start command |
|____________________|________________________________________________|
| firstcmd | start command |
|____________________|________________________________________________|
| flush-repaint | refresh screen, delete buffer |
|____________________|________________________________________________|
| forw-bracket | search bracket forward |
|____________________|________________________________________________|
| forw-forever | always forward |
|____________________|________________________________________________|
| forw-line | forward a line |
|____________________|________________________________________________|
| forw-line-quit | forward a line, at the end of the line on to |
| | next file or quit less or more |
|____________________|________________________________________________|
| forw-line-skip | skip forward a line |
|____________________|________________________________________________|
| forw-line-force | forward a forced line |
|____________________|________________________________________________|
| forw-screen | screen forward |
|____________________|________________________________________________|
| forw-scroll | scroll forward |
|____________________|________________________________________________|
| forw-search | search forward |
|____________________|________________________________________________|
Page 2 Reliant UNIX 5.44 Printed 11/98
lesskey(1) lesskey(1)
______________________________________________________________________
| forw-window | window forward |
|____________________|________________________________________________|
| goto-end | skip to end |
|____________________|________________________________________________|
| goto-line | skip to line |
|____________________|________________________________________________|
| goto-mark | skip to mark |
|____________________|________________________________________________|
| help | help |
|____________________|________________________________________________|
| index-file | file from the list |
|____________________|________________________________________________|
| invalid | invalid |
|____________________|________________________________________________|
| next-file | next file |
|____________________|________________________________________________|
| noaction | (no action. Useful for turning off commands |
| | silently) |
|____________________|________________________________________________|
| percent | skip to percent |
|____________________|________________________________________________|
| pipe | pipe |
|____________________|________________________________________________|
| prev-file | previous file |
|____________________|________________________________________________|
| quit | quit |
|____________________|________________________________________________|
| repaint | refresh screen |
|____________________|________________________________________________|
| repaint-flush | refresh screen, delete buffer |
|____________________|________________________________________________|
| repeat-search | repeat search |
|____________________|________________________________________________|
| repeat-search-all | repeat search across all files |
|____________________|________________________________________________|
| reverse-search | repeat reverse search |
|____________________|________________________________________________|
| reverse-search-all | repeat reverse search across all files |
|____________________|________________________________________________|
| set-mark | set mark |
|____________________|________________________________________________|
| shell | shell command |
|____________________|________________________________________________|
| status | status |
|____________________|________________________________________________|
| toggle-flag | like toggle-option |
|____________________|________________________________________________|
| toggle-option | reverse option |
|____________________|________________________________________________|
Page 3 Reliant UNIX 5.44 Printed 11/98
lesskey(1) lesskey(1)
______________________________________________________________________
| version | output version |
|____________________|________________________________________________|
| visual | call editor |
|____________________|________________________________________________|
Commands specified by lesskey have priority over the default commands.
A default command can be deactivated by assigning it the action
"invalid" in the key file.
EXAMPLE
The following input file describes default command keys used by less:
e forw-line
j forw-line
^E forw-line
^N forw-line
k back-line
y back-line
^Y back-line
^K back-line
^P back-line
J forw-line-force
K back-line-force
Y back-line-force
d forw-scroll
^D forw-scroll
u back-scroll
^U back-scroll
\40 forw-screen
f forw-screen
^F forw-screen
^V forw-screen
b back-screen
^B back-screen
\33v back-screen
z forw-window
w back-window
F forw-forever
R repaint-flush
r repaint
^R repaint
^L repaint
g goto-line
< goto-line
\33< goto-line
p percent
% percent
{ forw-bracket {}
} back-bracket {}
Page 4 Reliant UNIX 5.44 Printed 11/98
lesskey(1) lesskey(1)
( forw-bracket ()
) back-bracket ()
[ forw-bracket []
] back-bracket []
\33^F forw-bracket
\33^B back-bracket
G goto-end
\33> goto-end
> goto-end
P goto-end
= status
^G status
:f status
/ forw-search
? back-search
\33/ forw-search *
\33? back-search *
n repeat-search
\33n repeat-search all
N reverse-search
\33N reverse-search all
m set-mark
' goto-mark
^X^X goto-mark
E examine
:e examine
^X^V examine
:n next-file
:p prev-file
:x index-file
- toggle-option
:t toggle-option t
s toggle-option o
display-option
| pipe
v visual
! shell
+ firstcmd
H help
h help
V version
q quit
:q quit
:Q quit
ZZ quit
\33\33 quit
SEE ALSO
less(1), more(1).
Page 5 Reliant UNIX 5.44 Printed 11/98