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, If the input file is "-", standard input is read. If no input file is specified, a standard filename is used as the name of the input file, which depends on the system being used: On Unix systems, $HOME/.lesskey is used; on MS-DOS systems, $HOME/_lesskey is used; and on OS/2 systems $HOME/lesskey.ini is used, or $INIT/lesskey.ini if $HOME is undefined. The output file is a binary file which is used by
less. If no output file is specified, and the environment variable LESSKEY is set, the value of LESSKEY is used as the name of the output file. Otherwise, a standard filename is used as the name of the output file, which depends on the system being used: On Unix and OS-9 systems, $HOME/.less is used; on MS-DOS systems, $HOME/_less is used; and on OS/2 systems, $HOME/less.ini is used, or $INIT/less.ini if $HOME is undefined. If the output file already exists,
lesskey will overwrite it.
The -V or --version option causes lesskey to print its version number and immediately exit. If -V or --version is present, other options and arguments are ignored.
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
Defines new command keys.
#line-edit
Defines new line-editing keys.
#env
Defines environment variables.
Blank lines and lines which start with a pound sign (#) are ignored, except for the special section header lines.