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