Sortix cross-volatile manual
This manual documents Sortix cross-volatile. You can instead view this document in the latest official manual.
LESSKEY(1) | General Commands Manual | LESSKEY(1) |
NAME
lesskey - customize key bindings for lessSYNOPSIS (deprecated)
lesskey [-o output] [--] [input]SCOPE
This document describes the format of the lesskey source file, which is used by less version 582 and later. In previous versions of less, a separate program called lesskey was used to compile the lesskey source file into a format understood by less. This compilation step is no longer required and the lesskey program is therefore deprecated, although the file format remains supported by less itself.DESCRIPTION
A lesskey file specifies a set of key bindings and environment variables to be used by subsequent invocations of less.FILE FORMAT
The input file consists of one or more sections. Each section starts with a line that identifies the type of section. Possible sections are:- #command
- Customizes command key bindings.
- #line-edit
- Customizes line-editing key bindings.
- #env
- Defines environment variables.
COMMAND SECTION
The command section begins with the line\b | BACKSPACE | (0x08) |
\e | ESCAPE | (0x1B) |
\n | NEWLINE | (0x0A) |
\r | RETURN | (0x0D) |
\t | TAB | (0x09) |
\kb | BACKSPACE (the BACKSPACE key) |
\kB | ctrl-BACKSPACE |
\kd | DOWN ARROW |
\kD | PAGE DOWN |
\ke | END |
\kh | HOME |
\ki | INSERT |
\kl | LEFT ARROW |
\kL | ctrl-LEFT ARROW |
\kr | RIGHT ARROW |
\kR | ctrl-RIGHT ARROW |
\kt | BACKTAB |
\ku | UP ARROW |
\kU | PAGE UP |
\kx | DELETE |
\kX | ctrl-DELETE |
\k1 | F1 |
EXAMPLE
The following input file describes the set of default command keys used by less. Documentation on each command can be found in the less man page, under the key sequence which invokes the command.#command | |
\r | forw-line |
\n | forw-line |
e | forw-line |
j | forw-line |
\kd | 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 |
\kD | forw-screen |
b | back-screen |
^B | back-screen |
\ev | back-screen |
\kU | back-screen |
z | forw-window |
w | back-window |
\e\40 | forw-screen-force |
F | forw-forever |
\eF | forw-until-hilite |
R | repaint-flush |
r | repaint |
^R | repaint |
^L | repaint |
\eu | undo-hilite |
\eU | clear-search |
g | goto-line |
\kh | goto-line |
< | goto-line |
\e< | goto-line |
p | percent |
% | percent |
\e( | left-scroll |
\e) | right-scroll |
\kl | left-scroll |
\kr | right-scroll |
\e{ | no-scroll |
\e} | end-scroll |
{ | forw-bracket {} |
} | back-bracket {} |
( | forw-bracket () |
) | back-bracket () |
[ | forw-bracket [] |
] | back-bracket [] |
\e^F | forw-bracket |
\e^B | back-bracket |
G | goto-end |
\e> | goto-end |
> | goto-end |
\ke | goto-end |
\eG | goto-end-buffered |
= | status |
^G | status |
:f | status |
/ | forw-search |
? | back-search |
\e/ | forw-search * |
\e? | back-search * |
n | repeat-search |
\en | repeat-search-all |
N | reverse-search |
\eN | reverse-search-all |
^O^N | osc8-forw-search |
^On | osc8-forw-search |
^O^P | osc8-back-search |
^Op | osc8-back-search |
^O^O | osc8-open |
& | filter |
m | set-mark |
M | set-mark-bottom |
\em | clear-mark |
' | goto-mark |
^X^X | goto-mark |
E | examine |
:e | examine |
^X^V | examine |
:n | next-file |
:p | prev-file |
t | next-tag |
T | prev-tag |
:x | index-file |
:d | remove-file |
- | toggle-option |
:t | toggle-option t |
s | toggle-option o |
## Use a long option name by starting the | |
## extra string with ONE dash; eg: | |
## s toggle-option -log-file\n | |
_ | display-option |
| | pipe |
v | visual |
! | shell |
# | pshell |
+ | firstcmd |
H | help |
h | help |
V | version |
0 | digit |
1 | digit |
2 | digit |
3 | digit |
4 | digit |
5 | digit |
6 | digit |
7 | digit |
8 | digit |
9 | digit |
q | quit |
Q | quit |
:q | quit |
:Q | quit |
ZZ | quit |
PRECEDENCE
Commands specified by lesskey take precedence over the default commands. A default command key may be disabled by including it in the input file with the action "invalid". Alternatively, a key may be defined to do nothing by using the action "noaction". "noaction" is similar to "invalid", but less will give an error beep for an "invalid" command, but not for a "noaction" command. In addition, ALL default commands may be disabled by adding this control line to the input file:LINE EDITING SECTION
The line-editing section begins with the line:EXAMPLE
The following input file describes the set of default line-editing keys used by less:#line-edit | |
\t | forw-complete |
\17 | back-complete |
\e\t | back-complete |
^L | expand |
^V | literal |
^A | literal |
\el | right |
\kr | right |
\eh | left |
\kl | left |
\eb | word-left |
\e\kl | word-left |
\ew | word-right |
\e\kr | word-right |
\ei | insert |
\ex | delete |
\kx | delete |
\eX | word-delete |
\ekx | word-delete |
\e\b | word-backspace |
\e0 | home |
\kh | home |
\e$ | end |
\ke | end |
\ek | up |
\ku | up |
\ej | down |
^G | abort |
LESS ENVIRONMENT VARIABLES
The environment variable section begins with the lineCONDITIONAL CONFIGURATION
If a line begins with #version followed by a relational operator and a version number, the remainder of the line is parsed if and only if the running version of less (or lesskey) matches the operator. This can be helpful if a lesskey file is used by different versions of less.#version >= 777 Q sideways-search
> | Greater than |
< | Less than |
>= | Greater than or equal to |
<= | Less than or equal to |
= | Equal to |
!= | Not equal to |
EXAMPLE
The following input file sets the -i and -S options when less is run and, on version 595 and higher, adds a --color option.#env
## (Note that there must be a space at the end of the next line,
## to separate the --color option from the -S option.)
LESS = -i -S
#version >= 595 LESS += --color=Hkc
SEE ALSO
less(1)WARNINGS
On MS-DOS and OS/2 systems, certain keys send a sequence of characters which start with a NUL character (0). This NUL character should be represented as \340 in a lesskey file.COPYRIGHT
Copyright (C) 1984-2024 Mark NudelmanAUTHOR
Mark NudelmanVersion 668: 06 Oct 2024 |