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