lesskey.man revision 63128
1 2 3 4LESSKEY(1) LESSKEY(1) 5 6 7NNAAMMEE 8 lesskey - specify key bindings for less 9 10SSYYNNOOPPSSIISS 11 lleesssskkeeyy [[--oo oouuttppuutt]] [[----]] [[iinnppuutt]] 12 lleesssskkeeyy [[----oouuttppuutt==oouuttppuutt]] [[----]] [[iinnppuutt]] 13 lleesssskkeeyy --VV 14 lleesssskkeeyy ----vveerrssiioonn 15 16DDEESSCCRRIIPPTTIIOONN 17 _L_e_s_s_k_e_y is used to specify a set of key bindings to be 18 used by _l_e_s_s_. The input file is a text file which 19 describes the key bindings, If the input file is "-", 20 standard input is read. If no input file is specified, a 21 standard filename is used as the name of the input file, 22 which depends on the system being used: On Unix systems, 23 $HOME/.lesskey is used; on MS-DOS systems, $HOME/_lesskey 24 is used; and on OS/2 systems $HOME/lesskey.ini is used, or 25 $INIT/lesskey.ini if $HOME is undefined. The output file 26 is a binary file which is used by _l_e_s_s_. If no output file 27 is specified, and the environment variable LESSKEY is set, 28 the value of LESSKEY is used as the name of the output 29 file. Otherwise, a standard filename is used as the name 30 of the output file, which depends on the system being 31 used: On Unix and OS-9 systems, $HOME/.less is used; on 32 MS-DOS systems, $HOME/_less is used; and on OS/2 systems, 33 $HOME/less.ini is used, or $INIT/less.ini if $HOME is 34 undefined. If the output file already exists, _l_e_s_s_k_e_y 35 will overwrite it. 36 37 The -V or --version option causes _l_e_s_s_k_e_y to print its 38 version number and immediately exit. If -V or --version 39 is present, other options and arguments are ignored. 40 41 The input file consists of one or more _s_e_c_t_i_o_n_s_. Each 42 section starts with a line that identifies the type of 43 section. Possible sections are: 44 45 #command 46 Defines new command keys. 47 48 #line-edit 49 Defines new line-editing keys. 50 51 #env Defines environment variables. 52 53 Blank lines and lines which start with a pound sign (#) 54 are ignored, except for the special section header lines. 55 56 57CCOOMMMMAANNDD SSEECCTTIIOONN 58 The command section begins with the line 59 60 #command 61 62 63 64 Version 358: 08 Jul 2000 1 65 66 67 68 69 70LESSKEY(1) LESSKEY(1) 71 72 73 If the command section is the first section in the file, 74 this line may be omitted. The command section consists of 75 lines of the form: 76 77 _s_t_r_i_n_g <whitespace> _a_c_t_i_o_n [extra-string] <newline> 78 79 Whitespace is any sequence of one or more spaces and/or 80 tabs. The _s_t_r_i_n_g is the command key(s) which invoke the 81 action. The _s_t_r_i_n_g may be a single command key, or a 82 sequence of up to 15 keys. The _a_c_t_i_o_n is the name of the 83 less action, from the list below. The characters in the 84 _s_t_r_i_n_g may appear literally, or be prefixed by a caret to 85 indicate a control key. A backslash followed by one to 86 three octal digits may be used to specify a character by 87 its octal value. A backslash followed by certain charac- 88 ters specifies input characters as follows: 89 90 \b BACKSPACE 91 92 \e ESCAPE 93 94 \n NEWLINE 95 96 \r RETURN 97 98 \t TAB 99 100 \ku UP ARROW 101 102 \kd DOWN ARROW 103 104 \kr RIGHT ARROW 105 106 \kl LEFT ARROW 107 108 \kU PAGE UP 109 110 \kD PAGE DOWN 111 112 \kh HOME 113 114 \ke END 115 116 \kx DELETE 117 118 A backslash followed by any other character indicates that 119 character is to be taken literally. Characters which must 120 be preceded by backslash include caret, space, tab and the 121 backslash itself. 122 123 An action may be followed by an "extra" string. When such 124 a command is entered while running _l_e_s_s_, the action is 125 performed, and then the extra string is parsed, just as if 126 it were typed in to _l_e_s_s_. This feature can be used in 127 128 129 130 Version 358: 08 Jul 2000 2 131 132 133 134 135 136LESSKEY(1) LESSKEY(1) 137 138 139 certain cases to extend the functionality of a command. 140 For example, see the "{" and ":t" commands in the example 141 below. The extra string has a special meaning for the 142 "quit" action: when _l_e_s_s quits, first character of the 143 extra string is used as its exit status. 144 145 146EEXXAAMMPPLLEE 147 The following input file describes the set of default com- 148 mand keys used by less: 149 150 #command 151 \r forw-line 152 \n forw-line 153 e forw-line 154 j forw-line 155 \kd forw-line 156 ^E forw-line 157 ^N forw-line 158 k back-line 159 y back-line 160 ^Y back-line 161 ^K back-line 162 ^P back-line 163 J forw-line-force 164 K back-line-force 165 Y back-line-force 166 d forw-scroll 167 ^D forw-scroll 168 u back-scroll 169 ^U back-scroll 170 \40 forw-screen 171 f forw-screen 172 ^F forw-screen 173 ^V forw-screen 174 \kD forw-screen 175 b back-screen 176 ^B back-screen 177 \ev back-screen 178 \kU back-screen 179 z forw-window 180 w back-window 181 \e\40 forw-screen-force 182 F forw-forever 183 R repaint-flush 184 r repaint 185 ^R repaint 186 ^L repaint 187 \eu undo-hilite 188 g goto-line 189 < goto-line 190 \e< goto-line 191 p percent 192 % percent 193 194 195 196 Version 358: 08 Jul 2000 3 197 198 199 200 201 202LESSKEY(1) LESSKEY(1) 203 204 205 \e[ left-scroll 206 \e] right-scroll 207 \e( left-scroll 208 \e) right-scroll 209 { forw-bracket {} 210 } back-bracket {} 211 ( forw-bracket () 212 ) back-bracket () 213 [ forw-bracket [] 214 ] back-bracket [] 215 \e^F forw-bracket 216 \e^B back-bracket 217 G goto-end 218 \e> goto-end 219 > goto-end 220 = status 221 ^G status 222 :f status 223 / forw-search 224 ? back-search 225 \e/ forw-search * 226 \e? back-search * 227 n repeat-search 228 \en repeat-search-all 229 N reverse-search 230 \eN reverse-search-all 231 m set-mark 232 ' goto-mark 233 ^X^X goto-mark 234 E examine 235 :e examine 236 ^X^V examine 237 :n next-file 238 :p prev-file 239 :x index-file 240 - toggle-option 241 :t toggle-option t 242 s toggle-option o 243 _ display-option 244 | pipe 245 v visual 246 ! shell 247 + firstcmd 248 H help 249 h help 250 V version 251 0 digit 252 1 digit 253 2 digit 254 3 digit 255 4 digit 256 5 digit 257 6 digit 258 7 digit 259 260 261 262 Version 358: 08 Jul 2000 4 263 264 265 266 267 268LESSKEY(1) LESSKEY(1) 269 270 271 8 digit 272 9 digit 273 q quit 274 Q quit 275 :q quit 276 :Q quit 277 ZZ quit 278 279 280PPRREECCEEDDEENNCCEE 281 Commands specified by _l_e_s_s_k_e_y take precedence over the 282 default commands. A default command key may be disabled 283 by including it in the input file with the action 284 "invalid". Alternatively, a key may be defined to do 285 nothing by using the action "noaction". "noaction" is 286 similar to "invalid", but _l_e_s_s will give an error beep for 287 an "invalid" command, but not for a "noaction" command. 288 In addition, ALL default commands may be disabled by 289 adding this control line to the input file: 290 291 #stop 292 293 This will cause all default commands to be ignored. The 294 #stop line should be the last line in that section of the 295 file. 296 297 Be aware that #stop can be dangerous. Since all default 298 commands are disabled, you must provide sufficient com- 299 mands before the #stop line to enable all necessary 300 actions. For example, failure to provide a "quit" command 301 can lead to frustration. 302 303 304LLIINNEE EEDDIITTIINNGG SSEECCTTIIOONN 305 The line-editing section begins with the line: 306 307 #line-edit 308 309 This section specifies new key bindings for the line edit- 310 ing commands, in a manner similar to the way key bindings 311 for ordinary commands are specified in the #command sec- 312 tion. The line-editing section consists of a list of keys 313 and actions, one per line as in the example below. 314 315 316EEXXAAMMPPLLEE 317 The following input file describes the set of default 318 line-editing keys used by less: 319 320 #line-edit 321 \t forw-complete 322 \17 back-complete 323 \e\t back-complete 324 ^L expand 325 326 327 328 Version 358: 08 Jul 2000 5 329 330 331 332 333 334LESSKEY(1) LESSKEY(1) 335 336 337 ^V literal 338 ^A literal 339 \el right 340 \kr right 341 \eh left 342 \kl left 343 \eb word-left 344 \e\kl word-left 345 \ew word-right 346 \e\kr word-right 347 \ei insert 348 \ex delete 349 \kx delete 350 \eX word-delete 351 \ekx word-delete 352 \e\b word-backspace 353 \e0 home 354 \kh home 355 \e$ end 356 \ke end 357 \ek up 358 \ku up 359 \ej down 360 361 362 363LLEESSSS EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS 364 The environment variable section begins with the line 365 366 #env 367 368 Following this line is a list of environment variable 369 assignments. Each line consists of an environment vari- 370 able name, an equals sign (=) and the value to be assigned 371 to the environment variable. White space before and after 372 the equals sign is ignored. Variables assigned in this 373 way are visible only to _l_e_s_s_. If a variable is specified 374 in the system environment and also in a lesskey file, the 375 value in the lesskey file takes precedence. Although the 376 lesskey file can be used to override variables set in the 377 environment, the main purpose of assigning variables in 378 the lesskey file is simply to have all _l_e_s_s configuration 379 information stored in one file. 380 381 382EEXXAAMMPPLLEE 383 The following input file sets the -i option whenever _l_e_s_s 384 is run, and specifies the character set to be "latin1": 385 386 #env 387 LESS = -i 388 LESSCHARSET = latin1 389 390 391 392 393 394 Version 358: 08 Jul 2000 6 395 396 397 398 399 400LESSKEY(1) LESSKEY(1) 401 402 403SSEEEE AALLSSOO 404 less(1) 405 406 407WWAARRNNIINNGGSS 408 It is not possible to specify special keys, such as upar- 409 row, in a keyboard-independent manner. The only way to 410 specify such keys is to specify the escape sequence which 411 a particular keyboard sends when such a keys is pressed. 412 413 On MS-DOS and OS/2 systems, certain keys send a sequence 414 of characters which start with a NUL character (0). This 415 NUL character should be represented as \340 in a lesskey 416 file. 417 418 419CCOOPPYYRRIIGGHHTT 420 Copyright (C) 2000 Mark Nudelman 421 422 lesskey is part of the GNU project and is free software; 423 you can redistribute it and/or modify it under the terms 424 of the GNU General Public License as published by the Free 425 Software Foundation; either version 2, or (at your option) 426 any later version. 427 428 lesskey is distributed in the hope that it will be useful, 429 but WITHOUT ANY WARRANTY; without even the implied war- 430 ranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR- 431 POSE. See the GNU General Public License for more 432 details. 433 434 You should have received a copy of the GNU General Public 435 License along with lesskey; see the file COPYING. If not, 436 write to the Free Software Foundation, 59 Temple Place, 437 Suite 330, Boston, MA 02111-1307, USA. 438 439 440AAUUTTHHOORR 441 Mark Nudelman <marknu@flash.net> 442 Send bug reports or comments to the above address or to 443 bug-less@gnu.org. 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 Version 358: 08 Jul 2000 7 461 462 463