]> www.wagner.pp.ru Git - oss/less.git/blob - lesskey.man
Removed code page operation. Fix GLOB macros for 64-bit win32. Fixed debug flags...
[oss/less.git] / lesskey.man
1 LESSKEY(1)                  General Commands Manual                 LESSKEY(1)
2
3
4
5 \e[1mNAME\e[0m
6        lesskey - specify key bindings for less
7
8 \e[1mSYNOPSIS\e[0m
9        \e[1mlesskey [-o output] [--] [input]\e[0m
10        \e[1mlesskey [--output=output] [--] [input]\e[0m
11        \e[1mlesskey -V\e[0m
12        \e[1mlesskey --version\e[0m
13
14 \e[1mDESCRIPTION\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.
30
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.
34
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
37        are:
38
39        #command
40               Defines new command keys.
41
42        #line-edit
43               Defines new line-editing keys.
44
45        #env   Defines environment variables.
46
47        Blank  lines  and  lines which start with a pound sign (#) are ignored,
48        except for the special section header lines.
49
50
51 \e[1mCOMMAND SECTION\e[0m
52        The command section begins with the line
53
54        #command
55
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:
58
59             \e[4mstring\e[24m <whitespace> \e[4maction\e[24m [extra-string] <newline>
60
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:
69
70        \b     BACKSPACE
71
72        \e     ESCAPE
73
74        \n     NEWLINE
75
76        \r     RETURN
77
78        \t     TAB
79
80        \ku    UP ARROW
81
82        \kd    DOWN ARROW
83
84        \kr    RIGHT ARROW
85
86        \kl    LEFT ARROW
87
88        \kU    PAGE UP
89
90        \kD    PAGE DOWN
91
92        \kh    HOME
93
94        \ke    END
95
96        \kx    DELETE
97
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.
101
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.
109
110
111 \e[1mEXAMPLE\e[0m
112        The following input file describes the set of default command keys used
113        by less:
114
115             #command
116             \r        forw-line
117             \n        forw-line
118             e         forw-line
119             j         forw-line
120             \kd  forw-line
121             ^E        forw-line
122             ^N        forw-line
123             k         back-line
124             y         back-line
125             ^Y        back-line
126             ^K        back-line
127             ^P        back-line
128             J         forw-line-force
129             K         back-line-force
130             Y         back-line-force
131             d         forw-scroll
132             ^D        forw-scroll
133             u         back-scroll
134             ^U        back-scroll
135             \40  forw-screen
136             f         forw-screen
137             ^F        forw-screen
138             ^V        forw-screen
139             \kD  forw-screen
140             b         back-screen
141             ^B        back-screen
142             \ev       back-screen
143             \kU  back-screen
144             z         forw-window
145             w         back-window
146             \e\40          forw-screen-force
147             F         forw-forever
148             \eF       forw-until-hilite
149             R         repaint-flush
150             r         repaint
151             ^R        repaint
152             ^L        repaint
153             \eu       undo-hilite
154             g         goto-line
155             \kh  goto-line
156             <         goto-line
157             \e<       goto-line
158             p         percent
159             %         percent
160             \e[       left-scroll
161             \e]       right-scroll
162             \e(       left-scroll
163             \e)       right-scroll
164             \kl       left-scroll
165             \kr       right-scroll
166             {         forw-bracket {}
167             }         back-bracket {}
168             (         forw-bracket ()
169             )         back-bracket ()
170             [         forw-bracket []
171             ]         back-bracket []
172             \e^F      forw-bracket
173             \e^B      back-bracket
174             G         goto-end
175             \e>       goto-end
176             >         goto-end
177             \ke  goto-end
178             \eG       goto-end-buffered
179             =         status
180             ^G        status
181             :f        status
182             /         forw-search
183             ?         back-search
184             \e/       forw-search *
185             \e?       back-search *
186             n         repeat-search
187             \en       repeat-search-all
188             N         reverse-search
189             \eN       reverse-search-all
190             &         filter
191             m         set-mark
192             '         goto-mark
193             ^X^X      goto-mark
194             E         examine
195             :e        examine
196             ^X^V      examine
197             :n        next-file
198             :p        prev-file
199             t         next-tag
200             T         prev-tag
201             :x        index-file
202             :d        remove-file
203             -         toggle-option
204             :t        toggle-option t
205             s         toggle-option o
206             _         display-option
207             |         pipe
208             v         visual
209             !         shell
210             +         firstcmd
211             H         help
212             h         help
213             V         version
214             0         digit
215             1         digit
216             2         digit
217             3         digit
218             4         digit
219             5         digit
220             6         digit
221             7         digit
222             8         digit
223             9         digit
224             q         quit
225             Q         quit
226             :q        quit
227             :Q        quit
228             ZZ        quit
229
230
231 \e[1mPRECEDENCE\e[0m
232        Commands  specified  by  \e[4mlesskey\e[24m  take precedence over the default com-
233        mands.  A default command key may be disabled by including  it  in  the
234        input  file  with  the  action  "invalid".  Alternatively, a key may be
235        defined to do nothing by using the action  "noaction".   "noaction"  is
236        similar to "invalid", but \e[4mless\e[24m will give an error beep for an "invalid"
237        command, but not for a "noaction" command.  In  addition,  ALL  default
238        commands may be disabled by adding this control line to the input file:
239
240        #stop
241
242        This  will  cause  all  default commands to be ignored.  The #stop line
243        should be the last line in that section of the file.
244
245        Be aware that #stop can be dangerous.  Since all default  commands  are
246        disabled, you must provide sufficient commands before the #stop line to
247        enable all necessary actions.  For example, failure to provide a "quit"
248        command can lead to frustration.
249
250
251 \e[1mLINE EDITING SECTION\e[0m
252        The line-editing section begins with the line:
253
254        #line-edit
255
256        This  section specifies new key bindings for the line editing commands,
257        in a manner similar to the way key bindings for ordinary  commands  are
258        specified  in  the #command section.  The line-editing section consists
259        of a list of keys and actions, one per line as in the example below.
260
261
262 \e[1mEXAMPLE\e[0m
263        The following input file describes the set of default line-editing keys
264        used by less:
265
266             #line-edit
267             \t        forw-complete
268             \17       back-complete
269             \e\t      back-complete
270             ^L        expand
271             ^V        literal
272             ^A        literal
273             \el       right
274             \kr       right
275             \eh       left
276             \kl       left
277             \eb       word-left
278             \e\kl     word-left
279             \ew       word-right
280             \e\kr     word-right
281             \ei       insert
282             \ex       delete
283             \kx       delete
284             \eX       word-delete
285             \ekx      word-delete
286             \e\b      word-backspace
287             \e0       home
288             \kh       home
289             \e$       end
290             \ke       end
291             \ek       up
292             \ku       up
293             \ej       down
294             ^G        abort
295
296
297
298 \e[1mLESS ENVIRONMENT VARIABLES\e[0m
299        The environment variable section begins with the line
300
301        #env
302
303        Following  this  line  is  a  list of environment variable assignments.
304        Each line consists of an environment variable name, an equals sign  (=)
305        and  the value to be assigned to the environment variable.  White space
306        before and after the equals sign is  ignored.   Variables  assigned  in
307        this  way  are visible only to \e[4mless.\e[24m  If a variable is specified in the
308        system environment and also in a lesskey file, the value in the lesskey
309        file  takes precedence.  Although the lesskey file can be used to over-
310        ride variables set in the environment, the main  purpose  of  assigning
311        variables  in the lesskey file is simply to have all \e[4mless\e[24m configuration
312        information stored in one file.
313
314
315 \e[1mEXAMPLE\e[0m
316        The following input file sets the -i option whenever \e[4mless\e[24m is  run,  and
317        specifies the character set to be "latin1":
318
319             #env
320             LESS = -i
321             LESSCHARSET = latin1
322
323
324
325 \e[1mSEE ALSO\e[0m
326        less(1)
327
328
329 \e[1mWARNINGS\e[0m
330        On  MS-DOS and OS/2 systems, certain keys send a sequence of characters
331        which start with a NUL character (0).  This  NUL  character  should  be
332        represented as \340 in a lesskey file.
333
334
335 \e[1mCOPYRIGHT\e[0m
336        Copyright (C) 1984-2015  Mark Nudelman
337
338        less  is  part of the GNU project and is free software.  You can redis-
339        tribute it and/or modify it under the terms of either (1) the GNU  Gen-
340        eral  Public  License  as published by the Free Software Foundation; or
341        (2) the Less License.  See the file README in the less distribution for
342        more details regarding redistribution.  You should have received a copy
343        of the GNU General Public License along with the source for  less;  see
344        the  file  COPYING.   If not, write to the Free Software Foundation, 59
345        Temple Place, Suite 330, Boston, MA  02111-1307, USA.  You should  also
346        have received a copy of the Less License; see the file LICENSE.
347
348        less is distributed in the hope that it will be useful, but WITHOUT ANY
349        WARRANTY; without even the implied warranty of MERCHANTABILITY or  FIT-
350        NESS  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
351        more details.
352
353
354 \e[1mAUTHOR\e[0m
355        Mark Nudelman
356        Send bug reports or comments to <bug-less@gnu.org>.
357
358
359
360                            Version 481: 31 Aug 2015                 LESSKEY(1)