version 1.12, 2014/11/23 08:01:06 |
version 1.13, 2015/11/05 22:08:44 |
|
|
.Nd specify key bindings for less |
.Nd specify key bindings for less |
.Sh SYNOPSIS |
.Sh SYNOPSIS |
.Nm lesskey |
.Nm lesskey |
.Op Fl o Ar output | Fl -output Ns = Ns Ar output |
.Oo Fl o Ar output |
|
.Pf " | " Fl -output Ns = Ns Ar output Oc |
.Op Ar input |
.Op Ar input |
.Nm lesskey |
.Nm lesskey |
.Fl V | -version |
.Fl V | -version |
|
|
Defines environment variables. |
Defines environment variables. |
.El |
.El |
.Pp |
.Pp |
Blank lines and lines which start with a pound sign |
Blank lines and lines which start with a pound sign (#) are ignored, |
.Pq Sq # |
|
are ignored, |
|
except for the special section header lines. |
except for the special section header lines. |
.Sh COMMAND SECTION |
.Sh COMMAND SECTION |
The command section begins with the line |
The command section begins with the line |
|
|
Characters which must be preceded by backslash include |
Characters which must be preceded by backslash include |
caret, space, tab and the backslash itself. |
caret, space, tab and the backslash itself. |
.Pp |
.Pp |
An action may be followed by an additional string. |
An action may be followed by an |
|
.Qq extra |
|
string. |
When such a command is entered while running less, |
When such a command is entered while running less, |
the action is performed, and then the extra |
the action is performed, and then the extra |
string is parsed, just as if it were typed into less. |
string is parsed, just as if it were typed in to less. |
This feature can be used in certain cases to extend |
This feature can be used in certain cases to extend |
the functionality of a command. |
the functionality of a command. |
For example, see the |
For example, see the |
.Cm { |
.Sq { |
and |
and |
.Cm :t |
.Sq :t |
commands in the example below. |
commands in the example below. |
The extra string has a special meaning for the |
The extra string has a special meaning for the |
.Cm quit |
.Qq quit |
action: |
action: |
when less quits, |
when less quits, |
the first character of the extra string is used as its exit status. |
first character of the extra string is used as its exit status. |
.Pp |
.Pp |
The following input file describes the set of |
The following input file describes the set of |
default command keys used by less: |
default command keys used by less: |
|
|
take precedence over the default commands. |
take precedence over the default commands. |
A default command key may be disabled by including it in the |
A default command key may be disabled by including it in the |
input file with the action |
input file with the action |
.Cm invalid . |
.Qq invalid . |
Alternatively, a key may be defined |
Alternatively, a key may be defined |
to do nothing by using the action |
to do nothing by using the action |
.Cm noaction . |
.Qq noaction . |
.Cm noaction |
.Qq noaction |
is similar to |
is similar to |
.Cm invalid , |
.Qq invalid , |
but less will give an error beep for an |
but less will give an error beep for an |
.Cm invalid |
.Qq invalid |
command, but not for a |
command, but not for a |
.Cm noaction |
.Qq noaction |
command. |
command. |
In addition, all default commands may be disabled by |
In addition, ALL default commands may be disabled by |
adding this control line to the input file: |
adding this control line to the input file: |
.Pp |
.Pp |
.Dl #stop |
.Dl #stop |
.Pp |
.Pp |
This will cause all default commands to be ignored. |
This will cause all default commands to be ignored. |
The |
The #stop line should be the last line in that section of the file. |
.Cm #stop |
|
line should be the last line in that section of the file. |
|
.Pp |
.Pp |
Be aware that |
Be aware that #stop can be dangerous. |
.Cm #stop |
|
can be dangerous. |
|
Since all default commands are disabled, you must provide sufficient |
Since all default commands are disabled, you must provide sufficient |
commands before the |
commands before the #stop line to enable all necessary actions. |
.Cm #stop |
|
line to enable all necessary actions. |
|
For example, failure to provide a |
For example, failure to provide a |
.Cm quit |
.Qq quit |
command can lead to frustration. |
command can lead to frustration. |
.Sh LINE EDITING SECTION |
.Sh LINE EDITING SECTION |
The line-editing section begins with the line: |
The line-editing section begins with the line: |
|
|
environment, the main purpose of assigning variables in the lesskey file |
environment, the main purpose of assigning variables in the lesskey file |
is simply to have all less configuration information stored in one file. |
is simply to have all less configuration information stored in one file. |
.Pp |
.Pp |
The following input file sets the |
The following input file sets the -i option whenever less is run, |
.Fl i |
|
option whenever less is run, |
|
and specifies the character set to be |
and specifies the character set to be |
.Cm latin1 : |
.Qq latin1 : |
.Bd -literal -offset indent |
.Bd -literal -offset indent |
#env |
#env |
LESS = -i |
LESS = -i |
|
|
.El |
.El |
.Sh FILES |
.Sh FILES |
.Bl -tag -width "$HOME/.lesskey" -compact |
.Bl -tag -width "$HOME/.lesskey" -compact |
.It Pa $HOME/.less |
.It $HOME/.less |
Default |
Default |
.Nm |
.Nm |
file. |
file. |
.It Pa $HOME/.lesskey |
.It $HOME/.lesskey |
Default |
Default |
.Nm |
.Nm |
input file. |
input file. |
.It Pa /etc/sysless |
.It /etc/sysless |
Default system-wide |
Default system-wide |
.Nm |
.Nm |
file. |
file. |
|
|
.An Mark Nudelman |
.An Mark Nudelman |
.Pp |
.Pp |
Send bug reports or comments to |
Send bug reports or comments to |
.Aq Mt bug-less@gnu.org . |
.Aq Mt bug\-less@gnu.org . |
.\" .Sh CAVEATS |
.\" .Sh CAVEATS |
.\" On MS-DOS and OS/2 systems, certain keys send a sequence of characters |
.\" On MS-DOS and OS/2 systems, certain keys send a sequence of characters |
.\" which start with a NUL character (0). |
.\" which start with a NUL character (0). |