6 lesskey - specify key bindings for less
9 \e[1mlesskey [-o output] [--] [input]
\e[0m
10 \e[1mlesskey [--output=output] [--] [input]
\e[0m
12 \e[1mlesskey --version
\e[0m
15 \e[4mLesskey
\e[24m is used to specify a set of key bindings to be used by
\e[4mless.
\e[0m
16 The input file is a text file which describes the key bindings. If the
17 input file is "-", standard input is read. If no input file is speci-
18 fied, a standard filename is used as the name of the input file, which
19 depends on the system being used: On Unix systems, $HOME/.lesskey is
20 used; on MS-DOS systems, $HOME/_lesskey is used; and on OS/2 systems
21 $HOME/lesskey.ini is used, or $INIT/lesskey.ini if $HOME is undefined.
22 The output file is a binary file which is used by
\e[4mless.
\e[24m If no output
23 file is specified, and the environment variable LESSKEY is set, the
24 value of LESSKEY is used as the name of the output file. Otherwise, a
25 standard filename is used as the name of the output file, which depends
26 on the system being used: On Unix and OS-9 systems, $HOME/.less is
27 used; on MS-DOS systems, $HOME/_less is used; and on OS/2 systems,
28 $HOME/less.ini is used, or $INIT/less.ini if $HOME is undefined. If
29 the output file already exists,
\e[4mlesskey
\e[24m will overwrite it.
31 The -V or --version option causes
\e[4mlesskey
\e[24m to print its version number
32 and immediately exit. If -V or --version is present, other options and
33 arguments are ignored.
35 The input file consists of one or more
\e[4msections.
\e[24m Each section starts
36 with a line that identifies the type of section. Possible sections
40 Defines new command keys.
43 Defines new line-editing keys.
45 #env Defines environment variables.
47 Blank lines and lines which start with a pound sign (#) are ignored,
48 except for the special section header lines.
51 \e[1mCOMMAND SECTION
\e[0m
52 The command section begins with the line
56 If the command section is the first section in the file, this line may
57 be omitted. The command section consists of lines of the form:
59 \e[4mstring
\e[24m <whitespace>
\e[4maction
\e[24m [extra-string] <newline>
61 Whitespace is any sequence of one or more spaces and/or tabs. The
62 \e[4mstring
\e[24m is the command key(s) which invoke the action. The
\e[4mstring
\e[24m may
63 be a single command key, or a sequence of up to 15 keys. The
\e[4maction
\e[24m is
64 the name of the less action, from the list below. The characters in
65 the
\e[4mstring
\e[24m may appear literally, or be prefixed by a caret to indicate
66 a control key. A backslash followed by one to three octal digits may
67 be used to specify a character by its octal value. A backslash fol-
68 lowed by certain characters specifies input characters as follows:
98 A backslash followed by any other character indicates that character is
99 to be taken literally. Characters which must be preceded by backslash
100 include caret, space, tab and the backslash itself.
102 An action may be followed by an "extra" string. When such a command is
103 entered while running
\e[4mless,
\e[24m the action is performed, and then the extra
104 string is parsed, just as if it were typed in to
\e[4mless.
\e[24m This feature
105 can be used in certain cases to extend the functionality of a command.
106 For example, see the "{" and ":t" commands in the example below. The
107 extra string has a special meaning for the "quit" action: when
\e[4mless
\e[0m
108 quits, first character of the extra string is used as its exit status.
112 The following input file describes the set of default command keys used
146 \e\40 forw-screen-force
183 \en repeat-search-all
185 \eN reverse-search-all
228 Commands specified by
\e[4mlesskey
\e[24m take precedence over the default com-
229 mands. A default command key may be disabled by including it in the
230 input file with the action "invalid". Alternatively, a key may be
231 defined to do nothing by using the action "noaction". "noaction" is
232 similar to "invalid", but
\e[4mless
\e[24m will give an error beep for an "invalid"
233 command, but not for a "noaction" command. In addition, ALL default
234 commands may be disabled by adding this control line to the input file:
238 This will cause all default commands to be ignored. The #stop line
239 should be the last line in that section of the file.
241 Be aware that #stop can be dangerous. Since all default commands are
242 disabled, you must provide sufficient commands before the #stop line to
243 enable all necessary actions. For example, failure to provide a "quit"
244 command can lead to frustration.
247 \e[1mLINE EDITING SECTION
\e[0m
248 The line-editing section begins with the line:
252 This section specifies new key bindings for the line editing commands,
253 in a manner similar to the way key bindings for ordinary commands are
254 specified in the #command section. The line-editing section consists
255 of a list of keys and actions, one per line as in the example below.
259 The following input file describes the set of default line-editing keys
294 \e[1mLESS ENVIRONMENT VARIABLES
\e[0m
295 The environment variable section begins with the line
299 Following this line is a list of environment variable assignments.
300 Each line consists of an environment variable name, an equals sign (=)
301 and the value to be assigned to the environment variable. White space
302 before and after the equals sign is ignored. Variables assigned in
303 this way are visible only to
\e[4mless.
\e[24m If a variable is specified in the
304 system environment and also in a lesskey file, the value in the lesskey
305 file takes precedence. Although the lesskey file can be used to over-
306 ride variables set in the environment, the main purpose of assigning
307 variables in the lesskey file is simply to have all
\e[4mless
\e[24m configuration
308 information stored in one file.
312 The following input file sets the -i option whenever
\e[4mless
\e[24m is run, and
313 specifies the character set to be "latin1":
326 On MS-DOS and OS/2 systems, certain keys send a sequence of characters
327 which start with a NUL character (0). This NUL character should be
328 represented as \340 in a lesskey file.
332 Copyright (C) 2000-2011 Mark Nudelman
334 lesskey is part of the GNU project and is free software; you can redis-
335 tribute it and/or modify it under the terms of the GNU General Public
336 License as published by the Free Software Foundation; either version 2,
337 or (at your option) any later version.
339 lesskey is distributed in the hope that it will be useful, but WITHOUT
340 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
341 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
344 You should have received a copy of the GNU General Public License along
345 with lesskey; see the file COPYING. If not, write to the Free Software
346 Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
350 Mark Nudelman <markn@greenwoodsoftware.com>
351 Send bug reports or comments to the above address or to bug-
357 Version 444: 09 Jun 2011 LESSKEY(1)