home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / CMDS / less_332.lzh / less_332 / lesskey.nro < prev    next >
Text File  |  1998-03-03  |  8KB  |  300 lines

  1. .TH LESSKEY 1 "Version 332: 22 Apr 97"
  2. .SH NAME
  3. lesskey \- specify key bindings for less
  4. .SH SYNOPSIS
  5. .B "lesskey [-o output] [input]"
  6. .br
  7. .B "lesskey -V"
  8. .SH DESCRIPTION
  9. .I Lesskey
  10. is used to specify a set of key bindings to be used by 
  11. .I less.
  12. The input file is a text file which describes the key bindings,
  13. If the input file is "-", standard input is read.
  14. If no input file is specified, a standard filename is used
  15. as the name of the input file, which depends on the system being used:
  16. On Unix systems, $HOME/.lesskey is used;
  17. on MS-DOS systems, $HOME/_lesskey is used;
  18. and on OS/2 systems $HOME/lesskey.ini is used,
  19. or $INIT/lesskey.ini if $HOME is undefined.
  20. The output file is a binary file which is used by 
  21. .I less.
  22. If no output file is specified, 
  23. and the environment variable LESSKEY is set,
  24. the value of LESSKEY is used as the name of the output file.
  25. Otherwise, a standard filename is used as the name of the output file,
  26. which depends on the system being used:
  27. On Unix and OS-9 systems, $HOME/.less is used;
  28. on MS-DOS systems, $HOME/_less is used;
  29. and on OS/2 systems, $HOME/less.ini is used,
  30. or $INIT/less.ini if $HOME is undefined.
  31. If the output file already exists,
  32. .I lesskey
  33. will overwrite it.
  34. .PP
  35. The -V option causes
  36. .I lesskey
  37. to print its version number and immediately exit.  
  38. If -V is present, other options and arguments are ignored.
  39. .PP
  40. The input file consists of one or more
  41. .I sections.
  42. Each section starts with a line that identifies the type of section.
  43. Possible sections are:
  44. .IP #command
  45. Defines new command keys.
  46. .IP #line-edit
  47. Defines new line-editing keys.
  48. .IP #env
  49. Defines environment variables.
  50. .PP
  51. Blank lines and lines which start with a pound sign (#) are ignored,
  52. except for the special section header lines.
  53.  
  54. .SH "COMMAND SECTION"
  55. The command section begins with the line
  56. .sp
  57. #command
  58. .sp
  59. If the command section is the first section in the file,
  60. this line may be omitted.
  61. The command section consists of lines of the form:
  62. .sp
  63.     \fIstring\fP <whitespace> \fIaction\fP [extra-string] <newline>
  64. .sp
  65. Whitespace is any sequence of one or more spaces and/or tabs.
  66. The \fIstring\fP is the command key(s) which invoke the action.
  67. The \fIstring\fP may be a single command key, or a sequence of up to 15 keys.
  68. The \fIaction\fP is the name of the less action, from the list below.
  69. The characters in the \fIstring\fP may appear literally, or be
  70. prefixed by a caret to indicate a control key.
  71. A backslash followed by one to three octal digits may be used to
  72. specify a character by its octal value.
  73. A backslash followed by b, e, n, r or t specifies
  74. BACKSPACE, ESCAPE, NEWLINE, RETURN or TAB, respectively.
  75. A backslash followed by any other character indicates that character is
  76. to be taken literally.
  77. Characters which must be preceded by backslash include
  78. caret, space, tab and the backslash itself.
  79. .PP
  80. An action may be followed by an "extra" string.
  81. When such a command is entered while running
  82. .I less,
  83. the action is performed, and then the extra
  84. string is parsed, just as if it were typed in to
  85. .I less.
  86. This feature can be used in certain cases to extend
  87. the functionality of a command.
  88. For example, see the "{" and ":t" commands in the example below.
  89. The extra string has a special meaning for the "quit" action:
  90. when
  91. .I less
  92. quits, first character of the extra string is used as its exit status.
  93.  
  94. .SH EXAMPLE
  95. The following input file describes the set of
  96. default command keys used by less:
  97. .sp
  98. .nf
  99.     #command
  100.     \er        forw-line 
  101.     \en        forw-line 
  102.     e        forw-line 
  103.     j        forw-line 
  104.     ^E        forw-line 
  105.     ^N        forw-line 
  106.     k        back-line 
  107.     y        back-line 
  108.     ^Y        back-line 
  109.     ^K        back-line 
  110.     ^P        back-line 
  111.     J        forw-line-force 
  112.     K        back-line-force 
  113.     Y        back-line-force 
  114.     d        forw-scroll 
  115.     ^D        forw-scroll 
  116.     u        back-scroll 
  117.     ^U        back-scroll 
  118.     \e40        forw-screen 
  119.     f        forw-screen 
  120.     ^F        forw-screen 
  121.     ^V        forw-screen 
  122.     b        back-screen 
  123.     ^B        back-screen 
  124.     \eev        back-screen 
  125.     \ee\e40        forw-screen-force
  126.     z        forw-window 
  127.     w        back-window 
  128.     F        forw-forever 
  129.     \ee[        left-scroll
  130.     \ee]        right-scroll
  131.     R        repaint-flush 
  132.     r        repaint 
  133.     ^R        repaint 
  134.     ^L        repaint 
  135.     g        goto-line 
  136.     <        goto-line 
  137.     \ee<        goto-line 
  138.     p        percent 
  139.     %        percent 
  140.     {        forw-bracket {}
  141.     }        back-bracket {}
  142.     (        forw-bracket ()
  143.     )        back-bracket ()
  144.     [        forw-bracket []
  145.     ]        back-bracket []
  146.     \ee^F        forw-bracket 
  147.     \ee^B        back-bracket 
  148.     G        goto-end 
  149.     \ee>        goto-end 
  150.     >        goto-end 
  151.     =        status 
  152.     ^G        status 
  153.     :f        status 
  154.     /        forw-search 
  155.     ?        back-search 
  156.     \ee/        forw-search *
  157.     \ee?        back-search *
  158.     n        repeat-search 
  159.     \een        repeat-search-all 
  160.     N        reverse-search 
  161.     \eeN        reverse-search-all 
  162.     \eeu        undo-hilite
  163.     m        set-mark 
  164.     '        goto-mark 
  165.     ^X^X        goto-mark 
  166.     E        examine 
  167.     :e        examine 
  168.     ^X^V        examine 
  169.     :n        next-file 
  170.     :p        prev-file 
  171.     :x        index-file 
  172.     -        toggle-option 
  173.     :t        toggle-option t
  174.     s        toggle-option o
  175.     _        display-option 
  176.     |        pipe 
  177.     v        visual 
  178.     !        shell 
  179.     +        firstcmd 
  180.     H        help 
  181.     h        help 
  182.     V        version 
  183.     q        quit 
  184.     :q        quit 
  185.     :Q        quit 
  186.     ZZ        quit 
  187. .fi
  188. .sp
  189. .SH PRECEDENCE
  190. Commands specified by
  191. .I lesskey
  192. take precedence over the default commands.
  193. A default command key may be disabled by including it in the
  194. input file with the action "invalid".
  195. Alternatively, a key may be defined 
  196. to do nothing by using the action "noaction".
  197. "noaction" is similar to "invalid", but 
  198. .I less
  199. will give an error beep for an "invalid" command, 
  200. but not for a "noaction" command.
  201. In addition, ALL default commands may be disabled by 
  202. adding this control line to the input file:
  203. .sp
  204. #stop
  205. .sp
  206. This will cause all default commands to be ignored.
  207. The #stop line should be the last line in that section of the file.
  208. .PP
  209. Be aware that #stop can be dangerous.  
  210. Since all default commands are disabled, 
  211. you must provide sufficient commands before the #stop line
  212. to enable all necessary actions.
  213. For example, failure to provide a "quit" command can lead to frustration.
  214.  
  215. .SH "LINE EDITING SECTION"
  216. The line-editing section begins with the line:
  217. .sp
  218. #line-edit
  219. .sp
  220. This section specifies new key bindings for the line editing commands,
  221. in a manner similar to the way key bindings for 
  222. ordinary commands are specified in the #command section.
  223. The line-editing section consists of a list of keys and actions,
  224. one per line as in the example below.
  225.  
  226. .SH EXAMPLE
  227. The following input file describes the set of
  228. default line-editing keys used by less:
  229. .sp
  230. .nf
  231.     #line-edit
  232.     \et            forw-complete
  233.     \e17        back-complete
  234.     \ee\et        back-complete
  235.     \e14        expand
  236.     ^V        literal
  237.     ^A        literal
  238.        \eel        right
  239.     \eeh        left
  240.     \eeb        word-left
  241.     \eew        word-right
  242.     \eei        insert
  243.     \eex        delete
  244.     \ee\eb        word-backspace
  245.     \ee0        home
  246.     \ee$        end
  247.     \eek        up
  248.     \eej        down
  249. .fi
  250. .sp
  251.  
  252. .SH "LESS ENVIRONMENT VARIABLES"
  253. The environment variable section begins with the line
  254. .sp
  255. #env
  256. .sp
  257. Following this line is a list of environment variable assignments.
  258. Each line consists of an environment variable name, an equals sign (=)
  259. and the value to be assigned to the environment variable.
  260. White space before and after the equals sign is ignored.
  261. Variables assigned in this way are visible only to
  262. .I less.
  263. If a variable is specified in the system environment and also in a
  264. lesskey file, the value in the lesskey file takes precedence.
  265. Although the lesskey file can be used to override variables set in the
  266. environment, the main purpose of assigning variables in the lesskey file
  267. is simply to have all 
  268. .I less
  269. configuration information stored in one file.
  270.  
  271. .SH EXAMPLE
  272. The following input file sets the -i option whenever 
  273. .I less
  274. is run, and specifies the character set to be "latin1":
  275. .sp
  276. .nf
  277.     #env
  278.     LESS = -i
  279.     LESSCHARSET = latin1
  280. .fi
  281. .sp
  282.  
  283. .SH "SEE ALSO"
  284. less(1)
  285.  
  286. .SH WARNINGS
  287. It is not possible to specify special keys, such as uparrow, 
  288. in a keyboard-independent manner.
  289. The only way to specify such keys is to specify the escape sequence
  290. which a particular keyboard sends when such a keys is pressed.
  291. .PP
  292. On MS-DOS and OS/2 systems, certain keys send a sequence of characters
  293. which start with a NUL character (0).
  294. This NUL character should be represented as \e340 in a lesskey file.
  295.  
  296. .SH COPYRIGHT
  297. Copyright (c) 1984,1985,1989,1994,1995  Mark Nudelman
  298. .br
  299. Comments to: markn@fog.net
  300.