]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/blob - lib/libedit/editrc.5
MFC 298950: Fix an off by one error when remapping MSI-X vectors.
[FreeBSD/stable/8.git] / lib / libedit / editrc.5
1 .\"     $NetBSD: editrc.5,v 1.24 2009/04/11 22:17:52 wiz Exp $
2 .\"
3 .\" Copyright (c) 1997-2000 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
5 .\"
6 .\" This file was contributed to The NetBSD Foundation by Luke Mewburn.
7 .\"
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
10 .\" are met:
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\"    notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\"    notice, this list of conditions and the following disclaimer in the
15 .\"    documentation and/or other materials provided with the distribution.
16 .\" 3. Neither the name of The NetBSD Foundation nor the names of its
17 .\"    contributors may be used to endorse or promote products derived
18 .\"    from this software without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
21 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 .\" POSSIBILITY OF SUCH DAMAGE.
31 .\"
32 .\" $FreeBSD$
33 .\"
34 .Dd October 18, 2003
35 .Dt EDITRC 5
36 .Os
37 .Sh NAME
38 .Nm editrc
39 .Nd configuration file for editline library
40 .Sh SYNOPSIS
41 .Nm
42 .Sh DESCRIPTION
43 The
44 .Nm
45 file defines various settings to be used by the
46 .Xr editline 3
47 library.
48 .Pp
49 The format of each line is:
50 .Dl [prog:]command [arg [...]]
51 .Pp
52 .Ar command
53 is one of the
54 .Xr editline 3
55 builtin commands.
56 Refer to
57 .Sx BUILTIN COMMANDS
58 for more information.
59 .Pp
60 .Ar prog
61 is the program name string that a program defines when it calls
62 .Xr el_init 3
63 to set up
64 .Xr editline 3 ,
65 which is usually
66 .Va argv[0] .
67 .Ar command
68 will be executed for any program which matches
69 .Ar prog .
70 .Pp
71 .Ar prog
72 may also be a
73 .Xr regex 3
74 style
75 regular expression, in which case
76 .Ar command
77 will be executed for any program that matches the regular expression.
78 .Pp
79 If
80 .Ar prog
81 is absent,
82 .Ar command
83 is executed for all programs.
84 .Sh BUILTIN COMMANDS
85 The
86 .Nm editline
87 library has some builtin commands, which affect the way
88 that the line editing and history functions operate.
89 These are based on similar named builtins present in the
90 .Xr tcsh 1
91 shell.
92 .Pp
93 The following builtin commands are available:
94 .Bl -tag -width 4n
95 .It Ic bind Oo Fl a Oc Oo Fl e Oc Oo Fl k Oc Oo Fl l Oc Oo Fl r Oc \
96 Oo Fl s Oc Oo Fl v Oc Oo Ar key Oo Ar command Oc Oc
97 Without options, list all bound keys, and the editor command to which
98 each is bound.
99 If
100 .Ar key
101 is supplied, show the bindings for
102 .Ar key .
103 If
104 .Ar key command
105 is supplied, bind
106 .Ar command
107 to
108 .Ar key .
109 Options include:
110 .Bl -tag -width 4n
111 .It Fl e
112 Bind all keys to the standard GNU Emacs-like bindings.
113 .It Fl v
114 Bind all keys to the standard
115 .Xr vi 1 Ns -like
116 bindings.
117 .It Fl a
118 List or change key bindings in the
119 .Xr vi 1
120 mode alternate (command mode) key map.
121 .It Fl k
122 .Ar key
123 is interpreted as a symbolic arrow key name, which may be one of
124 .Sq up ,
125 .Sq down ,
126 .Sq left
127 or
128 .Sq right .
129 .It Fl l
130 List all editor commands and a short description of each.
131 .It Fl r
132 Remove a key's binding.
133 .It Fl s
134 .Ar command
135 is taken as a literal string and treated as terminal input when
136 .Ar key
137 is typed.
138 Bound keys in
139 .Ar command
140 are themselves reinterpreted, and this continues for ten levels of
141 interpretation.
142 .El
143 .Pp
144 .Ar command
145 may be one of the commands documented in
146 .Sx "EDITOR COMMANDS"
147 below, or another key.
148 .Pp
149 .Ar key
150 and
151 .Ar command
152 can contain control characters of the form
153 .Sm off
154 .Sq No ^ Ar character
155 .Sm on
156 (e.g.\&
157 .Sq ^A ) ,
158 and the following backslashed escape sequences:
159 .Pp
160 .Bl -tag -compact -offset indent -width 4n
161 .It Ic \ea
162 Bell
163 .It Ic \eb
164 Backspace
165 .It Ic \ee
166 Escape
167 .It Ic \ef
168 Formfeed
169 .It Ic \en
170 Newline
171 .It Ic \er
172 Carriage return
173 .It Ic \et
174 Horizontal tab
175 .It Ic \ev
176 Vertical tab
177 .Sm off
178 .It Sy \e Ar nnn
179 .Sm on
180 The ASCII character corresponding to the octal number
181 .Ar nnn .
182 .El
183 .Pp
184 .Sq \e
185 nullifies the special meaning of the following character,
186 if it has any, notably
187 .Sq \e
188 and
189 .Sq ^ .
190 .It Ic echotc Oo Fl sv Oc Ar arg Ar ...
191 Exercise terminal capabilities given in
192 .Ar arg Ar ... .
193 If
194 .Ar arg
195 is
196 .Sq baud ,
197 .Sq cols ,
198 .Sq lines ,
199 .Sq rows ,
200 .Sq meta or
201 .Sq tabs ,
202 the value of that capability is printed, with
203 .Dq yes
204 or
205 .Dq no
206 indicating that the terminal does or does not have that capability.
207 .Pp
208 .Fl s
209 returns an empty string for non-existent capabilities, rather than
210 causing an error.
211 .Fl v
212 causes messages to be verbose.
213 .It Ic edit Op Cm on | off
214 Enable or disable the
215 .Nm editline
216 functionality in a program.
217 .It Ic history Ar list | Ar size Dv n | Ar unique Dv n
218 The
219 .Ar list
220 command lists all entries in the history.
221 The
222 .Ar size
223 command sets the history size to
224 .Dv n
225 entries.
226 The
227 .Ar unique
228 command controls if history should keep duplicate entries.
229 If
230 .Dv n
231 is non zero, only keep unique history entries.
232 If
233 .Dv n
234 is zero, then keep all entries (the default).
235 .It Ic telltc
236 List the values of all the terminal capabilities (see
237 .Xr termcap 5 ) .
238 .It Ic settc Ar cap Ar val
239 Set the terminal capability
240 .Ar cap
241 to
242 .Ar val ,
243 as defined in
244 .Xr termcap 5 .
245 No sanity checking is done.
246 .It Ic setty Oo Fl a Oc Oo Fl d Oc Oo Fl q Oc Oo Fl x Oc Oo Ar +mode Oc \
247 Oo Ar -mode Oc Oo Ar mode Oc Oo Ar char=c Oc
248 Control which tty modes that
249 .Nm
250 will not allow the user to change.
251 .Fl d ,
252 .Fl q
253 or
254 .Fl x
255 tells
256 .Ic setty
257 to act on the
258 .Sq edit ,
259 .Sq quote
260 or
261 .Sq execute
262 set of tty modes respectively; defaulting to
263 .Fl x .
264 .Pp
265 Without other arguments,
266 .Ic setty
267 lists the modes in the chosen set which are fixed on
268 .Pq Sq +mode
269 or off
270 .Pq Sq -mode .
271 .Fl a
272 lists all tty modes in the chosen set regardless of the setting.
273 With
274 .Ar +mode ,
275 .Ar -mode
276 or
277 .Ar mode ,
278 fixes
279 .Ar mode
280 on or off or removes control of
281 .Ar mode
282 in the chosen set.
283 .Pp
284 .Ic Setty
285 can also be used to set tty characters to particular values using
286 .Ar char=value .
287 If
288 .Ar value
289 is empty
290 then the character is set to
291 .Dv _POSIX_VDISABLE .
292 .El
293 .Sh EDITOR COMMANDS
294 The following editor commands are available for use in key bindings:
295 .\" Section automatically generated with makelist
296 .Bl -tag -width 4n
297 .It Ic vi-paste-next
298 Vi paste previous deletion to the right of the cursor.
299 .It Ic vi-paste-prev
300 Vi paste previous deletion to the left of the cursor.
301 .It Ic vi-prev-space-word
302 Vi move to the previous space delimited word.
303 .It Ic vi-prev-word
304 Vi move to the previous word.
305 .It Ic vi-next-space-word
306 Vi move to the next space delimited word.
307 .It Ic vi-next-word
308 Vi move to the next word.
309 .It Ic vi-change-case
310 Vi change case of character under the cursor and advance one character.
311 .It Ic vi-change-meta
312 Vi change prefix command.
313 .It Ic vi-insert-at-bol
314 Vi enter insert mode at the beginning of line.
315 .It Ic vi-replace-char
316 Vi replace character under the cursor with the next character typed.
317 .It Ic vi-replace-mode
318 Vi enter replace mode.
319 .It Ic vi-substitute-char
320 Vi replace character under the cursor and enter insert mode.
321 .It Ic vi-substitute-line
322 Vi substitute entire line.
323 .It Ic vi-change-to-eol
324 Vi change to end of line.
325 .It Ic vi-insert
326 Vi enter insert mode.
327 .It Ic vi-add
328 Vi enter insert mode after the cursor.
329 .It Ic vi-add-at-eol
330 Vi enter insert mode at end of line.
331 .It Ic vi-delete-meta
332 Vi delete prefix command.
333 .It Ic vi-end-word
334 Vi move to the end of the current space delimited word.
335 .It Ic vi-to-end-word
336 Vi move to the end of the current word.
337 .It Ic vi-undo
338 Vi undo last change.
339 .It Ic vi-command-mode
340 Vi enter command mode (use alternative key bindings).
341 .It Ic vi-zero
342 Vi move to the beginning of line.
343 .It Ic vi-delete-prev-char
344 Vi move to previous character (backspace).
345 .It Ic vi-list-or-eof
346 Vi list choices for completion or indicate end of file if empty line.
347 .It Ic vi-kill-line-prev
348 Vi cut from beginning of line to cursor.
349 .It Ic vi-search-prev
350 Vi search history previous.
351 .It Ic vi-search-next
352 Vi search history next.
353 .It Ic vi-repeat-search-next
354 Vi repeat current search in the same search direction.
355 .It Ic vi-repeat-search-prev
356 Vi repeat current search in the opposite search direction.
357 .It Ic vi-next-char
358 Vi move to the character specified next.
359 .It Ic vi-prev-char
360 Vi move to the character specified previous.
361 .It Ic vi-to-next-char
362 Vi move up to the character specified next.
363 .It Ic vi-to-prev-char
364 Vi move up to the character specified previous.
365 .It Ic vi-repeat-next-char
366 Vi repeat current character search in the same search direction.
367 .It Ic vi-repeat-prev-char
368 Vi repeat current character search in the opposite search direction.
369 .It Ic em-delete-or-list
370 Delete character under cursor or list completions if at end of line.
371 .It Ic em-delete-next-word
372 Cut from cursor to end of current word.
373 .It Ic em-yank
374 Paste cut buffer at cursor position.
375 .It Ic em-kill-line
376 Cut the entire line and save in cut buffer.
377 .It Ic em-kill-region
378 Cut area between mark and cursor and save in cut buffer.
379 .It Ic em-copy-region
380 Copy area between mark and cursor to cut buffer.
381 .It Ic em-gosmacs-transpose
382 Exchange the two characters before the cursor.
383 .It Ic em-next-word
384 Move next to end of current word.
385 .It Ic em-upper-case
386 Uppercase the characters from cursor to end of current word.
387 .It Ic em-capitol-case
388 Capitalize the characters from cursor to end of current word.
389 .It Ic em-lower-case
390 Lowercase the characters from cursor to end of current word.
391 .It Ic em-set-mark
392 Set the mark at cursor.
393 .It Ic em-exchange-mark
394 Exchange the cursor and mark.
395 .It Ic em-universal-argument
396 Universal argument (argument times 4).
397 .It Ic em-meta-next
398 Add 8th bit to next character typed.
399 .It Ic em-toggle-overwrite
400 Switch from insert to overwrite mode or vice versa.
401 .It Ic em-copy-prev-word
402 Copy current word to cursor.
403 .It Ic em-inc-search-next
404 Emacs incremental next search.
405 .It Ic em-inc-search-prev
406 Emacs incremental reverse search.
407 .It Ic ed-end-of-file
408 Indicate end of file.
409 .It Ic ed-insert
410 Add character to the line.
411 .It Ic ed-delete-prev-word
412 Delete from beginning of current word to cursor.
413 .It Ic ed-delete-next-char
414 Delete character under cursor.
415 .It Ic ed-kill-line
416 Cut to the end of line.
417 .It Ic ed-move-to-end
418 Move cursor to the end of line.
419 .It Ic ed-move-to-beg
420 Move cursor to the beginning of line.
421 .It Ic ed-transpose-chars
422 Exchange the character to the left of the cursor with the one under it.
423 .It Ic ed-next-char
424 Move to the right one character.
425 .It Ic ed-prev-word
426 Move to the beginning of the current word.
427 .It Ic ed-prev-char
428 Move to the left one character.
429 .It Ic ed-quoted-insert
430 Add the next character typed verbatim.
431 .It Ic ed-digit
432 Adds to argument or enters a digit.
433 .It Ic ed-argument-digit
434 Digit that starts argument.
435 .It Ic ed-unassigned
436 Indicates unbound character.
437 .It Ic ed-tty-sigint
438 Tty interrupt character.
439 .It Ic ed-tty-dsusp
440 Tty delayed suspend character.
441 .It Ic ed-tty-flush-output
442 Tty flush output characters.
443 .It Ic ed-tty-sigquit
444 Tty quit character.
445 .It Ic ed-tty-sigtstp
446 Tty suspend character.
447 .It Ic ed-tty-stop-output
448 Tty disallow output characters.
449 .It Ic ed-tty-start-output
450 Tty allow output characters.
451 .It Ic ed-newline
452 Execute command.
453 .It Ic ed-delete-prev-char
454 Delete the character to the left of the cursor.
455 .It Ic ed-clear-screen
456 Clear screen leaving current line at the top.
457 .It Ic ed-redisplay
458 Redisplay everything.
459 .It Ic ed-start-over
460 Erase current line and start from scratch.
461 .It Ic ed-sequence-lead-in
462 First character in a bound sequence.
463 .It Ic ed-prev-history
464 Move to the previous history line.
465 .It Ic ed-next-history
466 Move to the next history line.
467 .It Ic ed-search-prev-history
468 Search previous in history for a line matching the current.
469 .It Ic ed-search-next-history
470 Search next in history for a line matching the current.
471 .It Ic ed-prev-line
472 Move up one line.
473 .It Ic ed-next-line
474 Move down one line.
475 .It Ic ed-command
476 Editline extended command.
477 .El
478 .\" End of section automatically generated with makelist
479 .Sh SEE ALSO
480 .Xr editline 3 ,
481 .Xr regex 3 ,
482 .Xr termcap 5
483 .Sh AUTHORS
484 .An -nosplit
485 The
486 .Nm editline
487 library was written by
488 .An Christos Zoulas ,
489 and this manual was written by
490 .An Luke Mewburn ,
491 with some sections inspired by
492 .Xr tcsh 1 .