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