Initial import from FreeBSD RELENG_4:
[dragonfly.git] / contrib / libreadline / readline.3
1 .\" $FreeBSD: src/contrib/libreadline/readline.3,v 1.5.2.2 2000/07/06 23:04:24 ache Exp $
2 .\"
3 .\" MAN PAGE COMMENTS to
4 .\"
5 .\"     Chet Ramey
6 .\"     Information Network Services
7 .\"     Case Western Reserve University
8 .\"     chet@ins.CWRU.Edu
9 .\"
10 .\"     Last Change: Tue Jun  1 13:28:03 EDT 1999
11 .\"
12 .TH READLINE 3 "1999 Jun 1" GNU
13 .\"
14 .\" File Name macro.  This used to be `.PN', for Path Name,
15 .\" but Sun doesn't seem to like that very much.
16 .\"
17 .de FN
18 \fI\|\\$1\|\fP
19 ..
20 .SH NAME
21 readline \- get a line from a user with editing
22 .SH SYNOPSIS
23 .LP
24 .nf
25 .ft B
26 #include <stdio.h>
27 #include <readline/readline.h>
28 #include <readline/history.h>
29 .ft
30 .fi
31 .LP
32 .nf
33 .ft B
34 char *readline (prompt)
35 char *prompt;
36 .ft
37 .fi
38 .SH COPYRIGHT
39 .if n Readline is Copyright (C) 1989, 1991, 1993, 1995, 1996 by the Free Software Foundation, Inc.
40 .if t Readline is Copyright \(co 1989, 1991, 1993, 1995, 1996 by the Free Software Foundation, Inc.
41 .SH DESCRIPTION
42 .LP
43 .B readline
44 will read a line from the terminal
45 and return it, using
46 .B prompt
47 as a prompt.  If 
48 .B prompt
49 is null, no prompt is issued.  The line returned is allocated with
50 .IR malloc (3),
51 so the caller must free it when finished.  The line returned
52 has the final newline removed, so only the text of the line
53 remains.
54 .LP
55 .B readline
56 offers editing capabilities while the user is entering the
57 line.
58 By default, the line editing commands
59 are similar to those of emacs.
60 A vi\-style line editing interface is also available.
61 .SH RETURN VALUE
62 .LP
63 .B readline
64 returns the text of the line read.  A blank line
65 returns the empty string.  If
66 .B EOF
67 is encountered while reading a line, and the line is empty,
68 .B NULL
69 is returned.  If an
70 .B EOF
71 is read with a non\-empty line, it is
72 treated as a newline.
73 .SH NOTATION
74 .LP
75 An emacs-style notation is used to denote
76 keystrokes.  Control keys are denoted by C\-\fIkey\fR, e.g., C\-n
77 means Control\-N.  Similarly, 
78 .I meta
79 keys are denoted by M\-\fIkey\fR, so M\-x means Meta\-X.  (On keyboards
80 without a 
81 .I meta
82 key, M\-\fIx\fP means ESC \fIx\fP, i.e., press the Escape key
83 then the
84 .I x
85 key.  This makes ESC the \fImeta prefix\fP.
86 The combination M\-C\-\fIx\fP means ESC\-Control\-\fIx\fP,
87 or press the Escape key
88 then hold the Control key while pressing the
89 .I x
90 key.)
91 .PP
92 Readline commands may be given numeric
93 .IR arguments ,
94 which normally act as a repeat count.  Sometimes, however, it is the
95 sign of the argument that is significant.  Passing a negative argument
96 to a command that acts in the forward direction (e.g., \fBkill\-line\fP)
97 causes that command to act in a backward direction.  Commands whose
98 behavior with arguments deviates from this are noted.
99 .PP
100 When a command is described as \fIkilling\fP text, the text
101 deleted is saved for possible future retrieval
102 (\fIyanking\fP).  The killed text is saved in a
103 \fIkill ring\fP.  Consecutive kills cause the text to be
104 accumulated into one unit, which can be yanked all at once. 
105 Commands which do not kill text separate the chunks of text
106 on the kill ring.
107 .SH INITIALIZATION FILE
108 .LP
109 Readline is customized by putting commands in an initialization
110 file (the \fIinputrc\fP file).
111 The name of this file is taken from the value of the
112 .B INPUTRC
113 environment variable.  If that variable is unset, the default is
114 .IR ~/.inputrc .
115 When a program which uses the readline library starts up, the
116 init file is read, and the key bindings and variables are set.
117 There are only a few basic constructs allowed in the
118 readline init file.  Blank lines are ignored.
119 Lines beginning with a \fB#\fP are comments.
120 Lines beginning with a \fB$\fP indicate conditional constructs.
121 Other lines denote key bindings and variable settings.
122 Each program using this library may add its own commands
123 and bindings.
124 .PP
125 For example, placing
126 .RS
127 .PP
128 M\-Control\-u: universal\-argument
129 .RE
130 or
131 .RS
132 C\-Meta\-u: universal\-argument
133 .RE
134 into the 
135 .I inputrc
136 would make M\-C\-u execute the readline command
137 .IR universal\-argument .
138 .PP
139 The following symbolic character names are recognized while
140 processing key bindings:
141 .IR RUBOUT ,
142 .IR DEL ,
143 .IR ESC ,
144 .IR LFD ,
145 .IR NEWLINE ,
146 .IR RET ,
147 .IR RETURN ,
148 .IR SPC ,
149 .IR SPACE ,
150 and
151 .IR TAB .
152 .PP
153 In addition to command names, readline allows keys to be bound
154 to a string that is inserted when the key is pressed (a \fImacro\fP).
155 .PP
156 .SS Key Bindings
157 .PP
158 The syntax for controlling key bindings in the
159 .I inputrc
160 file is simple.  All that is required is the name of the
161 command or the text of a macro and a key sequence to which
162 it should be bound. The name may be specified in one of two ways:
163 as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP
164 prefixes, or as a key sequence.
165 When using the form \fBkeyname\fP:\^\fIfunction-name\fP or \fImacro\fP,
166 .I keyname
167 is the name of a key spelled out in English.  For example:
168 .sp
169 .RS
170 Control\-u: universal\-argument
171 .br
172 Meta\-Rubout: backward\-kill\-word
173 .br
174 Control\-o: ">&output"
175 .RE
176 .LP
177 In the above example,
178 .I C\-u
179 is bound to the function
180 .BR universal\-argument ,
181 .I M-DEL
182 is bound to the function
183 .BR backward\-kill\-word ,
184 and
185 .I C\-o
186 is bound to run the macro
187 expressed on the right hand side (that is, to insert the text
188 .I >&output
189 into the line).
190 .PP
191 In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP,
192 .B keyseq
193 differs from
194 .B keyname
195 above in that strings denoting
196 an entire key sequence may be specified by placing the sequence
197 within double quotes.  Some GNU Emacs style key escapes can be
198 used, as in the following example.
199 .sp
200 .RS
201 "\eC\-u": universal\-argument
202 .br
203 "\eC\-x\eC\-r": re\-read\-init\-file
204 .br
205 "\ee[11~": "Function Key 1"
206 .RE
207 .PP
208 In this example,
209 .I C-u
210 is again bound to the function
211 .BR universal\-argument .
212 .I "C-x C-r"
213 is bound to the function
214 .BR re\-read\-init\-file ,
215 and 
216 .I "ESC [ 1 1 ~"
217 is bound to insert the text
218 .BR "Function Key 1" .
219 The full set of GNU Emacs style escape sequences is
220 .RS
221 .PD 0
222 .TP
223 .B \eC\-
224 control prefix
225 .TP
226 .B \eM\-
227 meta prefix
228 .TP
229 .B \ee
230 an escape character
231 .TP
232 .B \e\e
233 backslash
234 .TP
235 .B \e"
236 literal "
237 .TP
238 .B \e'
239 literal '
240 .RE
241 .PD
242 .PP
243 In addition to the GNU Emacs style escape sequences, a second
244 set of backslash escapes is available:
245 .RS
246 .PD 0
247 .TP
248 .B \ea
249 alert (bell)
250 .TP
251 .B \eb
252 backspace
253 .TP
254 .B \ed
255 delete
256 .TP
257 .B \ef
258 form feed
259 .TP
260 .B \en
261 newline
262 .TP
263 .B \er
264 carriage return
265 .TP
266 .B \et
267 horizontal tab
268 .TP
269 .B \ev
270 vertical tab
271 .TP
272 .B \e\fInnn\fP
273 the character whose ASCII code is the octal value \fInnn\fP
274 (one to three digits)
275 .TP
276 .B \ex\fInnn\fP
277 the character whose ASCII code is the hexadecimal value \fInnn\fP
278 (one to three digits)
279 .RE
280 .PD
281 .PP
282 When entering the text of a macro, single or double quotes should
283 be used to indicate a macro definition.  Unquoted text
284 is assumed to be a function name.
285 In the macro body, the backslash escapes described above are expanded.
286 Backslash will quote any other character in the macro text,
287 including " and '.
288 .PP
289 .B Bash
290 allows the current readline key bindings to be displayed or modified
291 with the
292 .B bind
293 builtin command.  The editing mode may be switched during interactive
294 use by using the
295 .B \-o
296 option to the
297 .B set
298 builtin command.  Other programs using this library provide
299 similar mechanisms.  The
300 .I inputrc
301 file may be edited and re-read if a program does not provide
302 any other means to incorporate new bindings.
303 .SS Variables
304 .PP
305 Readline has variables that can be used to further customize its
306 behavior.  A variable may be set in the
307 .I inputrc
308 file with a statement of the form
309 .RS
310 .PP
311 \fBset\fP \fIvariable\-name\fP \fIvalue\fP
312 .RE
313 .PP
314 Except where noted, readline variables can take the values
315 .B On
316 or
317 .BR Off .
318 The variables and their default values are:
319 .PP
320 .PD 0
321 .TP
322 .B bell\-style (audible)
323 Controls what happens when readline wants to ring the terminal bell.
324 If set to \fBnone\fP, readline never rings the bell.  If set to
325 \fBvisible\fP, readline uses a visible bell if one is available.
326 If set to \fBaudible\fP, readline attempts to ring the terminal's bell.
327 .TP
328 .B comment\-begin (``#'')
329 The string that is inserted in \fBvi\fP mode when the
330 .B insert\-comment
331 command is executed.
332 This command is bound to
333 .B M\-#
334 in emacs mode and to
335 .B #
336 in vi command mode.
337 .TP 
338 .B completion\-ignore\-case (Off)
339 If set to \fBOn\fP, readline performs filename matching and completion
340 in a case\-insensitive fashion.
341 .TP
342 .B completion\-query\-items (100)
343 This determines when the user is queried about viewing
344 the number of possible completions
345 generated by the \fBpossible\-completions\fP command.
346 It may be set to any integer value greater than or equal to
347 zero.  If the number of possible completions is greater than
348 or equal to the value of this variable, the user is asked whether
349 or not he wishes to view them; otherwise they are simply listed
350 on the terminal.
351 .TP
352 .B convert\-meta (On)
353 If set to \fBOn\fP, readline will convert characters with the
354 eighth bit set to an ASCII key sequence
355 by stripping the eighth bit and prepending an
356 escape character (in effect, using escape as the \fImeta prefix\fP).
357 .TP
358 .B disable\-completion (Off)
359 If set to \fBOn\fP, readline will inhibit word completion.  Completion 
360 characters will be inserted into the line as if they had been
361 mapped to \fBself-insert\fP.
362 .TP
363 .B editing\-mode (emacs)
364 Controls whether readline begins with a set of key bindings similar
365 to \fIemacs\fP or \fIvi\fP.
366 .B editing\-mode
367 can be set to either
368 .B emacs
369 or
370 .BR vi .
371 .TP
372 .B enable\-keypad (Off)
373 When set to \fBOn\fP, readline will try to enable the application
374 keypad when it is called.  Some systems need this to enable the
375 arrow keys.
376 .TP
377 .B expand\-tilde (Off)
378 If set to \fBon\fP, tilde expansion is performed when readline
379 attempts word completion.
380 .TP
381 .B horizontal\-scroll\-mode (Off)
382 When set to \fBOn\fP, makes readline use a single line for display,
383 scrolling the input horizontally on a single screen line when it
384 becomes longer than the screen width rather than wrapping to a new line.
385 .TP
386 .B input\-meta (Off)
387 If set to \fBOn\fP, readline will enable eight-bit input (that is,
388 it will not strip the high bit from the characters it reads),
389 regardless of what the terminal claims it can support.  The name
390 .B meta\-flag
391 is a synonym for this variable.
392 .TP
393 .B isearch\-terminators (``C\-[C\-J'')
394 The string of characters that should terminate an incremental
395 search without subsequently executing the character as a command.
396 If this variable has not been given a value, the characters
397 \fIESC\fP and \fIC\-J\fP will terminate an incremental search.
398 .TP
399 .B keymap (emacs)
400 Set the current readline keymap.  The set of legal keymap names is
401 \fIemacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move,
402 vi-command\fP, and
403 .IR vi-insert .
404 \fIvi\fP is equivalent to \fIvi-command\fP; \fIemacs\fP is
405 equivalent to \fIemacs-standard\fP.  The default value is
406 .IR emacs ;
407 the value of
408 .B editing\-mode
409 also affects the default keymap.
410 .TP
411 .B mark\-directories (On)
412 If set to \fBOn\fP, complete<d directory names have a slash
413 appended.
414 .TP
415 .B mark\-modified\-lines (Off)
416 If set to \fBOn\fP, history lines that have been modified are displayed
417 with a preceding asterisk (\fB*\fP).
418 .TP
419 .B output\-meta (Off)
420 If set to \fBOn\fP, readline will display characters with the
421 eighth bit set directly rather than as a meta-prefixed escape
422 sequence.
423 .TP
424 .B print\-completions\-horizontally (Off)
425 If set to \fBOn\fP, readline will display completions with matches
426 sorted horizontally in alphabetical order, rather than down the screen.
427 .TP
428 .B show\-all\-if\-ambiguous (Off)
429 This alters the default behavior of the completion functions.  If
430 set to
431 .BR on ,
432 words which have more than one possible completion cause the
433 matches to be listed immediately instead of ringing the bell.
434 .TP
435 .B visible\-stats (Off)
436 If set to \fBOn\fP, a character denoting a file's type as reported  
437 by \fBstat\fP(2) is appended to the filename when listing possible
438 completions.
439 .PD
440 .SS Conditional Constructs
441 .PP
442 Readline implements a facility similar in spirit to the conditional
443 compilation features of the C preprocessor which allows key
444 bindings and variable settings to be performed as the result
445 of tests.  There are four parser directives used.
446 .IP \fB$if\fP
447 The 
448 .B $if
449 construct allows bindings to be made based on the
450 editing mode, the terminal being used, or the application using
451 readline.  The text of the test extends to the end of the line;
452 no characters are required to isolate it.
453 .RS
454 .IP \fBmode\fP
455 The \fBmode=\fP form of the \fB$if\fP directive is used to test
456 whether readline is in emacs or vi mode.
457 This may be used in conjunction
458 with the \fBset keymap\fP command, for instance, to set bindings in
459 the \fIemacs-standard\fP and \fIemacs-ctlx\fP keymaps only if
460 readline is starting out in emacs mode.
461 .IP \fBterm\fP
462 The \fBterm=\fP form may be used to include terminal-specific
463 key bindings, perhaps to bind the key sequences output by the
464 terminal's function keys.  The word on the right side of the
465 .B =
466 is tested against the full name of the terminal and the portion
467 of the terminal name before the first \fB\-\fP.  This allows
468 .I sun
469 to match both
470 .I sun
471 and
472 .IR sun\-cmd ,
473 for instance.
474 .IP \fBapplication\fP
475 The \fBapplication\fP construct is used to include
476 application-specific settings.  Each program using the readline
477 library sets the \fIapplication name\fP, and an initialization
478 file can test for a particular value.
479 This could be used to bind key sequences to functions useful for
480 a specific program.  For instance, the following command adds a
481 key sequence that quotes the current or previous word in Bash:
482 .sp 1
483 .RS
484 .nf
485 \fB$if\fP bash
486 # Quote the current or previous word
487 "\eC-xq": "\eeb\e"\eef\e""
488 \fB$endif\fP
489 .fi
490 .RE
491 .RE
492 .IP \fB$endif\fP
493 This command, as seen in the previous example, terminates an
494 \fB$if\fP command.
495 .IP \fB$else\fP
496 Commands in this branch of the \fB$if\fP directive are executed if
497 the test fails.
498 .IP \fB$include\fP
499 This directive takes a single filename as an argument and reads commands
500 and bindings from that file.  For example, the following directive
501 would read \fI/etc/inputrc\fP:
502 .sp 1
503 .RS
504 .nf
505 \fB$include\fP \^ \fI/etc/inputrc\fP
506 .fi 
507 .RE
508 .SH SEARCHING
509 .PP
510 Readline provides commands for searching through the command history
511 for lines containing a specified string.
512 There are two search modes:
513 .I incremental
514 and
515 .IR non-incremental .
516 .PP
517 Incremental searches begin before the user has finished typing the
518 search string.
519 As each character of the search string is typed, readline displays
520 the next entry from the history matching the string typed so far.
521 An incremental search requires only as many characters as needed to
522 find the desired history entry.
523 The characters present in the value of the \fIisearch-terminators\fP
524 variable are used to terminate an incremental search.
525 If that variable has not been assigned a value the Escape and
526 Control-J characters will terminate an incremental search.
527 Control-G will abort an incremental search and restore the original
528 line.
529 When the search is terminated, the history entry containing the
530 search string becomes the current line.
531 To find other matching entries in the history list, type Control-S or
532 Control-R as appropriate.
533 This will search backward or forward in the history for the next
534 line matching the search string typed so far.
535 Any other key sequence bound to a readline command will terminate
536 the search and execute that command.
537 For instance, a \fInewline\fP will terminate the search and accept
538 the line, thereby executing the command from the history list.
539 .PP
540 Non-incremental searches read the entire search string before starting
541 to search for matching history lines.  The search string may be
542 typed by the user or be part of the contents of the current line.
543 .SH EDITING COMMANDS
544 .PP
545 The following is a list of the names of the commands and the default
546 key sequences to which they are bound.
547 Command names without an accompanying key sequence are unbound by default.
548 .SS Commands for Moving
549 .PP
550 .PD 0
551 .TP
552 .B beginning\-of\-line (C\-a)
553 Move to the start of the current line.
554 .TP
555 .B end\-of\-line (C\-e)
556 Move to the end of the line.
557 .TP
558 .B forward\-char (C\-f)
559 Move forward a character.
560 .TP
561 .B backward\-char (C\-b)
562 Move back a character.
563 .TP
564 .B forward\-word (M\-f)
565 Move forward to the end of the next word.  Words are composed of
566 alphanumeric characters (letters and digits).
567 .TP
568 .B backward\-word (M\-b)
569 Move back to the start of the current or previous word.  Words are
570 composed of alphanumeric characters (letters and digits).
571 .TP
572 .B clear\-screen (C\-l)
573 Clear the screen leaving the current line at the top of the screen.
574 With an argument, refresh the current line without clearing the
575 screen.
576 .TP
577 .B redraw\-current\-line
578 Refresh the current line.
579 .PD
580 .SS Commands for Manipulating the History
581 .PP
582 .PD 0
583 .TP
584 .B accept\-line (Newline, Return)
585 Accept the line regardless of where the cursor is.  If this line is
586 non-empty, add it to the history list. If the line is a modified
587 history line, then restore the history line to its original state.
588 .TP
589 .B previous\-history (C\-p)
590 Fetch the previous command from the history list, moving back in
591 the list.
592 .TP
593 .B next\-history (C\-n)
594 Fetch the next command from the history list, moving forward in the
595 list.
596 .TP
597 .B beginning\-of\-history (M\-<)
598 Move to the first line in the history.
599 .TP
600 .B end\-of\-history (M\->)
601 Move to the end of the input history, i.e., the line currently being
602 entered.
603 .TP
604 .B reverse\-search\-history (C\-r)
605 Search backward starting at the current line and moving `up' through
606 the history as necessary.  This is an incremental search.
607 .TP
608 .B forward\-search\-history (C\-s)
609 Search forward starting at the current line and moving `down' through
610 the history as necessary.  This is an incremental search.
611 .TP
612 .B non\-incremental\-reverse\-search\-history (M\-p)
613 Search backward through the history starting at the current line
614 using a non-incremental search for a string supplied by the user.
615 .TP
616 .B non\-incremental\-forward\-search\-history (M\-n)
617 Search forward through the history using a non-incremental search
618 for a string supplied by the user.
619 .TP
620 .B history\-search\-forward
621 Search forward through the history for the string of characters
622 between the start of the current line and the current cursor
623 position (the \fIpoint\fP).
624 This is a non-incremental search.
625 .TP
626 .B history\-search\-backward
627 Search backward through the history for the string of characters
628 between the start of the current line and the point.
629 This is a non-incremental search.
630 .TP
631 .B yank\-nth\-arg (M\-C\-y)
632 Insert the first argument to the previous command (usually
633 the second word on the previous line) at point (the current
634 cursor position).  With an argument
635 .IR n ,
636 insert the \fIn\fPth word from the previous command (the words
637 in the previous command begin with word 0).  A negative argument
638 inserts the \fIn\fPth word from the end of the previous command.
639 .TP
640 .B
641 yank\-last\-arg (M\-.\^, M\-_\^)
642 Insert the last argument to the previous command (the last word of
643 the previous history entry).  With an argument,
644 behave exactly like \fByank\-nth\-arg\fP.
645 Successive calls to \fByank\-last\-arg\fP move back through the history
646 list, inserting the last argument of each line in turn.
647 .PD
648 .SS Commands for Changing Text
649 .PP
650 .PD 0
651 .TP
652 .B delete\-char (C\-d)
653 Delete the character under the cursor.  If point is at the
654 beginning of the line, there are no characters in the line, and
655 the last character typed was not bound to \fBBdelete\-char\fP, then return
656 .SM
657 .BR EOF .
658 .TP
659 .B backward\-delete\-char (Rubout)
660 Delete the character behind the cursor.  When given a numeric argument,
661 save the deleted text on the kill ring.
662 .TP
663 .B forward\-backward\-delete\-char   
664 Delete the character under the cursor, unless the cursor is at the
665 end of the line, in which case the character behind the cursor is
666 deleted.  By default, this is not bound to a key.
667 .TP
668 .B quoted\-insert (C\-q, C\-v)
669 Add the next character that you type to the line verbatim.  This is
670 how to insert characters like \fBC\-q\fP, for example.
671 .TP
672 .B tab\-insert (M-TAB)
673 Insert a tab character.
674 .TP
675 .B self\-insert (a,\ b,\ A,\ 1,\ !,\ ...)
676 Insert the character typed.
677 .TP
678 .B transpose\-chars (C\-t)
679 Drag the character before point forward over the character at point.
680 Point moves forward as well.  If point is at the end of the line, then
681 transpose the two characters before point.  Negative arguments don't work.
682 .TP
683 .B transpose\-words (M\-t)
684 Drag the word behind the cursor past the word in front of the cursor
685 moving the cursor over that word as well.
686 .TP
687 .B upcase\-word (M\-u)
688 Uppercase the current (or following) word.  With a negative argument,
689 uppercase the previous word, but do not move point.
690 .TP
691 .B downcase\-word (M\-l)
692 Lowercase the current (or following) word.  With a negative argument,
693 lowercase the previous word, but do not move point.
694 .TP
695 .B capitalize\-word (M\-c)
696 Capitalize the current (or following) word.  With a negative argument,
697 capitalize the previous word, but do not move point.
698 .PD
699 .SS Killing and Yanking
700 .PP
701 .PD 0
702 .TP
703 .B kill\-line (C\-k)
704 Kill the text from the current cursor position to the end of the line.
705 .TP
706 .B backward\-kill\-line (C\-x Rubout)
707 Kill backward to the beginning of the line.
708 .TP
709 .B unix\-line\-discard (C\-u)
710 Kill backward from point to the beginning of the line.
711 The killed text is saved on the kill-ring.
712 .\" There is no real difference between this and backward-kill-line
713 .TP
714 .B kill\-whole\-line
715 Kill all characters on the current line, no matter where the
716 cursor is.
717 .TP
718 .B kill\-word  (M\-d)
719 Kill from the cursor to the end of the current word, or if between
720 words, to the end of the next word.  Word boundaries are the same as
721 those used by \fBforward\-word\fP.
722 .TP
723 .B backward\-kill\-word (M\-Rubout)
724 Kill the word behind the cursor.  Word boundaries are the same as
725 those used by \fBbackward\-word\fP.
726 .TP
727 .B unix\-word\-rubout (C\-w)
728 Kill the word behind the cursor, using white space as a word boundary.
729 The word boundaries are different from
730 .BR backward\-kill\-word .
731 .TP
732 .B delete\-horizontal\-space (M\-\e)
733 Delete all spaces and tabs around point.
734 .TP
735 .B kill\-region
736 Kill the text between the point and \fImark\fP (saved cursor position).
737 This text is referred to as the \fIregion\fP.
738 .TP
739 .B copy\-region\-as\-kill
740 Copy the text in the region to the kill buffer.
741 .TP
742 .B copy\-backward\-word
743 Copy the word before point to the kill buffer.
744 The word boundaries are the same as \fBbackward\-word\fP.
745 .TP
746 .B copy\-forward\-word
747 Copy the word following point to the kill buffer.
748 The word boundaries are the same as \fBforward\-word\fP.
749 .TP
750 .B yank (C\-y)
751 Yank the top of the kill ring into the buffer at the cursor.
752 .TP
753 .B yank\-pop (M\-y)
754 Rotate the kill ring, and yank the new top.  Only works following
755 .B yank
756 or
757 .BR yank\-pop .
758 .PD
759 .SS Numeric Arguments
760 .PP
761 .PD 0
762 .TP
763 .B digit\-argument (M\-0, M\-1, ..., M\-\-)
764 Add this digit to the argument already accumulating, or start a new
765 argument.  M\-\- starts a negative argument.
766 .TP
767 .B universal\-argument
768 This is another way to specify an argument.
769 If this command is followed by one or more digits, optionally with a
770 leading minus sign, those digits define the argument.
771 If the command is followed by digits, executing
772 .B universal\-argument
773 again ends the numeric argument, but is otherwise ignored.
774 As a special case, if this command is immediately followed by a
775 character that is neither a digit or minus sign, the argument count
776 for the next command is multiplied by four.
777 The argument count is initially one, so executing this function the
778 first time makes the argument count four, a second time makes the
779 argument count sixteen, and so on.
780 .PD
781 .SS Completing
782 .PP
783 .PD 0
784 .TP
785 .B complete (TAB)
786 Attempt to perform completion on the text before point.
787 The actual completion performed is application-specific.
788 .BR Bash ,
789 for instance, attempts completion treating the text as a variable
790 (if the text begins with \fB$\fP), username (if the text begins with
791 \fB~\fP), hostname (if the text begins with \fB@\fP), or
792 command (including aliases and functions) in turn.  If none
793 of these produces a match, filename completion is attempted.
794 .BR Gdb ,
795 on the other hand,
796 allows completion of program functions and variables, and
797 only attempts filename completion under certain circumstances.
798 .TP
799 .B possible\-completions (M\-?)
800 List the possible completions of the text before point.
801 .TP
802 .B insert\-completions (M\-*)
803 Insert all completions of the text before point
804 that would have been generated by
805 \fBpossible\-completions\fP.
806 .TP
807 .B menu\-complete
808 Similar to \fBcomplete\fP, but replaces the word to be completed
809 with a single match from the list of possible completions.
810 Repeated execution of \fBmenu\-complete\fP steps through the list
811 of possible completions, inserting each match in turn.
812 At the end of the list of completions, the bell is rung and the
813 original text is restored.
814 An argument of \fIn\fP moves \fIn\fP positions forward in the list
815 of matches; a negative argument may be used to move backward 
816 through the list.
817 This command is intended to be bound to \fBTAB\fP, but is unbound
818 by default.
819 .TP
820 .B delete\-char\-or\-list
821 Deletes the character under the cursor if not at the beginning or
822 end of the line (like \fBdelete-char\fP).
823 If at the end of the line, behaves identically to
824 \fBpossible-completions\fP.
825 This command is unbound by default.
826 .PD
827 .SS Keyboard Macros
828 .PP
829 .PD 0
830 .TP
831 .B start\-kbd\-macro (C\-x (\^)
832 Begin saving the characters typed into the current keyboard macro.
833 .TP
834 .B end\-kbd\-macro (C\-x )\^)
835 Stop saving the characters typed into the current keyboard macro
836 and store the definition.
837 .TP
838 .B call\-last\-kbd\-macro (C\-x e)
839 Re-execute the last keyboard macro defined, by making the characters
840 in the macro appear as if typed at the keyboard.
841 .PD
842 .SS Miscellaneous
843 .PP
844 .PD 0
845 .TP
846 .B re\-read\-init\-file (C\-x C\-r)
847 Read in the contents of the \fIinputrc\fP file, and incorporate
848 any bindings or variable assignments found there.
849 .TP
850 .B abort (C\-g)
851 Abort the current editing command and
852 ring the terminal's bell (subject to the setting of
853 .BR bell\-style ).
854 .TP
855 .B do\-uppercase\-version (M\-a, M\-b, M\-\fIx\fP, ...)
856 If the metafied character \fIx\fP is lowercase, run the command
857 that is bound to the corresponding uppercase character.
858 .TP
859 .B prefix\-meta (ESC)
860 Metafy the next character typed.
861 .SM
862 .B ESC
863 .B f
864 is equivalent to
865 .BR Meta\-f .
866 .TP
867 .B undo (C\-_, C\-x C\-u)
868 Incremental undo, separately remembered for each line.
869 .TP
870 .B revert\-line (M\-r)
871 Undo all changes made to this line.  This is like executing the
872 .B undo
873 command enough times to return the line to its initial state.
874 .TP
875 .B tilde\-expand (M\-&)
876 Perform tilde expansion on the current word.
877 .TP
878 .B set\-mark (C\-@, M-<space>)
879 Set the mark to the current point.  If a
880 numeric argument is supplied, the mark is set to that position.
881 .TP
882 .B exchange\-point\-and\-mark (C\-x C\-x)
883 Swap the point with the mark.  The current cursor position is set to
884 the saved position, and the old cursor position is saved as the mark.
885 .TP
886 .B character\-search (C\-])
887 A character is read and point is moved to the next occurrence of that
888 character.  A negative count searches for previous occurrences.
889 .TP
890 .B character\-search\-backward (M\-C\-])
891 A character is read and point is moved to the previous occurrence of that
892 character.  A negative count searches for subsequent occurrences.
893 .TP
894 .B insert\-comment (M\-#)
895 The value of the readline
896 .B comment\-begin
897 variable is inserted at the beginning of the current line, and the line
898 is accepted as if a newline had been typed.  This makes the current line
899 a shell comment.
900 .TP
901 .B dump\-functions
902 Print all of the functions and their key bindings to the
903 readline output stream.  If a numeric argument is supplied,
904 the output is formatted in such a way that it can be made part
905 of an \fIinputrc\fP file.
906 .TP
907 .B dump\-variables
908 Print all of the settable variables and their values to the
909 readline output stream.  If a numeric argument is supplied,
910 the output is formatted in such a way that it can be made part
911 of an \fIinputrc\fP file.
912 .TP
913 .B dump\-macros
914 Print all of the readline key sequences bound to macros and the
915 strings they ouput.  If a numeric argument is supplied,
916 the output is formatted in such a way that it can be made part
917 of an \fIinputrc\fP file.
918 .TP
919 .B emacs\-editing\-mode (C\-e)
920 When in
921 .B vi
922 editing mode, this causes a switch to
923 .B emacs
924 editing mode.
925 .TP
926 .B vi\-editing\-mode (M\-C\-j)
927 When in
928 .B emacs
929 editing mode, this causes a switch to
930 .B vi
931 editing mode.
932 .PD
933 .SH DEFAULT KEY BINDINGS
934 .LP
935 The following is a list of the default emacs and vi bindings.
936 Characters with the 8th bit set are written as M\-<character>, and
937 are referred to as
938 .I metafied
939 characters.
940 The printable ASCII characters not mentioned in the list of emacs
941 standard bindings are bound to the
942 .I self\-insert
943 function, which just inserts the given character into the input line.
944 In vi insertion mode, all characters not specifically mentioned are
945 bound to
946 .IR self\-insert .
947 Characters assigned to signal generation by
948 .IR stty (1)
949 or the terminal driver, such as C-Z or C-C,
950 retain that function.
951 Upper and lower case
952 .I metafied
953 characters are bound to the same function in the emacs mode
954 meta keymap.
955 The remaining characters are unbound, which causes readline
956 to ring the bell (subject to the setting of the
957 .B bell\-style
958 variable).
959 .SS Emacs Mode
960 .RS +.6i
961 .nf
962 .ta 2.5i
963 .sp
964 Emacs Standard bindings
965 .sp
966 "C-@"  set-mark
967 "C-A"  beginning-of-line
968 "C-B"  backward-char
969 "C-D"  delete-char
970 "C-E"  end-of-line
971 "C-F"  forward-char
972 "C-G"  abort
973 "C-H"  backward-delete-char
974 "C-I"  complete
975 "C-J"  accept-line
976 "C-K"  kill-line
977 "C-L"  clear-screen
978 "C-M"  accept-line
979 "C-N"  next-history
980 "C-P"  previous-history
981 "C-Q"  quoted-insert
982 "C-R"  reverse-search-history
983 "C-S"  forward-search-history
984 "C-T"  transpose-chars
985 "C-U"  unix-line-discard
986 "C-V"  quoted-insert
987 "C-W"  unix-word-rubout
988 "C-Y"  yank
989 "C-]"  character-search
990 "C-_"  undo
991 "\^ " to "/"  self-insert
992 "0"  to "9"  self-insert
993 ":"  to "~"  self-insert
994 "C-?"  backward-delete-char
995 .PP
996 Emacs Meta bindings
997 .sp
998 "M-C-G"  abort
999 "M-C-H"  backward-kill-word
1000 "M-C-I"  tab-insert
1001 "M-C-J"  vi-editing-mode
1002 "M-C-M"  vi-editing-mode
1003 "M-C-R"  revert-line
1004 "M-C-Y"  yank-nth-arg
1005 "M-C-["  complete
1006 "M-C-]"  character-search-backward
1007 "M-space"  set-mark
1008 "M-#"  insert-comment
1009 "M-&"  tilde-expand
1010 "M-*"  insert-completions
1011 "M--"  digit-argument
1012 "M-."  yank-last-arg
1013 "M-0"  digit-argument
1014 "M-1"  digit-argument
1015 "M-2"  digit-argument
1016 "M-3"  digit-argument
1017 "M-4"  digit-argument
1018 "M-5"  digit-argument
1019 "M-6"  digit-argument
1020 "M-7"  digit-argument
1021 "M-8"  digit-argument
1022 "M-9"  digit-argument
1023 "M-<"  beginning-of-history
1024 "M-="  possible-completions
1025 "M->"  end-of-history
1026 "M-?"  possible-completions
1027 "M-B"  backward-word
1028 "M-C"  capitalize-word
1029 "M-D"  kill-word
1030 "M-F"  forward-word
1031 "M-L"  downcase-word
1032 "M-N"  non-incremental-forward-search-history
1033 "M-P"  non-incremental-reverse-search-history
1034 "M-R"  revert-line
1035 "M-T"  transpose-words
1036 "M-U"  upcase-word
1037 "M-Y"  yank-pop
1038 "M-\e"  delete-horizontal-space
1039 "M-~"  tilde-expand
1040 "M-C-?"  backward-delete-word
1041 "M-_"  yank-last-arg
1042 .PP
1043 Emacs Control-X bindings
1044 .sp
1045 "C-XC-G"  abort
1046 "C-XC-R"  re-read-init-file
1047 "C-XC-U"  undo
1048 "C-XC-X"  exchange-point-and-mark
1049 "C-X("  start-kbd-macro
1050 "C-X)"  end-kbd-macro
1051 "C-XE"  call-last-kbd-macro
1052 "C-XC-?"  backward-kill-line
1053 .sp
1054 .RE
1055 .SS VI Mode bindings
1056 .RS +.6i
1057 .nf
1058 .ta 2.5i
1059 .sp
1060 .PP
1061 VI Insert Mode functions
1062 .sp
1063 "C-D"  vi-eof-maybe
1064 "C-H"  backward-delete-char
1065 "C-I"  complete
1066 "C-J"  accept-line
1067 "C-M"  accept-line
1068 "C-R"  reverse-search-history
1069 "C-S"  forward-search-history
1070 "C-T"  transpose-chars
1071 "C-U"  unix-line-discard
1072 "C-V"  quoted-insert
1073 "C-W"  unix-word-rubout
1074 "C-Y"  yank
1075 "C-["  vi-movement-mode
1076 "C-_"  undo
1077 "\^ " to "~"  self-insert
1078 "C-?"  backward-delete-char
1079 .PP
1080 VI Command Mode functions
1081 .sp
1082 "C-D"  vi-eof-maybe
1083 "C-E"  emacs-editing-mode
1084 "C-G"  abort
1085 "C-H"  backward-char
1086 "C-J"  accept-line
1087 "C-K"  kill-line
1088 "C-L"  clear-screen
1089 "C-M"  accept-line
1090 "C-N"  next-history
1091 "C-P"  previous-history
1092 "C-Q"  quoted-insert
1093 "C-R"  reverse-search-history
1094 "C-S"  forward-search-history
1095 "C-T"  transpose-chars
1096 "C-U"  unix-line-discard
1097 "C-V"  quoted-insert
1098 "C-W"  unix-word-rubout
1099 "C-Y"  yank
1100 "\^ "  forward-char
1101 "#"  insert-comment
1102 "$"  end-of-line
1103 "%"  vi-match
1104 "&"  vi-tilde-expand
1105 "*"  vi-complete
1106 "+"  next-history
1107 ","  vi-char-search
1108 "-"  previous-history
1109 "."  vi-redo
1110 "/"  vi-search
1111 "0"  beginning-of-line
1112 "1" to "9"  vi-arg-digit
1113 ";"  vi-char-search
1114 "="  vi-complete
1115 "?"  vi-search
1116 "A"  vi-append-eol
1117 "B"  vi-prev-word
1118 "C"  vi-change-to
1119 "D"  vi-delete-to
1120 "E"  vi-end-word
1121 "F"  vi-char-search
1122 "G"  vi-fetch-history
1123 "I"  vi-insert-beg
1124 "N"  vi-search-again
1125 "P"  vi-put
1126 "R"  vi-replace
1127 "S"  vi-subst
1128 "T"  vi-char-search
1129 "U"  revert-line
1130 "W"  vi-next-word
1131 "X"  backward-delete-char
1132 "Y"  vi-yank-to
1133 "\e"  vi-complete
1134 "^"  vi-first-print
1135 "_"  vi-yank-arg
1136 "`"  vi-goto-mark
1137 "a"  vi-append-mode
1138 "b"  vi-prev-word
1139 "c"  vi-change-to
1140 "d"  vi-delete-to
1141 "e"  vi-end-word
1142 "f"  vi-char-search
1143 "h"  backward-char
1144 "i"  vi-insertion-mode
1145 "j"  next-history
1146 "k"  prev-history
1147 "l"  forward-char
1148 "m"  vi-set-mark
1149 "n"  vi-search-again
1150 "p"  vi-put
1151 "r"  vi-change-char
1152 "s"  vi-subst
1153 "t"  vi-char-search
1154 "u"  undo
1155 "w"  vi-next-word
1156 "x"  vi-delete
1157 "y"  vi-yank-to
1158 "|"  vi-column
1159 "~"  vi-change-case
1160 .RE
1161 .SH "SEE ALSO"
1162 .PD 0
1163 .TP
1164 \fIThe Gnu Readline Library\fP, Brian Fox and Chet Ramey
1165 .TP
1166 \fIThe Gnu History Library\fP, Brian Fox and Chet Ramey
1167 .TP
1168 \fIbash\fP(1)
1169 .PD
1170 .SH FILES
1171 .PD 0
1172 .TP
1173 .FN ~/.inputrc
1174 Individual \fBreadline\fP initialization file
1175 .PD
1176 .SH AUTHORS
1177 Brian Fox, Free Software Foundation
1178 .br
1179 bfox@gnu.org
1180 .PP
1181 Chet Ramey, Case Western Reserve University
1182 .br
1183 chet@ins.CWRU.Edu
1184 .SH BUG REPORTS
1185 If you find a bug in
1186 .B readline,
1187 you should report it.  But first, you should
1188 make sure that it really is a bug, and that it appears in the latest
1189 version of the
1190 .B readline
1191 library that you have.
1192 .PP
1193 Once you have determined that a bug actually exists, mail a
1194 bug report to \fIbug\-readline\fP@\fIgnu.org\fP.
1195 If you have a fix, you are welcome to mail that
1196 as well!  Suggestions and `philosophical' bug reports may be mailed
1197 to \fPbug-readline\fP@\fIgnu.org\fP or posted to the Usenet
1198 newsgroup
1199 .BR gnu.bash.bug .
1200 .PP
1201 Comments and bug reports concerning
1202 this manual page should be directed to
1203 .IR chet@ins.CWRU.Edu .
1204 .SH BUGS
1205 .PP
1206 It's too big and too slow.