-.\" $OpenBSD: lesskey.1,v 1.16 2019/06/02 06:53:11 bentley Exp $
+.\" $OpenBSD: lesskey.1,v 1.17 2021/12/07 13:26:49 schwarze Exp $
.\"
.\" Copyright (C) 2000-2012 Mark Nudelman
.\"
.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-.Dd $Mdocdate: June 2 2019 $
+.Dd $Mdocdate: December 7 2021 $
.Dt LESSKEY 1
.Os
.Sh NAME
.Pp
If the command section is the first section in the file,
this line may be omitted.
+.Pp
The command section consists of lines of the form:
.Bd -filled -offset indent
-.Ar string
-.Aq whitespace
+.Ar keys
.Ar action
-.Bq extra-string
-.Aq newline
+.Op Ar extra
.Ed
.Pp
-Whitespace is any sequence of one or more spaces and/or tabs.
-The
-.Ar string
-is the command key(s) which invoke the action.
-The
-.Ar string
-may be a single command key, or a sequence of up to 15 keys.
+The three fields are separated by whitespace
+consisting of one or more spaces and/or tabs.
+.Pp
The
+.Ar keys
+string consists of at least one and at most 15 keys.
+By typing it in
+.Xr less 1 ,
+the
.Ar action
-is the name of the less action, from the list below.
-The characters in the
-.Ar string
-may appear literally, or be prefixed by a caret to indicate a control key.
-A backslash followed by one to three octal digits may be used to
-specify a character by its octal value.
-A backslash followed by certain characters specifies input
-characters as follows:
+is invoked.
+The list of default key bindings given below
+also serves as a list of supported actions.
+.Pp
+Each of the
+.Ar keys
+can be specified in these forms:
+.Bl -bullet -offset indent
+.It
+a literal character
+.It
+a character prefixed by a caret to indicate a control key
+.It
+a backslash followed by one to three octal digits
+to specify a key by its octal value
+.It
+a backslash followed by certain characters
+to specify input characters as follows:
.Pp
.Bl -tag -width Ds -offset indent -compact
.It \eb
.It \ekx
DELETE
.El
-.Pp
-A backslash followed by any other character indicates that character is
-to be taken literally.
+.It
+a backslash followed by any other character
+to indicate that character is to be taken literally.
Characters which must be preceded by backslash include
-caret, space, tab and the backslash itself.
+caret, space, tab, and the backslash itself.
+.El
.Pp
An action may be followed by an
-.Qq extra
+.Ar extra
string.
-When such a command is entered while running less,
-the action is performed, and then the extra
-string is parsed, just as if it were typed in to less.
+It is parsed, just as if it were typed into
+.Xr less 1 ,
+after performing the
+.Ar action .
This feature can be used in certain cases to extend
the functionality of a command.
For example, see the
.Sq {
and
.Sq :t
-commands in the example below.
-The extra string has a special meaning for the
+keys in the list of default bindings below.
+.Pp
+The
+.Ar extra
+string has a special meaning for the
.Qq quit
action:
-when less quits,
-first character of the extra string is used as its exit status.
+when
+.Xr less 1
+quits,
+first character of the
+.Ar extra
+string is used as its exit status.
.Pp
The following input file describes the set of
-default command keys used by less:
+default command keys used by
+.Xr less 1 :
.Bd -literal -offset indent
#command
\er forw-line
_ display-option
| pipe
v visual
-! shell
+ firstcmd
H help
h help