lesskey.man revision 128345
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 381: 17 Jan 2003 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 381: 17 Jan 2003 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 \kh goto-line 190 < goto-line 191 \e< goto-line 192 p percent 193 194 195 196 Version 381: 17 Jan 2003 3 197 198 199 200 201 202LESSKEY(1) LESSKEY(1) 203 204 205 % percent 206 \e[ left-scroll 207 \e] right-scroll 208 \e( left-scroll 209 \e) right-scroll 210 { forw-bracket {} 211 } back-bracket {} 212 ( forw-bracket () 213 ) back-bracket () 214 [ forw-bracket [] 215 ] back-bracket [] 216 \e^F forw-bracket 217 \e^B back-bracket 218 G goto-end 219 \e> goto-end 220 > goto-end 221 \ke goto-end 222 = status 223 ^G status 224 :f status 225 / forw-search 226 ? back-search 227 \e/ forw-search * 228 \e? back-search * 229 n repeat-search 230 \en repeat-search-all 231 N reverse-search 232 \eN reverse-search-all 233 m set-mark 234 ' goto-mark 235 ^X^X goto-mark 236 E examine 237 :e examine 238 ^X^V examine 239 :n next-file 240 :p prev-file 241 t next-tag 242 T prev-tag 243 :x index-file 244 :d remove-file 245 - toggle-option 246 :t toggle-option t 247 s toggle-option o 248 _ display-option 249 | pipe 250 v visual 251 ! shell 252 + firstcmd 253 H help 254 h help 255 V version 256 0 digit 257 1 digit 258 2 digit 259 260 261 262 Version 381: 17 Jan 2003 4 263 264 265 266 267 268LESSKEY(1) LESSKEY(1) 269 270 271 3 digit 272 4 digit 273 5 digit 274 6 digit 275 7 digit 276 8 digit 277 9 digit 278 q quit 279 Q quit 280 :q quit 281 :Q quit 282 ZZ quit 283 284 285PPRREECCEEDDEENNCCEE 286 Commands specified by _l_e_s_s_k_e_y take precedence over the 287 default commands. A default command key may be disabled 288 by including it in the input file with the action 289 "invalid". Alternatively, a key may be defined to do 290 nothing by using the action "noaction". "noaction" is 291 similar to "invalid", but _l_e_s_s will give an error beep for 292 an "invalid" command, but not for a "noaction" command. 293 In addition, ALL default commands may be disabled by 294 adding this control line to the input file: 295 296 #stop 297 298 This will cause all default commands to be ignored. The 299 #stop line should be the last line in that section of the 300 file. 301 302 Be aware that #stop can be dangerous. Since all default 303 commands are disabled, you must provide sufficient com� 304 mands before the #stop line to enable all necessary 305 actions. For example, failure to provide a "quit" command 306 can lead to frustration. 307 308 309LLIINNEE EEDDIITTIINNGG SSEECCTTIIOONN 310 The line-editing section begins with the line: 311 312 #line-edit 313 314 This section specifies new key bindings for the line edit� 315 ing commands, in a manner similar to the way key bindings 316 for ordinary commands are specified in the #command sec� 317 tion. The line-editing section consists of a list of keys 318 and actions, one per line as in the example below. 319 320 321EEXXAAMMPPLLEE 322 The following input file describes the set of default 323 line-editing keys used by less: 324 325 326 327 328 Version 381: 17 Jan 2003 5 329 330 331 332 333 334LESSKEY(1) LESSKEY(1) 335 336 337 #line-edit 338 \t forw-complete 339 \17 back-complete 340 \e\t back-complete 341 ^L expand 342 ^V literal 343 ^A literal 344 \el right 345 \kr right 346 \eh left 347 \kl left 348 \eb word-left 349 \e\kl word-left 350 \ew word-right 351 \e\kr word-right 352 \ei insert 353 \ex delete 354 \kx delete 355 \eX word-delete 356 \ekx word-delete 357 \e\b word-backspace 358 \e0 home 359 \kh home 360 \e$ end 361 \ke end 362 \ek up 363 \ku up 364 \ej down 365 366 367 368LLEESSSS EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS 369 The environment variable section begins with the line 370 371 #env 372 373 Following this line is a list of environment variable 374 assignments. Each line consists of an environment vari� 375 able name, an equals sign (=) and the value to be assigned 376 to the environment variable. White space before and after 377 the equals sign is ignored. Variables assigned in this 378 way are visible only to _l_e_s_s_. If a variable is specified 379 in the system environment and also in a lesskey file, the 380 value in the lesskey file takes precedence. Although the 381 lesskey file can be used to override variables set in the 382 environment, the main purpose of assigning variables in 383 the lesskey file is simply to have all _l_e_s_s configuration 384 information stored in one file. 385 386 387EEXXAAMMPPLLEE 388 The following input file sets the -i option whenever _l_e_s_s 389 is run, and specifies the character set to be "latin1": 390 391 392 393 394 Version 381: 17 Jan 2003 6 395 396 397 398 399 400LESSKEY(1) LESSKEY(1) 401 402 403 #env 404 LESS = -i 405 LESSCHARSET = latin1 406 407 408 409SSEEEE AALLSSOO 410 less(1) 411 412 413WWAARRNNIINNGGSS 414 It is not possible to specify special keys, such as upar� 415 row, in a keyboard-independent manner. The only way to 416 specify such keys is to specify the escape sequence which 417 a particular keyboard sends when such a key is pressed. 418 419 On MS-DOS and OS/2 systems, certain keys send a sequence 420 of characters which start with a NUL character (0). This 421 NUL character should be represented as \340 in a lesskey 422 file. 423 424 425CCOOPPYYRRIIGGHHTT 426 Copyright (C) 2000 Mark Nudelman 427 428 lesskey is part of the GNU project and is free software; 429 you can redistribute it and/or modify it under the terms 430 of the GNU General Public License as published by the Free 431 Software Foundation; either version 2, or (at your option) 432 any later version. 433 434 lesskey is distributed in the hope that it will be useful, 435 but WITHOUT ANY WARRANTY; without even the implied war� 436 ranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR� 437 POSE. See the GNU General Public License for more 438 details. 439 440 You should have received a copy of the GNU General Public 441 License along with lesskey; see the file COPYING. If not, 442 write to the Free Software Foundation, 59 Temple Place, 443 Suite 330, Boston, MA 02111-1307, USA. 444 445 446AAUUTTHHOORR 447 Mark Nudelman <markn@greenwoodsoftware.com> 448 Send bug reports or comments to the above address or to 449 bug-less@gnu.org. 450 451 452 453 454 455 456 457 458 459 460 Version 381: 17 Jan 2003 7 461 462 463