Penguin
Annotated edit history of lesskey(1) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 LESSKEY
2 !!!LESSKEY
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 COMMAND SECTION
7 EXAMPLE
8 PRECEDENCE
9 LINE EDITING SECTION
10 EXAMPLE
11 LESS ENVIRONMENT VARIABLES
12 EXAMPLE
13 SEE ALSO
14 WARNINGS
15 COPYRIGHT
16 AUTHOR
17 ----
18 !!NAME
19
20
21 lesskey - specify key bindings for less
22 !!SYNOPSIS
23
24
25 __lesskey [[-o output] [[--] [[input]
26 lesskey [[--output=output] [[--] [[input]
27 lesskey -V
28 lesskey --version__
29 !!DESCRIPTION
30
31
32 ''Lesskey'' is used to specify a set of key bindings to
33 be used by ''less.'' The input file is a text file which
34 describes the key bindings, If the input file is
35 ''less.'' If no output file is specified, and the
36 environment variable LESSKEY is set, the value of LESSKEY is
37 used as the name of the output file. Otherwise, a standard
38 filename is used as the name of the output file, which
39 depends on the system being used: On Unix and OS-9 systems,
40 $HOME/.less is used; on MS-DOS systems, $HOME/_less is used;
41 and on OS/2 systems, $HOME/less.ini is used, or
42 $INIT/less.ini if $HOME is undefined. If the output file
43 already exists, ''lesskey'' will overwrite
44 it.
45
46
47 The -V or --version option causes ''lesskey'' to print
48 its version number and immediately exit. If -V or --version
49 is present, other options and arguments are
50 ignored.
51
52
53 The input file consists of one or more ''sections.'' Each
54 section starts with a line that identifies the type of
55 section. Possible sections are:
56
57
58 #command
59
60
61 Defines new command keys.
62
63
64 #line-edit
65
66
67 Defines new line-editing keys.
68
69
70 #env
71
72
73 Defines environment variables.
74
75
76 Blank lines and lines which start with a pound sign (#) are
77 ignored, except for the special section header
78 lines.
79 !!COMMAND SECTION
80
81
82 The command section begins with the line
83
84
85 #command
86
87
88 If the command section is the first section in the file,
89 this line may be omitted. The command section consists of
90 lines of the form:
91
92
93 ''string'' ''action''
94 [[extra-string] ''
95
96
97 Whitespace is any sequence of one or more spaces and/or
98 tabs. The ''string'' is the command key(s) which invoke
99 the action. The ''string'' may be a single command key,
100 or a sequence of up to 15 keys. The ''action'' is the
101 name of the less action, from the list below. The characters
102 in the ''string'' may appear literally, or be prefixed by
103 a caret to indicate a control key. A backslash followed by
104 one to three octal digits may be used to specify a character
105 by its octal value. A backslash followed by certain
106 characters specifies input characters as
107 follows:
108
109
110 b
111
112
113 BACKSPACE
114
115
116 e
117
118
119 ESCAPE
120
121
122 n
123
124
125 NEWLINE
126
127
128 r
129
130
131 RETURN
132
133
134 t
135
136
137 TAB
138
139
140 ku
141
142
143 UP ARROW
144
145
146 kd
147
148
149 DOWN ARROW
150
151
152 kr
153
154
155 RIGHT ARROW
156
157
158 kl
159
160
161 LEFT ARROW
162
163
164 kU
165
166
167 PAGE UP
168
169
170 kD
171
172
173 PAGE DOWN
174
175
176 kh
177
178
179 HOME
180
181
182 ke
183
184
185 END
186
187
188 kx
189
190
191 DELETE
192
193
194 A backslash followed by any other character indicates that
195 character is to be taken literally. Characters which must be
196 preceded by backslash include caret, space, tab and the
197 backslash itself.
198
199
200 An action may be followed by an
201 less,''
202 the action is performed, and then the extra string is
203 parsed, just as if it were typed in to ''less.'' This
204 feature can be used in certain cases to extend the
205 functionality of a command. For example, see the
206 ''less'' quits, first
207 character of the extra string is used as its exit
208 status.
209 !!EXAMPLE
210
211
212 The following input file describes the set of default
213 command keys used by less:
214
215
216 #command
217 r forw-line
218 n forw-line
219 e forw-line
220 j forw-line
221 kd forw-line
222 ^E forw-line
223 ^N forw-line
224 k back-line
225 y back-line
226 ^Y back-line
227 ^K back-line
228 ^P back-line
229 J forw-line-force
230 K back-line-force
231 Y back-line-force
232 d forw-scroll
233 ^D forw-scroll
234 u back-scroll
235 ^U back-scroll
236 40 forw-screen
237 f forw-screen
238 ^F forw-screen
239 ^V forw-screen
240 kD forw-screen
241 b back-screen
242 ^B back-screen
243 ev back-screen
244 kU back-screen
245 z forw-window
246 w back-window
247 e40 forw-screen-force
248 F forw-forever
249 R repaint-flush
250 r repaint
251 ^R repaint
252 ^L repaint
253 eu undo-hilite
254 g goto-line
255 kh goto-line
256 !!PRECEDENCE
257
258
259 Commands specified by ''lesskey'' take precedence over
260 the default commands. A default command key may be disabled
261 by including it in the input file with the action
262 ''less'' will give an error beep for an
263 ''
264
265
266 #stop
267
268
269 This will cause all default commands to be ignored. The
270 #stop line should be the last line in that section of the
271 file.
272
273
274 Be aware that #stop can be dangerous. Since all default
275 commands are disabled, you must provide sufficient commands
276 before the #stop line to enable all necessary actions. For
277 example, failure to provide a
278 !!LINE EDITING SECTION
279
280
281 The line-editing section begins with the line:
282
283
284 #line-edit
285
286
287 This section specifies new key bindings for the line editing
288 commands, in a manner similar to the way key bindings for
289 ordinary commands are specified in the #command section. The
290 line-editing section consists of a list of keys and actions,
291 one per line as in the example below.
292 !!EXAMPLE
293
294
295 The following input file describes the set of default
296 line-editing keys used by less:
297
298
299 #line-edit
300 t forw-complete
301 17 back-complete
302 et back-complete
303 ^L expand
304 ^V literal
305 ^A literal
306 el right
307 kr right
308 eh left
309 kl left
310 eb word-left
311 ekl word-left
312 ew word-right
313 ekr word-right
314 ei insert
315 ex delete
316 kx delete
317 eX word-delete
318 ekx word-delete
319 eb word-backspace
320 e0 home
321 kh home
322 e$ end
323 ke end
324 ek up
325 ku up
326 ej down
327 !!LESS ENVIRONMENT VARIABLES
328
329
330 The environment variable section begins with the
331 line
332
333
334 #env
335
336
337 Following this line is a list of environment variable
338 assignments. Each line consists of an environment variable
339 name, an equals sign (=) and the value to be assigned to the
340 environment variable. White space before and after the
341 equals sign is ignored. Variables assigned in this way are
342 visible only to ''less.'' If a variable is specified in
343 the system environment and also in a lesskey file, the value
344 in the lesskey file takes precedence. Although the lesskey
345 file can be used to override variables set in the
346 environment, the main purpose of assigning variables in the
347 lesskey file is simply to have all ''less'' configuration
348 information stored in one file.
349 !!EXAMPLE
350
351
352 The following input file sets the -i option whenever
353 ''less'' is run, and specifies the character set to be
354 ''
355
356
357 #env
358 LESS = -i
359 LESSCHARSET = latin1
360 !!SEE ALSO
361
362
363 less(1)
364 !!WARNINGS
365
366
367 It is not possible to specify special keys, such as uparrow,
368 in a keyboard-independent manner. The only way to specify
369 such keys is to specify the escape sequence which a
370 particular keyboard sends when such a keys is
371 pressed.
372
373
374 On MS-DOS and OS/2 systems, certain keys send a sequence of
375 characters which start with a NUL character (0). This NUL
376 character should be represented as 340 in a lesskey
377 file.
378 !!COPYRIGHT
379
380
381 Copyright (C) 2000 Mark Nudelman
382
383
384 lesskey is part of the GNU project and is free software; you
385 can redistribute it and/or modify it under the terms of the
386 GNU General Public License as published by the Free Software
387 Foundation; either version 2, or (at your option) any later
388 version.
389
390
391 lesskey is distributed in the hope that it will be useful,
392 but WITHOUT ANY WARRANTY; without even the implied warranty
393 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
394 the GNU General Public License for more
395 details.
396
397
398 You should have received a copy of the GNU General Public
399 License along with lesskey; see the file COPYING. If not,
400 write to the Free Software Foundation, 59 Temple Place,
401 Suite 330, Boston, MA 02111-1307, USA.
402 !!AUTHOR
403
404
405 Mark Nudelman
406 Send bug reports or comments to the above address or to
407 bug-less@gnu.org.
408 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.