2 .\" MAN PAGE COMMENTS to
5 .\" Information Network Services
6 .\" Case Western Reserve University
9 .\" Last Change: Tue Sep 13 12:07:26 EDT 2005
11 .TH READLINE 3 "2005 Sep 13" "GNU Readline 5.1-beta1"
13 .\" File Name macro. This used to be `.PN', for Path Name,
14 .\" but Sun doesn't seem to like that very much.
20 readline \- get a line from a user with editing
26 #include <readline/readline.h>
27 #include <readline/history.h>
34 \fBreadline\fP (\fIconst char *prompt\fP);
37 .if n Readline is Copyright (C) 1989\-2004 by the Free Software Foundation, Inc.
38 .if t Readline is Copyright \(co 1989\-2004 by the Free Software Foundation, Inc.
42 will read a line from the terminal
47 is \fBNULL\fP or the empty string, no prompt is issued.
48 The line returned is allocated with
50 the caller must free it when finished. The line returned
51 has the final newline removed, so only the text of the line
55 offers editing capabilities while the user is entering the
57 By default, the line editing commands
58 are similar to those of emacs.
59 A vi\-style line editing interface is also available.
61 This manual page describes only the most basic use of \fBreadline\fP.
62 Much more functionality is available; see
63 \fIThe GNU Readline Library\fP and \fIThe GNU History Library\fP
64 for additional information.
68 returns the text of the line read. A blank line
69 returns the empty string. If
71 is encountered while reading a line, and the line is empty,
75 is read with a non\-empty line, it is
79 An emacs-style notation is used to denote
80 keystrokes. Control keys are denoted by C\-\fIkey\fR, e.g., C\-n
81 means Control\-N. Similarly,
83 keys are denoted by M\-\fIkey\fR, so M\-x means Meta\-X. (On keyboards
86 key, M\-\fIx\fP means ESC \fIx\fP, i.e., press the Escape key
89 key. This makes ESC the \fImeta prefix\fP.
90 The combination M\-C\-\fIx\fP means ESC\-Control\-\fIx\fP,
91 or press the Escape key
92 then hold the Control key while pressing the
96 Readline commands may be given numeric
98 which normally act as a repeat count. Sometimes, however, it is the
99 sign of the argument that is significant. Passing a negative argument
100 to a command that acts in the forward direction (e.g., \fBkill\-line\fP)
101 causes that command to act in a backward direction. Commands whose
102 behavior with arguments deviates from this are noted.
104 When a command is described as \fIkilling\fP text, the text
105 deleted is saved for possible future retrieval
106 (\fIyanking\fP). The killed text is saved in a
107 \fIkill ring\fP. Consecutive kills cause the text to be
108 accumulated into one unit, which can be yanked all at once.
109 Commands which do not kill text separate the chunks of text
111 .SH INITIALIZATION FILE
113 Readline is customized by putting commands in an initialization
114 file (the \fIinputrc\fP file).
115 The name of this file is taken from the value of the
117 environment variable. If that variable is unset, the default is
119 When a program which uses the readline library starts up, the
120 init file is read, and the key bindings and variables are set.
121 There are only a few basic constructs allowed in the
122 readline init file. Blank lines are ignored.
123 Lines beginning with a \fB#\fP are comments.
124 Lines beginning with a \fB$\fP indicate conditional constructs.
125 Other lines denote key bindings and variable settings.
126 Each program using this library may add its own commands
132 M\-Control\-u: universal\-argument
136 C\-Meta\-u: universal\-argument
141 would make M\-C\-u execute the readline command
142 .IR universal\-argument .
144 The following symbolic character names are recognized while
145 processing key bindings:
159 In addition to command names, readline allows keys to be bound
160 to a string that is inserted when the key is pressed (a \fImacro\fP).
164 The syntax for controlling key bindings in the
166 file is simple. All that is required is the name of the
167 command or the text of a macro and a key sequence to which
168 it should be bound. The name may be specified in one of two ways:
169 as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP
170 prefixes, or as a key sequence.
172 When using the form \fBkeyname\fP:\^\fIfunction-name\fP or \fImacro\fP,
174 is the name of a key spelled out in English. For example:
177 Control\-u: universal\-argument
179 Meta\-Rubout: backward\-kill\-word
181 Control\-o: "> output"
184 In the above example,
186 is bound to the function
187 .BR universal\-argument ,
189 is bound to the function
190 .BR backward\-kill\-word ,
193 is bound to run the macro
194 expressed on the right hand side (that is, to insert the text
195 .if t \f(CW> output\fP
199 In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP,
203 above in that strings denoting
204 an entire key sequence may be specified by placing the sequence
205 within double quotes. Some GNU Emacs style key escapes can be
206 used, as in the following example, but the symbolic character names
210 "\eC\-u": universal\-argument
212 "\eC\-x\eC\-r": re\-read\-init\-file
214 "\ee[11~": "Function Key 1"
219 is again bound to the function
220 .BR universal\-argument .
222 is bound to the function
223 .BR re\-read\-init\-file ,
226 is bound to insert the text
227 .if t \f(CWFunction Key 1\fP.
228 .if n ``Function Key 1''.
230 The full set of GNU Emacs style escape sequences available when specifying
248 literal ", a double quote
251 literal ', a single quote
255 In addition to the GNU Emacs style escape sequences, a second
256 set of backslash escapes is available:
285 the eight-bit character whose value is the octal value \fInnn\fP
286 (one to three digits)
289 the eight-bit character whose value is the hexadecimal value \fIHH\fP
290 (one or two hex digits)
294 When entering the text of a macro, single or double quotes should
295 be used to indicate a macro definition. Unquoted text
296 is assumed to be a function name.
297 In the macro body, the backslash escapes described above are expanded.
298 Backslash will quote any other character in the macro text,
302 allows the current readline key bindings to be displayed or modified
305 builtin command. The editing mode may be switched during interactive
310 builtin command. Other programs using this library provide
311 similar mechanisms. The
313 file may be edited and re-read if a program does not provide
314 any other means to incorporate new bindings.
317 Readline has variables that can be used to further customize its
318 behavior. A variable may be set in the
320 file with a statement of the form
323 \fBset\fP \fIvariable\-name\fP \fIvalue\fP
326 Except where noted, readline variables can take the values
330 (without regard to case).
331 Unrecognized variable names are ignored.
332 When a variable value is read, empty or null values, "on" (case-insensitive),
333 and "1" are equivalent to \fBOn\fP. All other values are equivalent to
335 The variables and their default values are:
339 .B bell\-style (audible)
340 Controls what happens when readline wants to ring the terminal bell.
341 If set to \fBnone\fP, readline never rings the bell. If set to
342 \fBvisible\fP, readline uses a visible bell if one is available.
343 If set to \fBaudible\fP, readline attempts to ring the terminal's bell.
345 .B bind\-tty\-special\-chars (On)
346 If set to \fBOn\fP, readline attempts to bind the control characters
347 treated specially by the kernel's terminal driver to their readline
350 .B comment\-begin (``#'')
351 The string that is inserted in \fBvi\fP mode when the
354 This command is bound to
360 .B completion\-ignore\-case (Off)
361 If set to \fBOn\fP, readline performs filename matching and completion
362 in a case\-insensitive fashion.
364 .B completion\-query\-items (100)
365 This determines when the user is queried about viewing
366 the number of possible completions
367 generated by the \fBpossible\-completions\fP command.
368 It may be set to any integer value greater than or equal to
369 zero. If the number of possible completions is greater than
370 or equal to the value of this variable, the user is asked whether
371 or not he wishes to view them; otherwise they are simply listed
372 on the terminal. A negative value causes readline to never ask.
374 .B convert\-meta (On)
375 If set to \fBOn\fP, readline will convert characters with the
376 eighth bit set to an ASCII key sequence
377 by stripping the eighth bit and prefixing it with an
378 escape character (in effect, using escape as the \fImeta prefix\fP).
380 .B disable\-completion (Off)
381 If set to \fBOn\fP, readline will inhibit word completion. Completion
382 characters will be inserted into the line as if they had been
383 mapped to \fBself-insert\fP.
385 .B editing\-mode (emacs)
386 Controls whether readline begins with a set of key bindings similar
394 .B enable\-keypad (Off)
395 When set to \fBOn\fP, readline will try to enable the application
396 keypad when it is called. Some systems need this to enable the
399 .B expand\-tilde (Off)
400 If set to \fBon\fP, tilde expansion is performed when readline
401 attempts word completion.
403 .B history\-preserve\-point (Off)
404 If set to \fBon\fP, the history code attempts to place point at the
405 same location on each history line retrieved with \fBprevious-history\fP
406 or \fBnext-history\fP.
408 .B horizontal\-scroll\-mode (Off)
409 When set to \fBOn\fP, makes readline use a single line for display,
410 scrolling the input horizontally on a single screen line when it
411 becomes longer than the screen width rather than wrapping to a new line.
414 If set to \fBOn\fP, readline will enable eight-bit input (that is,
415 it will not clear the eighth bit in the characters it reads),
416 regardless of what the terminal claims it can support. The name
418 is a synonym for this variable.
420 .B isearch\-terminators (``C\-[ C\-J'')
421 The string of characters that should terminate an incremental
422 search without subsequently executing the character as a command.
423 If this variable has not been given a value, the characters
424 \fIESC\fP and \fIC\-J\fP will terminate an incremental search.
427 Set the current readline keymap. The set of legal keymap names is
428 \fIemacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move,
431 \fIvi\fP is equivalent to \fIvi-command\fP; \fIemacs\fP is
432 equivalent to \fIemacs-standard\fP. The default value is
436 also affects the default keymap.
438 .B mark\-directories (On)
439 If set to \fBOn\fP, completed directory names have a slash
442 .B mark\-modified\-lines (Off)
443 If set to \fBOn\fP, history lines that have been modified are displayed
444 with a preceding asterisk (\fB*\fP).
446 .B mark\-symlinked\-directories (Off)
447 If set to \fBOn\fP, completed names which are symbolic links to directories
448 have a slash appended (subject to the value of
449 \fBmark\-directories\fP).
451 .B match\-hidden\-files (On)
452 This variable, when set to \fBOn\fP, causes readline to match files whose
453 names begin with a `.' (hidden files) when performing filename
454 completion, unless the leading `.' is
455 supplied by the user in the filename to be completed.
457 .B output\-meta (Off)
458 If set to \fBOn\fP, readline will display characters with the
459 eighth bit set directly rather than as a meta-prefixed escape
462 .B page\-completions (On)
463 If set to \fBOn\fP, readline uses an internal \fImore\fP-like pager
464 to display a screenful of possible completions at a time.
466 .B print\-completions\-horizontally (Off)
467 If set to \fBOn\fP, readline will display completions with matches
468 sorted horizontally in alphabetical order, rather than down the screen.
470 .B show\-all\-if\-ambiguous (Off)
471 This alters the default behavior of the completion functions. If
474 words which have more than one possible completion cause the
475 matches to be listed immediately instead of ringing the bell.
477 .B show\-all\-if\-unmodified (Off)
478 This alters the default behavior of the completion functions in
479 a fashion similar to \fBshow\-all\-if\-ambiguous\fP.
482 words which have more than one possible completion without any
483 possible partial completion (the possible completions don't share
484 a common prefix) cause the matches to be listed immediately instead
487 .B visible\-stats (Off)
488 If set to \fBOn\fP, a character denoting a file's type as reported
489 by \fIstat\fP(2) is appended to the filename when listing possible
492 .SS Conditional Constructs
494 Readline implements a facility similar in spirit to the conditional
495 compilation features of the C preprocessor which allows key
496 bindings and variable settings to be performed as the result
497 of tests. There are four parser directives used.
501 construct allows bindings to be made based on the
502 editing mode, the terminal being used, or the application using
503 readline. The text of the test extends to the end of the line;
504 no characters are required to isolate it.
507 The \fBmode=\fP form of the \fB$if\fP directive is used to test
508 whether readline is in emacs or vi mode.
509 This may be used in conjunction
510 with the \fBset keymap\fP command, for instance, to set bindings in
511 the \fIemacs-standard\fP and \fIemacs-ctlx\fP keymaps only if
512 readline is starting out in emacs mode.
514 The \fBterm=\fP form may be used to include terminal-specific
515 key bindings, perhaps to bind the key sequences output by the
516 terminal's function keys. The word on the right side of the
518 is tested against the full name of the terminal and the portion
519 of the terminal name before the first \fB\-\fP. This allows
526 .IP \fBapplication\fP
527 The \fBapplication\fP construct is used to include
528 application-specific settings. Each program using the readline
529 library sets the \fIapplication name\fP, and an initialization
530 file can test for a particular value.
531 This could be used to bind key sequences to functions useful for
532 a specific program. For instance, the following command adds a
533 key sequence that quotes the current or previous word in Bash:
538 # Quote the current or previous word
539 "\eC-xq": "\eeb\e"\eef\e""
545 This command, as seen in the previous example, terminates an
548 Commands in this branch of the \fB$if\fP directive are executed if
551 This directive takes a single filename as an argument and reads commands
552 and bindings from that file. For example, the following directive
553 would read \fI/etc/inputrc\fP:
557 \fB$include\fP \^ \fI/etc/inputrc\fP
562 Readline provides commands for searching through the command history
563 for lines containing a specified string.
564 There are two search modes:
567 .IR non-incremental .
569 Incremental searches begin before the user has finished typing the
571 As each character of the search string is typed, readline displays
572 the next entry from the history matching the string typed so far.
573 An incremental search requires only as many characters as needed to
574 find the desired history entry.
575 To search backward in the history for a particular string, type
576 \fBC\-r\fP. Typing \fBC\-s\fP searches forward through the history.
577 The characters present in the value of the \fBisearch-terminators\fP
578 variable are used to terminate an incremental search.
579 If that variable has not been assigned a value the \fIEscape\fP and
580 \fBC\-J\fP characters will terminate an incremental search.
581 \fBC\-G\fP will abort an incremental search and restore the original
583 When the search is terminated, the history entry containing the
584 search string becomes the current line.
586 To find other matching entries in the history list, type \fBC\-s\fP or
587 \fBC\-r\fP as appropriate.
588 This will search backward or forward in the history for the next
589 line matching the search string typed so far.
590 Any other key sequence bound to a readline command will terminate
591 the search and execute that command.
592 For instance, a newline will terminate the search and accept
593 the line, thereby executing the command from the history list.
594 A movement command will terminate the search, make the last line found
595 the current line, and begin editing.
597 Non-incremental searches read the entire search string before starting
598 to search for matching history lines. The search string may be
599 typed by the user or be part of the contents of the current line.
602 The following is a list of the names of the commands and the default
603 key sequences to which they are bound.
604 Command names without an accompanying key sequence are unbound by default.
606 In the following descriptions, \fIpoint\fP refers to the current cursor
607 position, and \fImark\fP refers to a cursor position saved by the
608 \fBset\-mark\fP command.
609 The text between the point and mark is referred to as the \fIregion\fP.
610 .SS Commands for Moving
614 .B beginning\-of\-line (C\-a)
615 Move to the start of the current line.
617 .B end\-of\-line (C\-e)
618 Move to the end of the line.
620 .B forward\-char (C\-f)
621 Move forward a character.
623 .B backward\-char (C\-b)
624 Move back a character.
626 .B forward\-word (M\-f)
627 Move forward to the end of the next word. Words are composed of
628 alphanumeric characters (letters and digits).
630 .B backward\-word (M\-b)
631 Move back to the start of the current or previous word. Words are
632 composed of alphanumeric characters (letters and digits).
634 .B clear\-screen (C\-l)
635 Clear the screen leaving the current line at the top of the screen.
636 With an argument, refresh the current line without clearing the
639 .B redraw\-current\-line
640 Refresh the current line.
642 .SS Commands for Manipulating the History
646 .B accept\-line (Newline, Return)
647 Accept the line regardless of where the cursor is.
649 non-empty, it may be added to the history list for future recall with
651 If the line is a modified history line, the history line is restored to its original state.
653 .B previous\-history (C\-p)
654 Fetch the previous command from the history list, moving back in
657 .B next\-history (C\-n)
658 Fetch the next command from the history list, moving forward in the
661 .B beginning\-of\-history (M\-<)
662 Move to the first line in the history.
664 .B end\-of\-history (M\->)
665 Move to the end of the input history, i.e., the line currently being
668 .B reverse\-search\-history (C\-r)
669 Search backward starting at the current line and moving `up' through
670 the history as necessary. This is an incremental search.
672 .B forward\-search\-history (C\-s)
673 Search forward starting at the current line and moving `down' through
674 the history as necessary. This is an incremental search.
676 .B non\-incremental\-reverse\-search\-history (M\-p)
677 Search backward through the history starting at the current line
678 using a non-incremental search for a string supplied by the user.
680 .B non\-incremental\-forward\-search\-history (M\-n)
681 Search forward through the history using a non-incremental search
682 for a string supplied by the user.
684 .B history\-search\-forward
685 Search forward through the history for the string of characters
686 between the start of the current line and the current cursor
687 position (the \fIpoint\fP).
688 This is a non-incremental search.
690 .B history\-search\-backward
691 Search backward through the history for the string of characters
692 between the start of the current line and the point.
693 This is a non-incremental search.
695 .B yank\-nth\-arg (M\-C\-y)
696 Insert the first argument to the previous command (usually
697 the second word on the previous line) at point.
700 insert the \fIn\fPth word from the previous command (the words
701 in the previous command begin with word 0). A negative argument
702 inserts the \fIn\fPth word from the end of the previous command.
703 Once the argument \fIn\fP is computed, the argument is extracted
704 as if the "!\fIn\fP" history expansion had been specified.
707 yank\-last\-arg (M\-.\^, M\-_\^)
708 Insert the last argument to the previous command (the last word of
709 the previous history entry). With an argument,
710 behave exactly like \fByank\-nth\-arg\fP.
711 Successive calls to \fByank\-last\-arg\fP move back through the history
712 list, inserting the last argument of each line in turn.
713 The history expansion facilities are used to extract the last argument,
714 as if the "!$" history expansion had been specified.
716 .SS Commands for Changing Text
720 .B delete\-char (C\-d)
721 Delete the character at point. If point is at the
722 beginning of the line, there are no characters in the line, and
723 the last character typed was not bound to \fBdelete\-char\fP, then return
727 .B backward\-delete\-char (Rubout)
728 Delete the character behind the cursor. When given a numeric argument,
729 save the deleted text on the kill ring.
731 .B forward\-backward\-delete\-char
732 Delete the character under the cursor, unless the cursor is at the
733 end of the line, in which case the character behind the cursor is
736 .B quoted\-insert (C\-q, C\-v)
737 Add the next character that you type to the line verbatim. This is
738 how to insert characters like \fBC\-q\fP, for example.
740 .B tab\-insert (M-TAB)
741 Insert a tab character.
743 .B self\-insert (a,\ b,\ A,\ 1,\ !,\ ...)
744 Insert the character typed.
746 .B transpose\-chars (C\-t)
747 Drag the character before point forward over the character at point,
748 moving point forward as well.
749 If point is at the end of the line, then this transposes
750 the two characters before point.
751 Negative arguments have no effect.
753 .B transpose\-words (M\-t)
754 Drag the word before point past the word after point,
755 moving point over that word as well.
756 If point is at the end of the line, this transposes
757 the last two words on the line.
759 .B upcase\-word (M\-u)
760 Uppercase the current (or following) word. With a negative argument,
761 uppercase the previous word, but do not move point.
763 .B downcase\-word (M\-l)
764 Lowercase the current (or following) word. With a negative argument,
765 lowercase the previous word, but do not move point.
767 .B capitalize\-word (M\-c)
768 Capitalize the current (or following) word. With a negative argument,
769 capitalize the previous word, but do not move point.
772 Toggle overwrite mode. With an explicit positive numeric argument,
773 switches to overwrite mode. With an explicit non-positive numeric
774 argument, switches to insert mode. This command affects only
775 \fBemacs\fP mode; \fBvi\fP mode does overwrite differently.
776 Each call to \fIreadline()\fP starts in insert mode.
777 In overwrite mode, characters bound to \fBself\-insert\fP replace
778 the text at point rather than pushing the text to the right.
779 Characters bound to \fBbackward\-delete\-char\fP replace the character
780 before point with a space. By default, this command is unbound.
782 .SS Killing and Yanking
787 Kill the text from point to the end of the line.
789 .B backward\-kill\-line (C\-x Rubout)
790 Kill backward to the beginning of the line.
792 .B unix\-line\-discard (C\-u)
793 Kill backward from point to the beginning of the line.
794 The killed text is saved on the kill-ring.
795 .\" There is no real difference between this and backward-kill-line
798 Kill all characters on the current line, no matter where point is.
801 Kill from point the end of the current word, or if between
802 words, to the end of the next word. Word boundaries are the same as
803 those used by \fBforward\-word\fP.
805 .B backward\-kill\-word (M\-Rubout)
806 Kill the word behind point.
807 Word boundaries are the same as those used by \fBbackward\-word\fP.
809 .B unix\-word\-rubout (C\-w)
810 Kill the word behind point, using white space as a word boundary.
811 The killed text is saved on the kill-ring.
813 .B unix\-filename\-rubout
814 Kill the word behind point, using white space and the slash character
815 as the word boundaries.
816 The killed text is saved on the kill-ring.
818 .B delete\-horizontal\-space (M\-\e)
819 Delete all spaces and tabs around point.
822 Kill the text between the point and \fImark\fP (saved cursor position).
823 This text is referred to as the \fIregion\fP.
825 .B copy\-region\-as\-kill
826 Copy the text in the region to the kill buffer.
828 .B copy\-backward\-word
829 Copy the word before point to the kill buffer.
830 The word boundaries are the same as \fBbackward\-word\fP.
832 .B copy\-forward\-word
833 Copy the word following point to the kill buffer.
834 The word boundaries are the same as \fBforward\-word\fP.
837 Yank the top of the kill ring into the buffer at point.
840 Rotate the kill ring, and yank the new top. Only works following
845 .SS Numeric Arguments
849 .B digit\-argument (M\-0, M\-1, ..., M\-\-)
850 Add this digit to the argument already accumulating, or start a new
851 argument. M\-\- starts a negative argument.
853 .B universal\-argument
854 This is another way to specify an argument.
855 If this command is followed by one or more digits, optionally with a
856 leading minus sign, those digits define the argument.
857 If the command is followed by digits, executing
858 .B universal\-argument
859 again ends the numeric argument, but is otherwise ignored.
860 As a special case, if this command is immediately followed by a
861 character that is neither a digit or minus sign, the argument count
862 for the next command is multiplied by four.
863 The argument count is initially one, so executing this function the
864 first time makes the argument count four, a second time makes the
865 argument count sixteen, and so on.
872 Attempt to perform completion on the text before point.
873 The actual completion performed is application-specific.
875 for instance, attempts completion treating the text as a variable
876 (if the text begins with \fB$\fP), username (if the text begins with
877 \fB~\fP), hostname (if the text begins with \fB@\fP), or
878 command (including aliases and functions) in turn. If none
879 of these produces a match, filename completion is attempted.
882 allows completion of program functions and variables, and
883 only attempts filename completion under certain circumstances.
885 .B possible\-completions (M\-?)
886 List the possible completions of the text before point.
888 .B insert\-completions (M\-*)
889 Insert all completions of the text before point
890 that would have been generated by
891 \fBpossible\-completions\fP.
894 Similar to \fBcomplete\fP, but replaces the word to be completed
895 with a single match from the list of possible completions.
896 Repeated execution of \fBmenu\-complete\fP steps through the list
897 of possible completions, inserting each match in turn.
898 At the end of the list of completions, the bell is rung
899 (subject to the setting of \fBbell\-style\fP)
900 and the original text is restored.
901 An argument of \fIn\fP moves \fIn\fP positions forward in the list
902 of matches; a negative argument may be used to move backward
904 This command is intended to be bound to \fBTAB\fP, but is unbound
907 .B delete\-char\-or\-list
908 Deletes the character under the cursor if not at the beginning or
909 end of the line (like \fBdelete-char\fP).
910 If at the end of the line, behaves identically to
911 \fBpossible-completions\fP.
917 .B start\-kbd\-macro (C\-x (\^)
918 Begin saving the characters typed into the current keyboard macro.
920 .B end\-kbd\-macro (C\-x )\^)
921 Stop saving the characters typed into the current keyboard macro
922 and store the definition.
924 .B call\-last\-kbd\-macro (C\-x e)
925 Re-execute the last keyboard macro defined, by making the characters
926 in the macro appear as if typed at the keyboard.
932 .B re\-read\-init\-file (C\-x C\-r)
933 Read in the contents of the \fIinputrc\fP file, and incorporate
934 any bindings or variable assignments found there.
937 Abort the current editing command and
938 ring the terminal's bell (subject to the setting of
941 .B do\-uppercase\-version (M\-a, M\-b, M\-\fIx\fP, ...)
942 If the metafied character \fIx\fP is lowercase, run the command
943 that is bound to the corresponding uppercase character.
945 .B prefix\-meta (ESC)
946 Metafy the next character typed.
953 .B undo (C\-_, C\-x C\-u)
954 Incremental undo, separately remembered for each line.
956 .B revert\-line (M\-r)
957 Undo all changes made to this line. This is like executing the
959 command enough times to return the line to its initial state.
961 .B tilde\-expand (M\-&)
962 Perform tilde expansion on the current word.
964 .B set\-mark (C\-@, M\-<space>)
965 Set the mark to the point. If a
966 numeric argument is supplied, the mark is set to that position.
968 .B exchange\-point\-and\-mark (C\-x C\-x)
969 Swap the point with the mark. The current cursor position is set to
970 the saved position, and the old cursor position is saved as the mark.
972 .B character\-search (C\-])
973 A character is read and point is moved to the next occurrence of that
974 character. A negative count searches for previous occurrences.
976 .B character\-search\-backward (M\-C\-])
977 A character is read and point is moved to the previous occurrence of that
978 character. A negative count searches for subsequent occurrences.
980 .B insert\-comment (M\-#)
981 Without a numeric argument, the value of the readline
983 variable is inserted at the beginning of the current line.
984 If a numeric argument is supplied, this command acts as a toggle: if
985 the characters at the beginning of the line do not match the value
986 of \fBcomment\-begin\fP, the value is inserted, otherwise
987 the characters in \fBcomment-begin\fP are deleted from the beginning of
989 In either case, the line is accepted as if a newline had been typed.
992 makes the current line a shell comment.
993 If a numeric argument causes the comment character to be removed, the line
994 will be executed by the shell.
997 Print all of the functions and their key bindings to the
998 readline output stream. If a numeric argument is supplied,
999 the output is formatted in such a way that it can be made part
1000 of an \fIinputrc\fP file.
1003 Print all of the settable variables and their values to the
1004 readline output stream. If a numeric argument is supplied,
1005 the output is formatted in such a way that it can be made part
1006 of an \fIinputrc\fP file.
1009 Print all of the readline key sequences bound to macros and the
1010 strings they output. If a numeric argument is supplied,
1011 the output is formatted in such a way that it can be made part
1012 of an \fIinputrc\fP file.
1014 .B emacs\-editing\-mode (C\-e)
1017 command mode, this causes a switch to
1021 .B vi\-editing\-mode (M\-C\-j)
1024 editing mode, this causes a switch to
1028 .SH DEFAULT KEY BINDINGS
1030 The following is a list of the default emacs and vi bindings.
1031 Characters with the eighth bit set are written as M\-<character>, and
1035 The printable ASCII characters not mentioned in the list of emacs
1036 standard bindings are bound to the
1038 function, which just inserts the given character into the input line.
1039 In vi insertion mode, all characters not specifically mentioned are
1042 Characters assigned to signal generation by
1044 or the terminal driver, such as C-Z or C-C,
1045 retain that function.
1046 Upper and lower case metafied characters are bound to the same function in
1047 the emacs mode meta keymap.
1048 The remaining characters are unbound, which causes readline
1049 to ring the bell (subject to the setting of the
1057 Emacs Standard bindings
1060 "C-A" beginning-of-line
1066 "C-H" backward-delete-char
1073 "C-P" previous-history
1075 "C-R" reverse-search-history
1076 "C-S" forward-search-history
1077 "C-T" transpose-chars
1078 "C-U" unix-line-discard
1080 "C-W" unix-word-rubout
1082 "C-]" character-search
1084 "\^ " to "/" self-insert
1085 "0" to "9" self-insert
1086 ":" to "~" self-insert
1087 "C-?" backward-delete-char
1092 "M-C-H" backward-kill-word
1094 "M-C-J" vi-editing-mode
1095 "M-C-M" vi-editing-mode
1097 "M-C-Y" yank-nth-arg
1099 "M-C-]" character-search-backward
1101 "M-#" insert-comment
1103 "M-*" insert-completions
1104 "M--" digit-argument
1106 "M-0" digit-argument
1107 "M-1" digit-argument
1108 "M-2" digit-argument
1109 "M-3" digit-argument
1110 "M-4" digit-argument
1111 "M-5" digit-argument
1112 "M-6" digit-argument
1113 "M-7" digit-argument
1114 "M-8" digit-argument
1115 "M-9" digit-argument
1116 "M-<" beginning-of-history
1117 "M-=" possible-completions
1118 "M->" end-of-history
1119 "M-?" possible-completions
1121 "M-C" capitalize-word
1125 "M-N" non-incremental-forward-search-history
1126 "M-P" non-incremental-reverse-search-history
1128 "M-T" transpose-words
1131 "M-\e" delete-horizontal-space
1133 "M-C-?" backward-kill-word
1136 Emacs Control-X bindings
1139 "C-XC-R" re-read-init-file
1141 "C-XC-X" exchange-point-and-mark
1142 "C-X(" start-kbd-macro
1143 "C-X)" end-kbd-macro
1144 "C-XE" call-last-kbd-macro
1145 "C-XC-?" backward-kill-line
1148 .SS VI Mode bindings
1154 VI Insert Mode functions
1157 "C-H" backward-delete-char
1161 "C-R" reverse-search-history
1162 "C-S" forward-search-history
1163 "C-T" transpose-chars
1164 "C-U" unix-line-discard
1166 "C-W" unix-word-rubout
1168 "C-[" vi-movement-mode
1170 "\^ " to "~" self-insert
1171 "C-?" backward-delete-char
1173 VI Command Mode functions
1176 "C-E" emacs-editing-mode
1184 "C-P" previous-history
1186 "C-R" reverse-search-history
1187 "C-S" forward-search-history
1188 "C-T" transpose-chars
1189 "C-U" unix-line-discard
1191 "C-W" unix-word-rubout
1202 "-" previous-history
1205 "0" beginning-of-line
1206 "1" to "9" vi-arg-digit
1216 "G" vi-fetch-history
1225 "X" backward-delete-char
1238 "i" vi-insertion-mode
1258 \fIThe Gnu Readline Library\fP, Brian Fox and Chet Ramey
1260 \fIThe Gnu History Library\fP, Brian Fox and Chet Ramey
1268 Individual \fBreadline\fP initialization file
1271 Brian Fox, Free Software Foundation
1275 Chet Ramey, Case Western Reserve University
1279 If you find a bug in
1281 you should report it. But first, you should
1282 make sure that it really is a bug, and that it appears in the latest
1285 library that you have.
1287 Once you have determined that a bug actually exists, mail a
1288 bug report to \fIbug\-readline\fP@\fIgnu.org\fP.
1289 If you have a fix, you are welcome to mail that
1290 as well! Suggestions and `philosophical' bug reports may be mailed
1291 to \fPbug-readline\fP@\fIgnu.org\fP or posted to the Usenet
1295 Comments and bug reports concerning
1296 this manual page should be directed to
1297 .IR chet@ins.CWRU.Edu .
1300 It's too big and too slow.