2 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
3 <!-- Created on June, 27 2002 by texi2html 1.64 -->
5 Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
6 Karl Berry <karl@freefriends.org>
7 Olaf Bachmann <obachman@mathematik.uni-kl.de>
9 Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
10 Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
14 <TITLE>GNU Readline Library:
</TITLE>
16 <META NAME=
"description" CONTENT=
"GNU Readline Library: ">
17 <META NAME=
"keywords" CONTENT=
"GNU Readline Library: ">
18 <META NAME=
"resource-type" CONTENT=
"document">
19 <META NAME=
"distribution" CONTENT=
"global">
20 <META NAME=
"Generator" CONTENT=
"texi2html 1.64">
24 <BODY LANG=
"" BGCOLOR=
"#FFFFFF" TEXT=
"#000000" LINK=
"#0000FF" VLINK=
"#800080" ALINK=
"#FF0000">
26 <A NAME=
"SEC_Top"></A>
27 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
28 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
29 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
30 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
31 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
33 <H1>GNU Readline Library
</H1></P><P>
35 This document describes the end user interface of the GNU Readline Library,
36 a utility which aids in the consistency of user interface across discrete
37 programs that need to provide a command line interface.
40 <BLOCKQUOTE><TABLE BORDER=
0 CELLSPACING=
0>
41 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC1">1. Command Line Editing
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">GNU Readline User's Manual.
</TD></TR>
47 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
48 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top"> < </A>]
</TD>
49 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC2"> > </A>]
</TD>
50 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<< ]
</TD>
51 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top"> Up
</A>]
</TD>
52 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
>> ]
</TD>
53 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
54 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
55 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
56 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
58 <A NAME=
"Command Line Editing"></A>
59 <H1> 1. Command Line Editing
</H1>
63 This chapter describes the basic features of the GNU
64 command line editing interface.
67 <BLOCKQUOTE><TABLE BORDER=
0 CELLSPACING=
0>
68 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC2">1.1 Introduction to Line Editing
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">Notation used in this text.
</TD></TR>
69 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC3">1.2 Readline Interaction
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">The minimum set of commands for editing a line.
</TD></TR>
70 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC9">1.3 Readline Init File
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">Customizing Readline from a user's view.
</TD></TR>
71 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC13">1.4 Bindable Readline Commands
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">A description of most of the Readline commands
72 available for binding
</TD></TR>
73 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC22">1.5 Readline vi Mode
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">A short description of how to make Readline
74 behave like the vi editor.
</TD></TR>
78 <A NAME=
"Introduction and Notation"></A>
81 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
82 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC1"> < </A>]
</TD>
83 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC3"> > </A>]
</TD>
84 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<< ]
</TD>
85 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC1"> Up
</A>]
</TD>
86 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
>> ]
</TD>
87 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
88 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
89 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
90 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
92 <H2> 1.1 Introduction to Line Editing
</H2>
96 The following paragraphs describe the notation used to represent
100 The text
<KBD>C-k
</KBD> is read as `Control-K' and describes the character
101 produced when the
<KBD>k
</KBD> key is pressed while the Control key
105 The text
<KBD>M-k
</KBD> is read as `Meta-K' and describes the character
106 produced when the Meta key (if you have one) is depressed, and the
<KBD>k
</KBD>
108 The Meta key is labeled
<KBD>ALT
</KBD> on many keyboards.
109 On keyboards with two keys labeled
<KBD>ALT
</KBD> (usually to either side of
110 the space bar), the
<KBD>ALT
</KBD> on the left side is generally set to
112 The
<KBD>ALT
</KBD> key on the right may also be configured to work as a
113 Meta key or may be configured as some other modifier, such as a
114 Compose key for typing accented characters.
117 If you do not have a Meta or
<KBD>ALT
</KBD> key, or another key working as
118 a Meta key, the identical keystroke can be generated by typing
<KBD>ESC
</KBD>
119 <EM>first
</EM>, and then typing
<KBD>k
</KBD>.
120 Either process is known as
<EM>metafying
</EM> the
<KBD>k
</KBD> key.
123 The text
<KBD>M-C-k
</KBD> is read as `Meta-Control-k' and describes the
124 character produced by
<EM>metafying
</EM> <KBD>C-k
</KBD>.
127 In addition, several keys have their own names. Specifically,
128 <KBD>DEL
</KBD>,
<KBD>ESC
</KBD>,
<KBD>LFD
</KBD>,
<KBD>SPC
</KBD>,
<KBD>RET
</KBD>, and
<KBD>TAB
</KBD> all
129 stand for themselves when seen in this text, or in an init file
130 (see section
<A HREF=
"rluserman.html#SEC9">1.3 Readline Init File
</A>).
131 If your keyboard lacks a
<KBD>LFD
</KBD> key, typing
<KBD>C-j
</KBD> will
132 produce the desired character.
133 The
<KBD>RET
</KBD> key may be labeled
<KBD>Return
</KBD> or
<KBD>Enter
</KBD> on
137 <A NAME=
"Readline Interaction"></A>
140 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
141 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC2"> < </A>]
</TD>
142 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC4"> > </A>]
</TD>
143 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC9"> << </A>]
</TD>
144 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC1"> Up
</A>]
</TD>
145 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC9"> >> </A>]
</TD>
146 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
147 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
148 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
149 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
151 <H2> 1.2 Readline Interaction
</H2>
155 Often during an interactive session you type in a long line of text,
156 only to notice that the first word on the line is misspelled. The
157 Readline library gives you a set of commands for manipulating the text
158 as you type it in, allowing you to just fix your typo, and not forcing
159 you to retype the majority of the line. Using these editing commands,
160 you move the cursor to the place that needs correction, and delete or
161 insert the text of the corrections. Then, when you are satisfied with
162 the line, you simply press
<KBD>RET
</KBD>. You do not have to be at the
163 end of the line to press
<KBD>RET
</KBD>; the entire line is accepted
164 regardless of the location of the cursor within the line.
167 <BLOCKQUOTE><TABLE BORDER=
0 CELLSPACING=
0>
168 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC4">1.2.1 Readline Bare Essentials
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">The least you need to know about Readline.
</TD></TR>
169 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC5">1.2.2 Readline Movement Commands
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">Moving about the input line.
</TD></TR>
170 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC6">1.2.3 Readline Killing Commands
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">How to delete text, and how to get it back!
</TD></TR>
171 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC7">1.2.4 Readline Arguments
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">Giving numeric arguments to commands.
</TD></TR>
172 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC8">1.2.5 Searching for Commands in the History
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">Searching through previous lines.
</TD></TR>
173 </TABLE></BLOCKQUOTE>
176 <A NAME=
"Readline Bare Essentials"></A>
179 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
180 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC3"> < </A>]
</TD>
181 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC5"> > </A>]
</TD>
182 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC9"> << </A>]
</TD>
183 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC3"> Up
</A>]
</TD>
184 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC9"> >> </A>]
</TD>
185 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
186 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
187 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
188 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
190 <H3> 1.2.1 Readline Bare Essentials
</H3>
194 In order to enter characters into the line, simply type them. The typed
195 character appears where the cursor was, and then the cursor moves one
196 space to the right. If you mistype a character, you can use your
197 erase character to back up and delete the mistyped character.
200 Sometimes you may mistype a character, and
201 not notice the error until you have typed several other characters. In
202 that case, you can type
<KBD>C-b
</KBD> to move the cursor to the left, and then
203 correct your mistake. Afterwards, you can move the cursor to the right
207 When you add text in the middle of a line, you will notice that characters
208 to the right of the cursor are `pushed over' to make room for the text
209 that you have inserted. Likewise, when you delete text behind the cursor,
210 characters to the right of the cursor are `pulled back' to fill in the
211 blank space created by the removal of the text. A list of the bare
212 essentials for editing the text of an input line follows.
217 <DD>Move back one character.
219 <DD>Move forward one character.
220 <DT><KBD>DEL
</KBD> or
<KBD>Backspace
</KBD>
221 <DD>Delete the character to the left of the cursor.
223 <DD>Delete the character underneath the cursor.
224 <DT>Printing characters
225 <DD>Insert the character into the line at the cursor.
226 <DT><KBD>C-_
</KBD> or
<KBD>C-x C-u
</KBD>
227 <DD>Undo the last editing command. You can undo all the way back to an
232 (Depending on your configuration, the
<KBD>Backspace
</KBD> key be set to
233 delete the character to the left of the cursor and the
<KBD>DEL
</KBD> key set
234 to delete the character underneath the cursor, like
<KBD>C-d
</KBD>, rather
235 than the character to the left of the cursor.)
238 <A NAME=
"Readline Movement Commands"></A>
241 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
242 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC4"> < </A>]
</TD>
243 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC6"> > </A>]
</TD>
244 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC6"> << </A>]
</TD>
245 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC3"> Up
</A>]
</TD>
246 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC9"> >> </A>]
</TD>
247 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
248 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
249 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
250 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
252 <H3> 1.2.2 Readline Movement Commands
</H3>
256 The above table describes the most basic keystrokes that you need
257 in order to do editing of the input line. For your convenience, many
258 other commands have been added in addition to
<KBD>C-b
</KBD>,
<KBD>C-f
</KBD>,
259 <KBD>C-d
</KBD>, and
<KBD>DEL
</KBD>. Here are some commands for moving more rapidly
265 <DD>Move to the start of the line.
267 <DD>Move to the end of the line.
269 <DD>Move forward a word, where a word is composed of letters and digits.
271 <DD>Move backward a word.
273 <DD>Clear the screen, reprinting the current line at the top.
277 Notice how
<KBD>C-f
</KBD> moves forward a character, while
<KBD>M-f
</KBD> moves
278 forward a word. It is a loose convention that control keystrokes
279 operate on characters while meta keystrokes operate on words.
282 <A NAME=
"Readline Killing Commands"></A>
285 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
286 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC5"> < </A>]
</TD>
287 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC7"> > </A>]
</TD>
288 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC7"> << </A>]
</TD>
289 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC3"> Up
</A>]
</TD>
290 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC9"> >> </A>]
</TD>
291 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
292 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
293 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
294 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
296 <H3> 1.2.3 Readline Killing Commands
</H3>
304 <EM>Killing
</EM> text means to delete the text from the line, but to save
305 it away for later use, usually by
<EM>yanking
</EM> (re-inserting)
306 it back into the line.
307 (`Cut' and `paste' are more recent jargon for `kill' and `yank'.)
310 If the description for a command says that it `kills' text, then you can
311 be sure that you can get the text back in a different (or the same)
315 When you use a kill command, the text is saved in a
<EM>kill-ring
</EM>.
316 Any number of consecutive kills save all of the killed text together, so
317 that when you yank it back, you get it all. The kill
318 ring is not line specific; the text that you killed on a previously
319 typed line is available to be yanked back later, when you are typing
324 Here is the list of commands for killing text.
329 <DD>Kill the text from the current cursor position to the end of the line.
333 <DD>Kill from the cursor to the end of the current word, or, if between
334 words, to the end of the next word.
335 Word boundaries are the same as those used by
<KBD>M-f
</KBD>.
338 <DT><KBD>M-
<KBD>DEL
</KBD></KBD>
339 <DD>Kill from the cursor the start of the current word, or, if between
340 words, to the start of the previous word.
341 Word boundaries are the same as those used by
<KBD>M-b
</KBD>.
345 <DD>Kill from the cursor to the previous whitespace. This is different than
346 <KBD>M-
<KBD>DEL
</KBD></KBD> because the word boundaries differ.
352 Here is how to
<EM>yank
</EM> the text back into the line. Yanking
353 means to copy the most-recently-killed text from the kill buffer.
358 <DD>Yank the most recently killed text back into the buffer at the cursor.
362 <DD>Rotate the kill-ring, and yank the new top. You can only do this if
363 the prior command is
<KBD>C-y
</KBD> or
<KBD>M-y
</KBD>.
367 <A NAME=
"Readline Arguments"></A>
370 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
371 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC6"> < </A>]
</TD>
372 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC8"> > </A>]
</TD>
373 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC8"> << </A>]
</TD>
374 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC3"> Up
</A>]
</TD>
375 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC9"> >> </A>]
</TD>
376 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
377 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
378 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
379 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
381 <H3> 1.2.4 Readline Arguments
</H3>
385 You can pass numeric arguments to Readline commands. Sometimes the
386 argument acts as a repeat count, other times it is the
<I>sign
</I> of the
387 argument that is significant. If you pass a negative argument to a
388 command which normally acts in a forward direction, that command will
389 act in a backward direction. For example, to kill text back to the
390 start of the line, you might type
<SAMP>`M-- C-k'
</SAMP>.
393 The general way to pass numeric arguments to a command is to type meta
394 digits before the command. If the first `digit' typed is a minus
395 sign (
<SAMP>`-'
</SAMP>), then the sign of the argument will be negative. Once
396 you have typed one meta digit to get the argument started, you can type
397 the remainder of the digits, and then the command. For example, to give
398 the
<KBD>C-d
</KBD> command an argument of
10, you could type
<SAMP>`M-
1 0 C-d'
</SAMP>,
399 which will delete the next ten characters on the input line.
402 <A NAME=
"Searching"></A>
405 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
406 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC7"> < </A>]
</TD>
407 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC9"> > </A>]
</TD>
408 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC9"> << </A>]
</TD>
409 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC3"> Up
</A>]
</TD>
410 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC9"> >> </A>]
</TD>
411 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
412 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
413 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
414 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
416 <H3> 1.2.5 Searching for Commands in the History
</H3>
420 Readline provides commands for searching through the command history
421 for lines containing a specified string.
422 There are two search modes:
<EM>incremental
</EM> and
<EM>non-incremental
</EM>.
425 Incremental searches begin before the user has finished typing the
427 As each character of the search string is typed, Readline displays
428 the next entry from the history matching the string typed so far.
429 An incremental search requires only as many characters as needed to
430 find the desired history entry.
431 To search backward in the history for a particular string, type
432 <KBD>C-r
</KBD>. Typing
<KBD>C-s
</KBD> searches forward through the history.
433 The characters present in the value of the
<CODE>isearch-terminators
</CODE> variable
434 are used to terminate an incremental search.
435 If that variable has not been assigned a value, the
<KBD>ESC
</KBD> and
436 <KBD>C-J
</KBD> characters will terminate an incremental search.
437 <KBD>C-g
</KBD> will abort an incremental search and restore the original line.
438 When the search is terminated, the history entry containing the
439 search string becomes the current line.
442 To find other matching entries in the history list, type
<KBD>C-r
</KBD> or
443 <KBD>C-s
</KBD> as appropriate.
444 This will search backward or forward in the history for the next
445 entry matching the search string typed so far.
446 Any other key sequence bound to a Readline command will terminate
447 the search and execute that command.
448 For instance, a
<KBD>RET
</KBD> will terminate the search and accept
449 the line, thereby executing the command from the history list.
450 A movement command will terminate the search, make the last line found
451 the current line, and begin editing.
454 Readline remembers the last incremental search string. If two
455 <KBD>C-r
</KBD>s are typed without any intervening characters defining a new
456 search string, any remembered search string is used.
459 Non-incremental searches read the entire search string before starting
460 to search for matching history lines. The search string may be
461 typed by the user or be part of the contents of the current line.
464 <A NAME=
"Readline Init File"></A>
467 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
468 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC8"> < </A>]
</TD>
469 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC10"> > </A>]
</TD>
470 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC13"> << </A>]
</TD>
471 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC1"> Up
</A>]
</TD>
472 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC13"> >> </A>]
</TD>
473 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
474 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
475 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
476 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
478 <H2> 1.3 Readline Init File
</H2>
482 Although the Readline library comes with a set of Emacs-like
483 keybindings installed by default, it is possible to use a different set
485 Any user can customize programs that use Readline by putting
486 commands in an
<EM>inputrc
</EM> file, conventionally in his home directory.
488 file is taken from the value of the environment variable
<CODE>INPUTRC
</CODE>. If
489 that variable is unset, the default is
<TT>`~/.inputrc'
</TT>.
492 When a program which uses the Readline library starts up, the
493 init file is read, and the key bindings are set.
496 In addition, the
<CODE>C-x C-r
</CODE> command re-reads this init file, thus
497 incorporating any changes that you might have made to it.
500 <BLOCKQUOTE><TABLE BORDER=
0 CELLSPACING=
0>
501 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC10">1.3.1 Readline Init File Syntax
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">Syntax for the commands in the inputrc file.
</TD></TR>
505 <TABLE BORDER=
0 CELLSPACING=
0>
506 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC11">1.3.2 Conditional Init Constructs
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">Conditional key bindings in the inputrc file.
</TD></TR>
510 <TABLE BORDER=
0 CELLSPACING=
0>
511 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC12">1.3.3 Sample Init File
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">An example inputrc file.
</TD></TR>
512 </TABLE></BLOCKQUOTE>
515 <A NAME=
"Readline Init File Syntax"></A>
518 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
519 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC9"> < </A>]
</TD>
520 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC11"> > </A>]
</TD>
521 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC13"> << </A>]
</TD>
522 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC9"> Up
</A>]
</TD>
523 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC13"> >> </A>]
</TD>
524 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
525 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
526 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
527 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
529 <H3> 1.3.1 Readline Init File Syntax
</H3>
530 <!--docid::SEC10::-->
533 There are only a few basic constructs allowed in the
534 Readline init file. Blank lines are ignored.
535 Lines beginning with a
<SAMP>`#'
</SAMP> are comments.
536 Lines beginning with a
<SAMP>`$'
</SAMP> indicate conditional
537 constructs (see section
<A HREF=
"rluserman.html#SEC11">1.3.2 Conditional Init Constructs
</A>). Other lines
538 denote variable settings and key bindings.
542 <DT>Variable Settings
543 <DD>You can modify the run-time behavior of Readline by
544 altering the values of variables in Readline
545 using the
<CODE>set
</CODE> command within the init file.
546 The syntax is simple:
549 <TABLE><tr><td> </td><td class=example
><pre>set
<VAR>variable
</VAR> <VAR>value
</VAR>
550 </pre></td></tr></table></P><P>
552 Here, for example, is how to
553 change from the default Emacs-like key binding to use
554 <CODE>vi
</CODE> line editing commands:
557 <TABLE><tr><td> </td><td class=example
><pre>set editing-mode vi
558 </pre></td></tr></table></P><P>
560 Variable names and values, where appropriate, are recognized without regard
564 A great deal of run-time behavior is changeable with the following
571 <DT><CODE>bell-style
</CODE>
572 <DD><A NAME=
"IDX5"></A>
573 Controls what happens when Readline wants to ring the terminal bell.
574 If set to
<SAMP>`none'
</SAMP>, Readline never rings the bell. If set to
575 <SAMP>`visible'
</SAMP>, Readline uses a visible bell if one is available.
576 If set to
<SAMP>`audible'
</SAMP> (the default), Readline attempts to ring
580 <DT><CODE>comment-begin
</CODE>
581 <DD><A NAME=
"IDX6"></A>
582 The string to insert at the beginning of the line when the
583 <CODE>insert-comment
</CODE> command is executed. The default value
587 <DT><CODE>completion-ignore-case
</CODE>
588 <DD>If set to
<SAMP>`on'
</SAMP>, Readline performs filename matching and completion
589 in a case-insensitive fashion.
590 The default value is
<SAMP>`off'
</SAMP>.
593 <DT><CODE>completion-query-items
</CODE>
594 <DD><A NAME=
"IDX7"></A>
595 The number of possible completions that determines when the user is
596 asked whether he wants to see the list of possibilities. If the
597 number of possible completions is greater than this value,
598 Readline will ask the user whether or not he wishes to view
599 them; otherwise, they are simply listed.
600 This variable must be set to an integer value greater than or equal to
0.
601 The default limit is
<CODE>100</CODE>.
604 <DT><CODE>convert-meta
</CODE>
605 <DD><A NAME=
"IDX8"></A>
606 If set to
<SAMP>`on'
</SAMP>, Readline will convert characters with the
607 eighth bit set to an ASCII key sequence by stripping the eighth
608 bit and prefixing an
<KBD>ESC
</KBD> character, converting them to a
609 meta-prefixed key sequence. The default value is
<SAMP>`on'
</SAMP>.
612 <DT><CODE>disable-completion
</CODE>
613 <DD><A NAME=
"IDX9"></A>
614 If set to
<SAMP>`On'
</SAMP>, Readline will inhibit word completion.
615 Completion characters will be inserted into the line as if they had
616 been mapped to
<CODE>self-insert
</CODE>. The default is
<SAMP>`off'
</SAMP>.
619 <DT><CODE>editing-mode
</CODE>
620 <DD><A NAME=
"IDX10"></A>
621 The
<CODE>editing-mode
</CODE> variable controls which default set of
622 key bindings is used. By default, Readline starts up in Emacs editing
623 mode, where the keystrokes are most similar to Emacs. This variable can be
624 set to either
<SAMP>`emacs'
</SAMP> or
<SAMP>`vi'
</SAMP>.
627 <DT><CODE>enable-keypad
</CODE>
628 <DD><A NAME=
"IDX11"></A>
629 When set to
<SAMP>`on'
</SAMP>, Readline will try to enable the application
630 keypad when it is called. Some systems need this to enable the
631 arrow keys. The default is
<SAMP>`off'
</SAMP>.
634 <DT><CODE>expand-tilde
</CODE>
635 <DD><A NAME=
"IDX12"></A>
636 If set to
<SAMP>`on'
</SAMP>, tilde expansion is performed when Readline
637 attempts word completion. The default is
<SAMP>`off'
</SAMP>.
641 If set to
<SAMP>`on'
</SAMP>, the history code attempts to place point at the
642 same location on each history line retrived with
<CODE>previous-history
</CODE>
643 or
<CODE>next-history
</CODE>.
646 <DT><CODE>horizontal-scroll-mode
</CODE>
647 <DD><A NAME=
"IDX14"></A>
648 This variable can be set to either
<SAMP>`on'
</SAMP> or
<SAMP>`off'
</SAMP>. Setting it
649 to
<SAMP>`on'
</SAMP> means that the text of the lines being edited will scroll
650 horizontally on a single screen line when they are longer than the width
651 of the screen, instead of wrapping onto a new screen line. By default,
652 this variable is set to
<SAMP>`off'
</SAMP>.
655 <DT><CODE>input-meta
</CODE>
656 <DD><A NAME=
"IDX15"></A>
658 If set to
<SAMP>`on'
</SAMP>, Readline will enable eight-bit input (it
659 will not clear the eighth bit in the characters it reads),
660 regardless of what the terminal claims it can support. The
661 default value is
<SAMP>`off'
</SAMP>. The name
<CODE>meta-flag
</CODE> is a
662 synonym for this variable.
665 <DT><CODE>isearch-terminators
</CODE>
666 <DD><A NAME=
"IDX17"></A>
667 The string of characters that should terminate an incremental search without
668 subsequently executing the character as a command (see section
<A HREF=
"rluserman.html#SEC8">1.2.5 Searching for Commands in the History
</A>).
669 If this variable has not been given a value, the characters
<KBD>ESC
</KBD> and
670 <KBD>C-J
</KBD> will terminate an incremental search.
673 <DT><CODE>keymap
</CODE>
674 <DD><A NAME=
"IDX18"></A>
675 Sets Readline's idea of the current keymap for key binding commands.
676 Acceptable
<CODE>keymap
</CODE> names are
678 <CODE>emacs-standard
</CODE>,
679 <CODE>emacs-meta
</CODE>,
680 <CODE>emacs-ctlx
</CODE>,
682 <CODE>vi-move
</CODE>,
683 <CODE>vi-command
</CODE>, and
684 <CODE>vi-insert
</CODE>.
685 <CODE>vi
</CODE> is equivalent to
<CODE>vi-command
</CODE>;
<CODE>emacs
</CODE> is
686 equivalent to
<CODE>emacs-standard
</CODE>. The default value is
<CODE>emacs
</CODE>.
687 The value of the
<CODE>editing-mode
</CODE> variable also affects the
691 <DT><CODE>mark-directories
</CODE>
692 <DD>If set to
<SAMP>`on'
</SAMP>, completed directory names have a slash
693 appended. The default is
<SAMP>`on'
</SAMP>.
696 <DT><CODE>mark-modified-lines
</CODE>
697 <DD><A NAME=
"IDX19"></A>
698 This variable, when set to
<SAMP>`on'
</SAMP>, causes Readline to display an
699 asterisk (
<SAMP>`*'
</SAMP>) at the start of history lines which have been modified.
700 This variable is
<SAMP>`off'
</SAMP> by default.
703 <DT><CODE>mark-symlinked-directories
</CODE>
704 <DD><A NAME=
"IDX20"></A>
705 If set to
<SAMP>`on'
</SAMP>, completed names which are symbolic links
706 to directories have a slash appended (subject to the value of
707 <CODE>mark-directories
</CODE>).
708 The default is
<SAMP>`off'
</SAMP>.
711 <DT><CODE>match-hidden-files
</CODE>
712 <DD><A NAME=
"IDX21"></A>
713 This variable, when set to
<SAMP>`on'
</SAMP>, causes Readline to match files whose
714 names begin with a
<SAMP>`.'
</SAMP> (hidden files) when performing filename
715 completion, unless the leading
<SAMP>`.'
</SAMP> is
716 supplied by the user in the filename to be completed.
717 This variable is
<SAMP>`on'
</SAMP> by default.
720 <DT><CODE>output-meta
</CODE>
721 <DD><A NAME=
"IDX22"></A>
722 If set to
<SAMP>`on'
</SAMP>, Readline will display characters with the
723 eighth bit set directly rather than as a meta-prefixed escape
724 sequence. The default is
<SAMP>`off'
</SAMP>.
727 <DT><CODE>page-completions
</CODE>
728 <DD><A NAME=
"IDX23"></A>
729 If set to
<SAMP>`on'
</SAMP>, Readline uses an internal
<CODE>more
</CODE>-like pager
730 to display a screenful of possible completions at a time.
731 This variable is
<SAMP>`on'
</SAMP> by default.
734 <DT><CODE>print-completions-horizontally
</CODE>
735 <DD>If set to
<SAMP>`on'
</SAMP>, Readline will display completions with matches
736 sorted horizontally in alphabetical order, rather than down the screen.
737 The default is
<SAMP>`off'
</SAMP>.
740 <DT><CODE>show-all-if-ambiguous
</CODE>
741 <DD><A NAME=
"IDX24"></A>
742 This alters the default behavior of the completion functions. If
743 set to
<SAMP>`on'
</SAMP>,
744 words which have more than one possible completion cause the
745 matches to be listed immediately instead of ringing the bell.
746 The default value is
<SAMP>`off'
</SAMP>.
749 <DT><CODE>visible-stats
</CODE>
750 <DD><A NAME=
"IDX25"></A>
751 If set to
<SAMP>`on'
</SAMP>, a character denoting a file's type
752 is appended to the filename when listing possible
753 completions. The default is
<SAMP>`off'
</SAMP>.
760 <DD>The syntax for controlling key bindings in the init file is
761 simple. First you need to find the name of the command that you
762 want to change. The following sections contain tables of the command
763 name, the default keybinding, if any, and a short description of what
767 Once you know the name of the command, simply place on a line
768 in the init file the name of the key
769 you wish to bind the command to, a colon, and then the name of the
770 command. The name of the key
771 can be expressed in different ways, depending on what you find most
775 In addition to command names, readline allows keys to be bound
776 to a string that is inserted when the key is pressed (a
<VAR>macro
</VAR>).
780 <DT><VAR>keyname
</VAR>:
<VAR>function-name
</VAR> or
<VAR>macro
</VAR>
781 <DD><VAR>keyname
</VAR> is the name of a key spelled out in English. For example:
782 <TABLE><tr><td> </td><td class=example
><pre>Control-u: universal-argument
783 Meta-Rubout: backward-kill-word
784 Control-o:
"> output"
785 </pre></td></tr></table><P>
787 In the above example,
<KBD>C-u
</KBD> is bound to the function
788 <CODE>universal-argument
</CODE>,
789 <KBD>M-DEL
</KBD> is bound to the function
<CODE>backward-kill-word
</CODE>, and
790 <KBD>C-o
</KBD> is bound to run the macro
791 expressed on the right hand side (that is, to insert the text
792 <SAMP>`
> output'
</SAMP> into the line).
795 A number of symbolic character names are recognized while
796 processing this key binding syntax:
811 <DT>"<VAR>keyseq</VAR>":
<VAR>function-name
</VAR> or
<VAR>macro
</VAR>
812 <DD><VAR>keyseq
</VAR> differs from
<VAR>keyname
</VAR> above in that strings
813 denoting an entire key sequence can be specified, by placing
814 the key sequence in double quotes. Some GNU Emacs style key
815 escapes can be used, as in the following example, but the
816 special character names are not recognized.
819 <TABLE><tr><td> </td><td class=example
><pre>"\C-u": universal-argument
820 "\C-x\C-r": re-read-init-file
821 "\e[11~":
"Function Key 1"
822 </pre></td></tr></table></P><P>
824 In the above example,
<KBD>C-u
</KBD> is again bound to the function
825 <CODE>universal-argument
</CODE> (just as it was in the first example),
826 <SAMP>`
<KBD>C-x
</KBD> <KBD>C-r
</KBD>'
</SAMP> is bound to the function
<CODE>re-read-init-file
</CODE>,
827 and
<SAMP>`
<KBD>ESC
</KBD> <KBD>[
</KBD> <KBD>1</KBD> <KBD>1</KBD> <KBD>~
</KBD>'
</SAMP> is bound to insert
828 the text
<SAMP>`Function Key
1'
</SAMP>.
834 The following GNU Emacs style escape sequences are available when
835 specifying key sequences:
839 <DT><CODE><KBD>\C-
</KBD></CODE>
841 <DT><CODE><KBD>\M-
</KBD></CODE>
843 <DT><CODE><KBD>\e
</KBD></CODE>
844 <DD>an escape character
845 <DT><CODE><KBD>\\
</KBD></CODE>
847 <DT><CODE><KBD>\
"</KBD></CODE>
848 <DD><KBD>"</KBD>, a double quotation mark
849 <DT><CODE><KBD>\'
</KBD></CODE>
850 <DD><KBD>'
</KBD>, a single quote or apostrophe
854 In addition to the GNU Emacs style escape sequences, a second
855 set of backslash escapes is available:
875 <DT><CODE>\
<VAR>nnn
</VAR></CODE>
876 <DD>the eight-bit character whose value is the octal value
<VAR>nnn
</VAR>
877 (one to three digits)
878 <DT><CODE>\x
<VAR>HH
</VAR></CODE>
879 <DD>the eight-bit character whose value is the hexadecimal value
<VAR>HH
</VAR>
880 (one or two hex digits)
884 When entering the text of a macro, single or double quotes must
885 be used to indicate a macro definition.
886 Unquoted text is assumed to be a function name.
887 In the macro body, the backslash escapes described above are expanded.
888 Backslash will quote any other character in the macro text,
889 including
<SAMP>`
"'</SAMP> and <SAMP>`''</SAMP>.
890 For example, the following binding will make <SAMP>`<KBD>C-x</KBD> \'</SAMP>
891 insert a single <SAMP>`\'</SAMP> into the line:
892 <TABLE><tr><td> </td><td class=example><pre>"\C-x\\
": "\\
"
893 </pre></td></tr></table></P><P>
898 <A NAME="Conditional Init Constructs
"></A>
901 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
902 <TR><TD VALIGN="MIDDLE
" ALIGN="LEFT
">[<A HREF="rluserman.html#SEC10
"> < </A>]</TD>
903 <TD VALIGN="MIDDLE
" ALIGN="LEFT
">[<A HREF="rluserman.html#SEC12
"> > </A>]</TD>
904 <TD VALIGN="MIDDLE
" ALIGN="LEFT
"> <TD VALIGN="MIDDLE
" ALIGN="LEFT
">[<A HREF="rluserman.html#SEC12
"> << </A>]</TD>
905 <TD VALIGN="MIDDLE
" ALIGN="LEFT
">[<A HREF="rluserman.html#SEC9
"> Up </A>]</TD>
906 <TD VALIGN="MIDDLE
" ALIGN="LEFT
">[<A HREF="rluserman.html#SEC13
"> >> </A>]</TD>
907 <TD VALIGN="MIDDLE
" ALIGN="LEFT
"> <TD VALIGN="MIDDLE
" ALIGN="LEFT
"> <TD VALIGN="MIDDLE
" ALIGN="LEFT
"> <TD VALIGN="MIDDLE
" ALIGN="LEFT
"> <TD VALIGN="MIDDLE
" ALIGN="LEFT
">[<A HREF="rluserman.html#SEC_Top
">Top</A>]</TD>
908 <TD VALIGN="MIDDLE
" ALIGN="LEFT
">[<A HREF="rluserman.html#SEC_Contents
">Contents</A>]</TD>
909 <TD VALIGN="MIDDLE
" ALIGN="LEFT
">[Index]</TD>
910 <TD VALIGN="MIDDLE
" ALIGN="LEFT
">[<A HREF="rluserman.html#SEC_About
"> ? </A>]</TD>
912 <H3> 1.3.2 Conditional Init Constructs </H3>
913 <!--docid::SEC11::-->
916 Readline implements a facility similar in spirit to the conditional
917 compilation features of the C preprocessor which allows key
918 bindings and variable settings to be performed as the result
919 of tests. There are four parser directives used.
924 <DD>The <CODE>$if</CODE> construct allows bindings to be made based on the
925 editing mode, the terminal being used, or the application using
926 Readline. The text of the test extends to the end of the line;
927 no characters are required to isolate it.
931 <DT><CODE>mode</CODE>
932 <DD>The <CODE>mode=</CODE> form of the <CODE>$if</CODE> directive is used to test
933 whether Readline is in <CODE>emacs</CODE> or <CODE>vi</CODE> mode.
934 This may be used in conjunction
935 with the <SAMP>`set keymap'</SAMP> command, for instance, to set bindings in
936 the <CODE>emacs-standard</CODE> and <CODE>emacs-ctlx</CODE> keymaps only if
937 Readline is starting out in <CODE>emacs</CODE> mode.
940 <DT><CODE>term</CODE>
941 <DD>The <CODE>term=</CODE> form may be used to include terminal-specific
942 key bindings, perhaps to bind the key sequences output by the
943 terminal's function keys. The word on the right side of the
944 <SAMP>`='</SAMP> is tested against both the full name of the terminal and
945 the portion of the terminal name before the first <SAMP>`-'</SAMP>. This
946 allows <CODE>sun</CODE> to match both <CODE>sun</CODE> and <CODE>sun-cmd</CODE>,
950 <DT><CODE>application</CODE>
951 <DD>The <VAR>application</VAR> construct is used to include
952 application-specific settings. Each program using the Readline
953 library sets the <VAR>application name</VAR>, and you can test for
955 This could be used to bind key sequences to functions useful for
956 a specific program. For instance, the following command adds a
957 key sequence that quotes the current or previous word in Bash:
958 <TABLE><tr><td> </td><td class=example><pre>$if Bash
959 # Quote the current or previous word
960 "\C-xq
": "\eb\
"\ef\""
962 </pre></td></tr></table></DL>
965 <DT><CODE>$endif</CODE>
966 <DD>This command, as seen in the previous example, terminates an
967 <CODE>$if</CODE> command.
970 <DT><CODE>$else</CODE>
971 <DD>Commands in this branch of the <CODE>$if</CODE> directive are executed if
975 <DT><CODE>$include</CODE>
976 <DD>This directive takes a single filename as an argument and reads commands
977 and bindings from that file.
978 For example, the following directive reads from <TT>`/etc/inputrc'</TT>:
979 <TABLE><tr><td> </td><td class=example><pre>$include /etc/inputrc
980 </pre></td></tr></table></DL>
983 <A NAME="Sample Init File
"></A>
986 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
987 <TR><TD VALIGN="MIDDLE
" ALIGN="LEFT
">[<A HREF="rluserman.html#SEC11
"> < </A>]</TD>
988 <TD VALIGN="MIDDLE
" ALIGN="LEFT
">[<A HREF="rluserman.html#SEC13
"> > </A>]</TD>
989 <TD VALIGN="MIDDLE
" ALIGN="LEFT
"> <TD VALIGN="MIDDLE
" ALIGN="LEFT
">[<A HREF="rluserman.html#SEC13
"> << </A>]</TD>
990 <TD VALIGN="MIDDLE
" ALIGN="LEFT
">[<A HREF="rluserman.html#SEC9
"> Up </A>]</TD>
991 <TD VALIGN="MIDDLE
" ALIGN="LEFT
">[<A HREF="rluserman.html#SEC13
"> >> </A>]</TD>
992 <TD VALIGN="MIDDLE
" ALIGN="LEFT
"> <TD VALIGN="MIDDLE
" ALIGN="LEFT
"> <TD VALIGN="MIDDLE
" ALIGN="LEFT
"> <TD VALIGN="MIDDLE
" ALIGN="LEFT
"> <TD VALIGN="MIDDLE
" ALIGN="LEFT
">[<A HREF="rluserman.html#SEC_Top
">Top</A>]</TD>
993 <TD VALIGN="MIDDLE
" ALIGN="LEFT
">[<A HREF="rluserman.html#SEC_Contents
">Contents</A>]</TD>
994 <TD VALIGN="MIDDLE
" ALIGN="LEFT
">[Index]</TD>
995 <TD VALIGN="MIDDLE
" ALIGN="LEFT
">[<A HREF="rluserman.html#SEC_About
"> ? </A>]</TD>
997 <H3> 1.3.3 Sample Init File </H3>
998 <!--docid::SEC12::-->
1001 Here is an example of an <VAR>inputrc</VAR> file. This illustrates key
1002 binding, variable assignment, and conditional syntax.
1005 <TABLE><tr><td> </td><td class=example><pre># This file controls the behaviour of line input editing for
1006 # programs that use the GNU Readline library. Existing
1007 # programs include FTP, Bash, and GDB.
1009 # You can re-read the inputrc file with C-x C-r.
1010 # Lines beginning with '#' are comments.
1012 # First, include any systemwide bindings and variable
1013 # assignments from /etc/Inputrc
1014 $include /etc/Inputrc
1017 # Set various bindings for emacs mode.
1019 set editing-mode emacs
1023 Meta-Control-h: backward-kill-word Text after the function name is ignored
1026 # Arrow keys in keypad mode
1028 #"\M-OD
": backward-char
1029 #"\M-OC
": forward-char
1030 #"\M-OA
": previous-history
1031 #"\M-OB
": next-history
1033 # Arrow keys in ANSI mode
1035 "\M-[D
": backward-char
1036 "\M-[C
": forward-char
1037 "\M-[A
": previous-history
1038 "\M-[B
": next-history
1040 # Arrow keys in 8 bit keypad mode
1042 #"\M-\C-OD
": backward-char
1043 #"\M-\C-OC
": forward-char
1044 #"\M-\C-OA
": previous-history
1045 #"\M-\C-OB
": next-history
1047 # Arrow keys in 8 bit ANSI mode
1049 #"\M-\C-[D
": backward-char
1050 #"\M-\C-[C
": forward-char
1051 #"\M-\C-[A
": previous-history
1052 #"\M-\C-[B
": next-history
1058 # An old-style binding. This happens to be the default.
1061 # Macros that are convenient for shell interaction
1064 "\C-xp
": "PATH=${PATH}\e\C-e\C-a\ef\C-f
"
1065 # prepare to type a quoted word --
1066 # insert open and close double quotes
1067 # and move to just after the open quote
1068 "\C-x\
"":
"\"\
"\C-b"
1069 # insert a backslash (testing backslash escapes
1070 # in sequences and macros)
1072 # Quote the current or previous word
1073 "\C-xq":
"\eb\"\ef\
""
1074 # Add a binding to refresh the line, which is unbound
1075 "\C-xr": redraw-current-line
1076 # Edit variable on current line.
1077 "\M-\C-v":
"\C-a\C-k$\C-y\M-\C-e\C-a\C-y="
1080 # use a visible bell if one is available
1081 set bell-style visible
1083 # don't strip characters to
7 bits when reading
1086 # allow iso-latin1 characters to be inserted rather
1087 # than converted to prefix-meta sequences
1088 set convert-meta off
1090 # display characters with the eighth bit set directly
1091 # rather than as meta-prefixed characters
1094 # if there are more than
150 possible completions for
1095 # a word, ask the user if he wants to see all of them
1096 set completion-query-items
150
1102 "\M-.": yank-last-arg
1104 </pre></td></tr></table></P><P>
1106 <A NAME=
"Bindable Readline Commands"></A>
1108 <A NAME=
"SEC13"></A>
1109 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
1110 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC12"> < </A>]
</TD>
1111 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC14"> > </A>]
</TD>
1112 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC22"> << </A>]
</TD>
1113 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC1"> Up
</A>]
</TD>
1114 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC22"> >> </A>]
</TD>
1115 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
1116 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
1117 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
1118 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
1120 <H2> 1.4 Bindable Readline Commands
</H2>
1121 <!--docid::SEC13::-->
1124 <BLOCKQUOTE><TABLE BORDER=
0 CELLSPACING=
0>
1125 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC14">1.4.1 Commands For Moving
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">Moving about the line.
</TD></TR>
1126 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC15">1.4.2 Commands For Manipulating The History
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">Getting at previous lines.
</TD></TR>
1127 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC16">1.4.3 Commands For Changing Text
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">Commands for changing text.
</TD></TR>
1128 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC17">1.4.4 Killing And Yanking
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">Commands for killing and yanking.
</TD></TR>
1129 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC18">1.4.5 Specifying Numeric Arguments
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">Specifying numeric arguments, repeat counts.
</TD></TR>
1130 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC19">1.4.6 Letting Readline Type For You
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">Getting Readline to do the typing for you.
</TD></TR>
1131 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC20">1.4.7 Keyboard Macros
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">Saving and re-executing typed characters
</TD></TR>
1132 <TR><TD ALIGN=
"left" VALIGN=
"TOP"><A HREF=
"rluserman.html#SEC21">1.4.8 Some Miscellaneous Commands
</A></TD><TD> </TD><TD ALIGN=
"left" VALIGN=
"TOP">Other miscellaneous commands.
</TD></TR>
1133 </TABLE></BLOCKQUOTE>
1136 This section describes Readline commands that may be bound to key
1138 Command names without an accompanying key sequence are unbound by default.
1141 In the following descriptions,
<EM>point
</EM> refers to the current cursor
1142 position, and
<EM>mark
</EM> refers to a cursor position saved by the
1143 <CODE>set-mark
</CODE> command.
1144 The text between the point and mark is referred to as the
<EM>region
</EM>.
1147 <A NAME=
"Commands For Moving"></A>
1149 <A NAME=
"SEC14"></A>
1150 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
1151 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC13"> < </A>]
</TD>
1152 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC15"> > </A>]
</TD>
1153 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC22"> << </A>]
</TD>
1154 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC13"> Up
</A>]
</TD>
1155 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC22"> >> </A>]
</TD>
1156 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
1157 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
1158 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
1159 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
1161 <H3> 1.4.1 Commands For Moving
</H3>
1162 <!--docid::SEC14::-->
1164 <A NAME=
"IDX26"></A>
1165 <DT><CODE>beginning-of-line (C-a)
</CODE>
1166 <DD><A NAME=
"IDX27"></A>
1167 Move to the start of the current line.
1170 <A NAME=
"IDX28"></A>
1171 <DT><CODE>end-of-line (C-e)
</CODE>
1172 <DD><A NAME=
"IDX29"></A>
1173 Move to the end of the line.
1176 <A NAME=
"IDX30"></A>
1177 <DT><CODE>forward-char (C-f)
</CODE>
1178 <DD><A NAME=
"IDX31"></A>
1179 Move forward a character.
1182 <A NAME=
"IDX32"></A>
1183 <DT><CODE>backward-char (C-b)
</CODE>
1184 <DD><A NAME=
"IDX33"></A>
1185 Move back a character.
1188 <A NAME=
"IDX34"></A>
1189 <DT><CODE>forward-word (M-f)
</CODE>
1190 <DD><A NAME=
"IDX35"></A>
1191 Move forward to the end of the next word. Words are composed of
1195 <A NAME=
"IDX36"></A>
1196 <DT><CODE>backward-word (M-b)
</CODE>
1197 <DD><A NAME=
"IDX37"></A>
1198 Move back to the start of the current or previous word. Words are
1199 composed of letters and digits.
1202 <A NAME=
"IDX38"></A>
1203 <DT><CODE>clear-screen (C-l)
</CODE>
1204 <DD><A NAME=
"IDX39"></A>
1205 Clear the screen and redraw the current line,
1206 leaving the current line at the top of the screen.
1209 <A NAME=
"IDX40"></A>
1210 <DT><CODE>redraw-current-line ()
</CODE>
1211 <DD><A NAME=
"IDX41"></A>
1212 Refresh the current line. By default, this is unbound.
1218 <A NAME=
"Commands For History"></A>
1220 <A NAME=
"SEC15"></A>
1221 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
1222 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC14"> < </A>]
</TD>
1223 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC16"> > </A>]
</TD>
1224 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC16"> << </A>]
</TD>
1225 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC13"> Up
</A>]
</TD>
1226 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC22"> >> </A>]
</TD>
1227 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
1228 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
1229 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
1230 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
1232 <H3> 1.4.2 Commands For Manipulating The History
</H3>
1233 <!--docid::SEC15::-->
1237 <A NAME=
"IDX42"></A>
1238 <DT><CODE>accept-line (Newline or Return)
</CODE>
1239 <DD><A NAME=
"IDX43"></A>
1240 Accept the line regardless of where the cursor is.
1242 non-empty, it may be added to the history list for future recall with
1243 <CODE>add_history()
</CODE>.
1244 If this line is a modified history line, the history line is restored
1245 to its original state.
1248 <A NAME=
"IDX44"></A>
1249 <DT><CODE>previous-history (C-p)
</CODE>
1250 <DD><A NAME=
"IDX45"></A>
1251 Move `back' through the history list, fetching the previous command.
1254 <A NAME=
"IDX46"></A>
1255 <DT><CODE>next-history (C-n)
</CODE>
1256 <DD><A NAME=
"IDX47"></A>
1257 Move `forward' through the history list, fetching the next command.
1260 <A NAME=
"IDX48"></A>
1261 <DT><CODE>beginning-of-history (M-
<)
</CODE>
1262 <DD><A NAME=
"IDX49"></A>
1263 Move to the first line in the history.
1266 <A NAME=
"IDX50"></A>
1267 <DT><CODE>end-of-history (M-
>)
</CODE>
1268 <DD><A NAME=
"IDX51"></A>
1269 Move to the end of the input history, i.e., the line currently
1273 <A NAME=
"IDX52"></A>
1274 <DT><CODE>reverse-search-history (C-r)
</CODE>
1275 <DD><A NAME=
"IDX53"></A>
1276 Search backward starting at the current line and moving `up' through
1277 the history as necessary. This is an incremental search.
1280 <A NAME=
"IDX54"></A>
1281 <DT><CODE>forward-search-history (C-s)
</CODE>
1282 <DD><A NAME=
"IDX55"></A>
1283 Search forward starting at the current line and moving `down' through
1284 the the history as necessary. This is an incremental search.
1287 <A NAME=
"IDX56"></A>
1288 <DT><CODE>non-incremental-reverse-search-history (M-p)
</CODE>
1289 <DD><A NAME=
"IDX57"></A>
1290 Search backward starting at the current line and moving `up'
1291 through the history as necessary using a non-incremental search
1292 for a string supplied by the user.
1295 <A NAME=
"IDX58"></A>
1296 <DT><CODE>non-incremental-forward-search-history (M-n)
</CODE>
1297 <DD><A NAME=
"IDX59"></A>
1298 Search forward starting at the current line and moving `down'
1299 through the the history as necessary using a non-incremental search
1300 for a string supplied by the user.
1303 <A NAME=
"IDX60"></A>
1304 <DT><CODE>history-search-forward ()
</CODE>
1305 <DD><A NAME=
"IDX61"></A>
1306 Search forward through the history for the string of characters
1307 between the start of the current line and the point.
1308 This is a non-incremental search.
1309 By default, this command is unbound.
1312 <A NAME=
"IDX62"></A>
1313 <DT><CODE>history-search-backward ()
</CODE>
1314 <DD><A NAME=
"IDX63"></A>
1315 Search backward through the history for the string of characters
1316 between the start of the current line and the point. This
1317 is a non-incremental search. By default, this command is unbound.
1320 <A NAME=
"IDX64"></A>
1321 <DT><CODE>yank-nth-arg (M-C-y)
</CODE>
1322 <DD><A NAME=
"IDX65"></A>
1323 Insert the first argument to the previous command (usually
1324 the second word on the previous line) at point.
1325 With an argument
<VAR>n
</VAR>,
1326 insert the
<VAR>n
</VAR>th word from the previous command (the words
1327 in the previous command begin with word
0). A negative argument
1328 inserts the
<VAR>n
</VAR>th word from the end of the previous command.
1331 <A NAME=
"IDX66"></A>
1332 <DT><CODE>yank-last-arg (M-. or M-_)
</CODE>
1333 <DD><A NAME=
"IDX67"></A>
1334 Insert last argument to the previous command (the last word of the
1335 previous history entry). With an
1336 argument, behave exactly like
<CODE>yank-nth-arg
</CODE>.
1337 Successive calls to
<CODE>yank-last-arg
</CODE> move back through the history
1338 list, inserting the last argument of each line in turn.
1344 <A NAME=
"Commands For Text"></A>
1346 <A NAME=
"SEC16"></A>
1347 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
1348 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC15"> < </A>]
</TD>
1349 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC17"> > </A>]
</TD>
1350 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC17"> << </A>]
</TD>
1351 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC13"> Up
</A>]
</TD>
1352 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC22"> >> </A>]
</TD>
1353 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
1354 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
1355 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
1356 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
1358 <H3> 1.4.3 Commands For Changing Text
</H3>
1359 <!--docid::SEC16::-->
1363 <A NAME=
"IDX68"></A>
1364 <DT><CODE>delete-char (C-d)
</CODE>
1365 <DD><A NAME=
"IDX69"></A>
1366 Delete the character at point. If point is at the
1367 beginning of the line, there are no characters in the line, and
1368 the last character typed was not bound to
<CODE>delete-char
</CODE>, then
1372 <A NAME=
"IDX70"></A>
1373 <DT><CODE>backward-delete-char (Rubout)
</CODE>
1374 <DD><A NAME=
"IDX71"></A>
1375 Delete the character behind the cursor. A numeric argument means
1376 to kill the characters instead of deleting them.
1379 <A NAME=
"IDX72"></A>
1380 <DT><CODE>forward-backward-delete-char ()
</CODE>
1381 <DD><A NAME=
"IDX73"></A>
1382 Delete the character under the cursor, unless the cursor is at the
1383 end of the line, in which case the character behind the cursor is
1384 deleted. By default, this is not bound to a key.
1387 <A NAME=
"IDX74"></A>
1388 <DT><CODE>quoted-insert (C-q or C-v)
</CODE>
1389 <DD><A NAME=
"IDX75"></A>
1390 Add the next character typed to the line verbatim. This is
1391 how to insert key sequences like
<KBD>C-q
</KBD>, for example.
1394 <A NAME=
"IDX76"></A>
1395 <DT><CODE>tab-insert (M-
<KBD>TAB
</KBD>)
</CODE>
1396 <DD><A NAME=
"IDX77"></A>
1397 Insert a tab character.
1400 <A NAME=
"IDX78"></A>
1401 <DT><CODE>self-insert (a, b, A,
1, !,
<small>...
</small>)
</CODE>
1402 <DD><A NAME=
"IDX79"></A>
1406 <A NAME=
"IDX80"></A>
1407 <DT><CODE>transpose-chars (C-t)
</CODE>
1408 <DD><A NAME=
"IDX81"></A>
1409 Drag the character before the cursor forward over
1410 the character at the cursor, moving the
1411 cursor forward as well. If the insertion point
1412 is at the end of the line, then this
1413 transposes the last two characters of the line.
1414 Negative arguments have no effect.
1417 <A NAME=
"IDX82"></A>
1418 <DT><CODE>transpose-words (M-t)
</CODE>
1419 <DD><A NAME=
"IDX83"></A>
1420 Drag the word before point past the word after point,
1421 moving point past that word as well.
1422 If the insertion point is at the end of the line, this transposes
1423 the last two words on the line.
1426 <A NAME=
"IDX84"></A>
1427 <DT><CODE>upcase-word (M-u)
</CODE>
1428 <DD><A NAME=
"IDX85"></A>
1429 Uppercase the current (or following) word. With a negative argument,
1430 uppercase the previous word, but do not move the cursor.
1433 <A NAME=
"IDX86"></A>
1434 <DT><CODE>downcase-word (M-l)
</CODE>
1435 <DD><A NAME=
"IDX87"></A>
1436 Lowercase the current (or following) word. With a negative argument,
1437 lowercase the previous word, but do not move the cursor.
1440 <A NAME=
"IDX88"></A>
1441 <DT><CODE>capitalize-word (M-c)
</CODE>
1442 <DD><A NAME=
"IDX89"></A>
1443 Capitalize the current (or following) word. With a negative argument,
1444 capitalize the previous word, but do not move the cursor.
1447 <A NAME=
"IDX90"></A>
1448 <DT><CODE>overwrite-mode ()
</CODE>
1449 <DD><A NAME=
"IDX91"></A>
1450 Toggle overwrite mode. With an explicit positive numeric argument,
1451 switches to overwrite mode. With an explicit non-positive numeric
1452 argument, switches to insert mode. This command affects only
1453 <CODE>emacs
</CODE> mode;
<CODE>vi
</CODE> mode does overwrite differently.
1454 Each call to
<CODE>readline()
</CODE> starts in insert mode.
1457 In overwrite mode, characters bound to
<CODE>self-insert
</CODE> replace
1458 the text at point rather than pushing the text to the right.
1459 Characters bound to
<CODE>backward-delete-char
</CODE> replace the character
1460 before point with a space.
1463 By default, this command is unbound.
1469 <A NAME=
"Commands For Killing"></A>
1471 <A NAME=
"SEC17"></A>
1472 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
1473 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC16"> < </A>]
</TD>
1474 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC18"> > </A>]
</TD>
1475 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC18"> << </A>]
</TD>
1476 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC13"> Up
</A>]
</TD>
1477 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC22"> >> </A>]
</TD>
1478 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
1479 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
1480 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
1481 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
1483 <H3> 1.4.4 Killing And Yanking
</H3>
1484 <!--docid::SEC17::-->
1489 <A NAME=
"IDX92"></A>
1490 <DT><CODE>kill-line (C-k)
</CODE>
1491 <DD><A NAME=
"IDX93"></A>
1492 Kill the text from point to the end of the line.
1495 <A NAME=
"IDX94"></A>
1496 <DT><CODE>backward-kill-line (C-x Rubout)
</CODE>
1497 <DD><A NAME=
"IDX95"></A>
1498 Kill backward to the beginning of the line.
1501 <A NAME=
"IDX96"></A>
1502 <DT><CODE>unix-line-discard (C-u)
</CODE>
1503 <DD><A NAME=
"IDX97"></A>
1504 Kill backward from the cursor to the beginning of the current line.
1507 <A NAME=
"IDX98"></A>
1508 <DT><CODE>kill-whole-line ()
</CODE>
1509 <DD><A NAME=
"IDX99"></A>
1510 Kill all characters on the current line, no matter where point is.
1511 By default, this is unbound.
1514 <A NAME=
"IDX100"></A>
1515 <DT><CODE>kill-word (M-d)
</CODE>
1516 <DD><A NAME=
"IDX101"></A>
1517 Kill from point to the end of the current word, or if between
1518 words, to the end of the next word.
1519 Word boundaries are the same as
<CODE>forward-word
</CODE>.
1522 <A NAME=
"IDX102"></A>
1523 <DT><CODE>backward-kill-word (M-
<KBD>DEL
</KBD>)
</CODE>
1524 <DD><A NAME=
"IDX103"></A>
1525 Kill the word behind point.
1526 Word boundaries are the same as
<CODE>backward-word
</CODE>.
1529 <A NAME=
"IDX104"></A>
1530 <DT><CODE>unix-word-rubout (C-w)
</CODE>
1531 <DD><A NAME=
"IDX105"></A>
1532 Kill the word behind point, using white space as a word boundary.
1533 The killed text is saved on the kill-ring.
1536 <A NAME=
"IDX106"></A>
1537 <DT><CODE>delete-horizontal-space ()
</CODE>
1538 <DD><A NAME=
"IDX107"></A>
1539 Delete all spaces and tabs around point. By default, this is unbound.
1542 <A NAME=
"IDX108"></A>
1543 <DT><CODE>kill-region ()
</CODE>
1544 <DD><A NAME=
"IDX109"></A>
1545 Kill the text in the current region.
1546 By default, this command is unbound.
1549 <A NAME=
"IDX110"></A>
1550 <DT><CODE>copy-region-as-kill ()
</CODE>
1551 <DD><A NAME=
"IDX111"></A>
1552 Copy the text in the region to the kill buffer, so it can be yanked
1553 right away. By default, this command is unbound.
1556 <A NAME=
"IDX112"></A>
1557 <DT><CODE>copy-backward-word ()
</CODE>
1558 <DD><A NAME=
"IDX113"></A>
1559 Copy the word before point to the kill buffer.
1560 The word boundaries are the same as
<CODE>backward-word
</CODE>.
1561 By default, this command is unbound.
1564 <A NAME=
"IDX114"></A>
1565 <DT><CODE>copy-forward-word ()
</CODE>
1566 <DD><A NAME=
"IDX115"></A>
1567 Copy the word following point to the kill buffer.
1568 The word boundaries are the same as
<CODE>forward-word
</CODE>.
1569 By default, this command is unbound.
1572 <A NAME=
"IDX116"></A>
1573 <DT><CODE>yank (C-y)
</CODE>
1574 <DD><A NAME=
"IDX117"></A>
1575 Yank the top of the kill ring into the buffer at point.
1578 <A NAME=
"IDX118"></A>
1579 <DT><CODE>yank-pop (M-y)
</CODE>
1580 <DD><A NAME=
"IDX119"></A>
1581 Rotate the kill-ring, and yank the new top. You can only do this if
1582 the prior command is
<CODE>yank
</CODE> or
<CODE>yank-pop
</CODE>.
1586 <A NAME=
"Numeric Arguments"></A>
1588 <A NAME=
"SEC18"></A>
1589 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
1590 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC17"> < </A>]
</TD>
1591 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC19"> > </A>]
</TD>
1592 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC19"> << </A>]
</TD>
1593 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC13"> Up
</A>]
</TD>
1594 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC22"> >> </A>]
</TD>
1595 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
1596 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
1597 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
1598 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
1600 <H3> 1.4.5 Specifying Numeric Arguments
</H3>
1601 <!--docid::SEC18::-->
1604 <A NAME=
"IDX120"></A>
1605 <DT><CODE>digit-argument (
<KBD>M-
0</KBD>,
<KBD>M-
1</KBD>,
<small>...
</small> <KBD>M--
</KBD>)
</CODE>
1606 <DD><A NAME=
"IDX121"></A>
1607 Add this digit to the argument already accumulating, or start a new
1608 argument.
<KBD>M--
</KBD> starts a negative argument.
1611 <A NAME=
"IDX122"></A>
1612 <DT><CODE>universal-argument ()
</CODE>
1613 <DD><A NAME=
"IDX123"></A>
1614 This is another way to specify an argument.
1615 If this command is followed by one or more digits, optionally with a
1616 leading minus sign, those digits define the argument.
1617 If the command is followed by digits, executing
<CODE>universal-argument
</CODE>
1618 again ends the numeric argument, but is otherwise ignored.
1619 As a special case, if this command is immediately followed by a
1620 character that is neither a digit or minus sign, the argument count
1621 for the next command is multiplied by four.
1622 The argument count is initially one, so executing this function the
1623 first time makes the argument count four, a second time makes the
1624 argument count sixteen, and so on.
1625 By default, this is not bound to a key.
1629 <A NAME=
"Commands For Completion"></A>
1631 <A NAME=
"SEC19"></A>
1632 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
1633 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC18"> < </A>]
</TD>
1634 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC20"> > </A>]
</TD>
1635 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC20"> << </A>]
</TD>
1636 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC13"> Up
</A>]
</TD>
1637 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC22"> >> </A>]
</TD>
1638 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
1639 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
1640 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
1641 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
1643 <H3> 1.4.6 Letting Readline Type For You
</H3>
1644 <!--docid::SEC19::-->
1648 <A NAME=
"IDX124"></A>
1649 <DT><CODE>complete (
<KBD>TAB
</KBD>)
</CODE>
1650 <DD><A NAME=
"IDX125"></A>
1651 Attempt to perform completion on the text before point.
1652 The actual completion performed is application-specific.
1653 The default is filename completion.
1656 <A NAME=
"IDX126"></A>
1657 <DT><CODE>possible-completions (M-?)
</CODE>
1658 <DD><A NAME=
"IDX127"></A>
1659 List the possible completions of the text before point.
1662 <A NAME=
"IDX128"></A>
1663 <DT><CODE>insert-completions (M-*)
</CODE>
1664 <DD><A NAME=
"IDX129"></A>
1665 Insert all completions of the text before point that would have
1666 been generated by
<CODE>possible-completions
</CODE>.
1669 <A NAME=
"IDX130"></A>
1670 <DT><CODE>menu-complete ()
</CODE>
1671 <DD><A NAME=
"IDX131"></A>
1672 Similar to
<CODE>complete
</CODE>, but replaces the word to be completed
1673 with a single match from the list of possible completions.
1674 Repeated execution of
<CODE>menu-complete
</CODE> steps through the list
1675 of possible completions, inserting each match in turn.
1676 At the end of the list of completions, the bell is rung
1677 (subject to the setting of
<CODE>bell-style
</CODE>)
1678 and the original text is restored.
1679 An argument of
<VAR>n
</VAR> moves
<VAR>n
</VAR> positions forward in the list
1680 of matches; a negative argument may be used to move backward
1682 This command is intended to be bound to
<KBD>TAB
</KBD>, but is unbound
1686 <A NAME=
"IDX132"></A>
1687 <DT><CODE>delete-char-or-list ()
</CODE>
1688 <DD><A NAME=
"IDX133"></A>
1689 Deletes the character under the cursor if not at the beginning or
1690 end of the line (like
<CODE>delete-char
</CODE>).
1691 If at the end of the line, behaves identically to
1692 <CODE>possible-completions
</CODE>.
1693 This command is unbound by default.
1699 <A NAME=
"Keyboard Macros"></A>
1701 <A NAME=
"SEC20"></A>
1702 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
1703 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC19"> < </A>]
</TD>
1704 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC21"> > </A>]
</TD>
1705 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC21"> << </A>]
</TD>
1706 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC13"> Up
</A>]
</TD>
1707 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC22"> >> </A>]
</TD>
1708 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
1709 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
1710 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
1711 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
1713 <H3> 1.4.7 Keyboard Macros
</H3>
1714 <!--docid::SEC20::-->
1717 <A NAME=
"IDX134"></A>
1718 <DT><CODE>start-kbd-macro (C-x ()
</CODE>
1719 <DD><A NAME=
"IDX135"></A>
1720 Begin saving the characters typed into the current keyboard macro.
1723 <A NAME=
"IDX136"></A>
1724 <DT><CODE>end-kbd-macro (C-x ))
</CODE>
1725 <DD><A NAME=
"IDX137"></A>
1726 Stop saving the characters typed into the current keyboard macro
1727 and save the definition.
1730 <A NAME=
"IDX138"></A>
1731 <DT><CODE>call-last-kbd-macro (C-x e)
</CODE>
1732 <DD><A NAME=
"IDX139"></A>
1733 Re-execute the last keyboard macro defined, by making the characters
1734 in the macro appear as if typed at the keyboard.
1740 <A NAME=
"Miscellaneous Commands"></A>
1742 <A NAME=
"SEC21"></A>
1743 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
1744 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC20"> < </A>]
</TD>
1745 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC22"> > </A>]
</TD>
1746 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC22"> << </A>]
</TD>
1747 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC13"> Up
</A>]
</TD>
1748 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC22"> >> </A>]
</TD>
1749 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
1750 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
1751 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
1752 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
1754 <H3> 1.4.8 Some Miscellaneous Commands
</H3>
1755 <!--docid::SEC21::-->
1758 <A NAME=
"IDX140"></A>
1759 <DT><CODE>re-read-init-file (C-x C-r)
</CODE>
1760 <DD><A NAME=
"IDX141"></A>
1761 Read in the contents of the
<VAR>inputrc
</VAR> file, and incorporate
1762 any bindings or variable assignments found there.
1765 <A NAME=
"IDX142"></A>
1766 <DT><CODE>abort (C-g)
</CODE>
1767 <DD><A NAME=
"IDX143"></A>
1768 Abort the current editing command and
1769 ring the terminal's bell (subject to the setting of
1770 <CODE>bell-style
</CODE>).
1773 <A NAME=
"IDX144"></A>
1774 <DT><CODE>do-uppercase-version (M-a, M-b, M-
<VAR>x
</VAR>,
<small>...
</small>)
</CODE>
1775 <DD><A NAME=
"IDX145"></A>
1776 If the metafied character
<VAR>x
</VAR> is lowercase, run the command
1777 that is bound to the corresponding uppercase character.
1780 <A NAME=
"IDX146"></A>
1781 <DT><CODE>prefix-meta (
<KBD>ESC
</KBD>)
</CODE>
1782 <DD><A NAME=
"IDX147"></A>
1783 Metafy the next character typed. This is for keyboards
1784 without a meta key. Typing
<SAMP>`
<KBD>ESC
</KBD> f'
</SAMP> is equivalent to typing
1788 <A NAME=
"IDX148"></A>
1789 <DT><CODE>undo (C-_ or C-x C-u)
</CODE>
1790 <DD><A NAME=
"IDX149"></A>
1791 Incremental undo, separately remembered for each line.
1794 <A NAME=
"IDX150"></A>
1795 <DT><CODE>revert-line (M-r)
</CODE>
1796 <DD><A NAME=
"IDX151"></A>
1797 Undo all changes made to this line. This is like executing the
<CODE>undo
</CODE>
1798 command enough times to get back to the beginning.
1801 <A NAME=
"IDX152"></A>
1802 <DT><CODE>tilde-expand (M-~)
</CODE>
1803 <DD><A NAME=
"IDX153"></A>
1804 Perform tilde expansion on the current word.
1807 <A NAME=
"IDX154"></A>
1808 <DT><CODE>set-mark (C-@)
</CODE>
1809 <DD><A NAME=
"IDX155"></A>
1810 Set the mark to the point. If a
1811 numeric argument is supplied, the mark is set to that position.
1814 <A NAME=
"IDX156"></A>
1815 <DT><CODE>exchange-point-and-mark (C-x C-x)
</CODE>
1816 <DD><A NAME=
"IDX157"></A>
1817 Swap the point with the mark. The current cursor position is set to
1818 the saved position, and the old cursor position is saved as the mark.
1821 <A NAME=
"IDX158"></A>
1822 <DT><CODE>character-search (C-])
</CODE>
1823 <DD><A NAME=
"IDX159"></A>
1824 A character is read and point is moved to the next occurrence of that
1825 character. A negative count searches for previous occurrences.
1828 <A NAME=
"IDX160"></A>
1829 <DT><CODE>character-search-backward (M-C-])
</CODE>
1830 <DD><A NAME=
"IDX161"></A>
1831 A character is read and point is moved to the previous occurrence
1832 of that character. A negative count searches for subsequent
1836 <A NAME=
"IDX162"></A>
1837 <DT><CODE>insert-comment (M-#)
</CODE>
1838 <DD><A NAME=
"IDX163"></A>
1839 Without a numeric argument, the value of the
<CODE>comment-begin
</CODE>
1840 variable is inserted at the beginning of the current line.
1841 If a numeric argument is supplied, this command acts as a toggle: if
1842 the characters at the beginning of the line do not match the value
1843 of
<CODE>comment-begin
</CODE>, the value is inserted, otherwise
1844 the characters in
<CODE>comment-begin
</CODE> are deleted from the beginning of
1846 In either case, the line is accepted as if a newline had been typed.
1849 <A NAME=
"IDX164"></A>
1850 <DT><CODE>dump-functions ()
</CODE>
1851 <DD><A NAME=
"IDX165"></A>
1852 Print all of the functions and their key bindings to the
1853 Readline output stream. If a numeric argument is supplied,
1854 the output is formatted in such a way that it can be made part
1855 of an
<VAR>inputrc
</VAR> file. This command is unbound by default.
1858 <A NAME=
"IDX166"></A>
1859 <DT><CODE>dump-variables ()
</CODE>
1860 <DD><A NAME=
"IDX167"></A>
1861 Print all of the settable variables and their values to the
1862 Readline output stream. If a numeric argument is supplied,
1863 the output is formatted in such a way that it can be made part
1864 of an
<VAR>inputrc
</VAR> file. This command is unbound by default.
1867 <A NAME=
"IDX168"></A>
1868 <DT><CODE>dump-macros ()
</CODE>
1869 <DD><A NAME=
"IDX169"></A>
1870 Print all of the Readline key sequences bound to macros and the
1871 strings they output. If a numeric argument is supplied,
1872 the output is formatted in such a way that it can be made part
1873 of an
<VAR>inputrc
</VAR> file. This command is unbound by default.
1876 <A NAME=
"IDX170"></A>
1877 <DT><CODE>emacs-editing-mode (C-e)
</CODE>
1878 <DD><A NAME=
"IDX171"></A>
1879 When in
<CODE>vi
</CODE> command mode, this causes a switch to
<CODE>emacs
</CODE>
1883 <A NAME=
"IDX172"></A>
1884 <DT><CODE>vi-editing-mode (M-C-j)
</CODE>
1885 <DD><A NAME=
"IDX173"></A>
1886 When in
<CODE>emacs
</CODE> editing mode, this causes a switch to
<CODE>vi
</CODE>
1893 <A NAME=
"Readline vi Mode"></A>
1895 <A NAME=
"SEC22"></A>
1896 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
1897 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC21"> < </A>]
</TD>
1898 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
> ]
</TD>
1899 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<< ]
</TD>
1900 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC1"> Up
</A>]
</TD>
1901 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
>> ]
</TD>
1902 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT"> <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
1903 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
1904 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
1905 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
1907 <H2> 1.5 Readline vi Mode
</H2>
1908 <!--docid::SEC22::-->
1911 While the Readline library does not have a full set of
<CODE>vi
</CODE>
1912 editing functions, it does contain enough to allow simple editing
1913 of the line. The Readline
<CODE>vi
</CODE> mode behaves as specified in
1914 the POSIX
1003.2 standard.
1917 In order to switch interactively between
<CODE>emacs
</CODE> and
<CODE>vi
</CODE>
1918 editing modes, use the command
<KBD>M-C-j
</KBD> (bound to emacs-editing-mode
1919 when in
<CODE>vi
</CODE> mode and to vi-editing-mode in
<CODE>emacs
</CODE> mode).
1920 The Readline default is
<CODE>emacs
</CODE> mode.
1923 When you enter a line in
<CODE>vi
</CODE> mode, you are already placed in
1924 `insertion' mode, as if you had typed an
<SAMP>`i'
</SAMP>. Pressing
<KBD>ESC
</KBD>
1925 switches you into `command' mode, where you can edit the text of the
1926 line with the standard
<CODE>vi
</CODE> movement keys, move to previous
1927 history lines with
<SAMP>`k'
</SAMP> and subsequent lines with
<SAMP>`j'
</SAMP>, and
1932 <A NAME=
"SEC_Contents"></A>
1933 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
1934 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
1935 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
1936 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
1937 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
1939 <H1>Table of Contents
</H1>
1941 <A NAME=
"TOC1" HREF=
"rluserman.html#SEC1">1. Command Line Editing
</A>
1944 <A NAME=
"TOC2" HREF=
"rluserman.html#SEC2">1.1 Introduction to Line Editing
</A>
1946 <A NAME=
"TOC3" HREF=
"rluserman.html#SEC3">1.2 Readline Interaction
</A>
1949 <A NAME=
"TOC4" HREF=
"rluserman.html#SEC4">1.2.1 Readline Bare Essentials
</A>
1951 <A NAME=
"TOC5" HREF=
"rluserman.html#SEC5">1.2.2 Readline Movement Commands
</A>
1953 <A NAME=
"TOC6" HREF=
"rluserman.html#SEC6">1.2.3 Readline Killing Commands
</A>
1955 <A NAME=
"TOC7" HREF=
"rluserman.html#SEC7">1.2.4 Readline Arguments
</A>
1957 <A NAME=
"TOC8" HREF=
"rluserman.html#SEC8">1.2.5 Searching for Commands in the History
</A>
1960 <A NAME=
"TOC9" HREF=
"rluserman.html#SEC9">1.3 Readline Init File
</A>
1963 <A NAME=
"TOC10" HREF=
"rluserman.html#SEC10">1.3.1 Readline Init File Syntax
</A>
1965 <A NAME=
"TOC11" HREF=
"rluserman.html#SEC11">1.3.2 Conditional Init Constructs
</A>
1967 <A NAME=
"TOC12" HREF=
"rluserman.html#SEC12">1.3.3 Sample Init File
</A>
1970 <A NAME=
"TOC13" HREF=
"rluserman.html#SEC13">1.4 Bindable Readline Commands
</A>
1973 <A NAME=
"TOC14" HREF=
"rluserman.html#SEC14">1.4.1 Commands For Moving
</A>
1975 <A NAME=
"TOC15" HREF=
"rluserman.html#SEC15">1.4.2 Commands For Manipulating The History
</A>
1977 <A NAME=
"TOC16" HREF=
"rluserman.html#SEC16">1.4.3 Commands For Changing Text
</A>
1979 <A NAME=
"TOC17" HREF=
"rluserman.html#SEC17">1.4.4 Killing And Yanking
</A>
1981 <A NAME=
"TOC18" HREF=
"rluserman.html#SEC18">1.4.5 Specifying Numeric Arguments
</A>
1983 <A NAME=
"TOC19" HREF=
"rluserman.html#SEC19">1.4.6 Letting Readline Type For You
</A>
1985 <A NAME=
"TOC20" HREF=
"rluserman.html#SEC20">1.4.7 Keyboard Macros
</A>
1987 <A NAME=
"TOC21" HREF=
"rluserman.html#SEC21">1.4.8 Some Miscellaneous Commands
</A>
1990 <A NAME=
"TOC22" HREF=
"rluserman.html#SEC22">1.5 Readline vi Mode
</A>
1995 <A NAME=
"SEC_OVERVIEW"></A>
1996 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
1997 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
1998 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
1999 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
2000 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
2002 <H1>Short Table of Contents
</H1>
2004 <A NAME=
"TOC1" HREF=
"rluserman.html#SEC1">1. Command Line Editing
</A>
2009 <A NAME=
"SEC_About"></A>
2010 <TABLE CELLPADDING=
1 CELLSPACING=
1 BORDER=
0>
2011 <TR><TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Top">Top
</A>]
</TD>
2012 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_Contents">Contents
</A>]
</TD>
2013 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[Index]
</TD>
2014 <TD VALIGN=
"MIDDLE" ALIGN=
"LEFT">[
<A HREF=
"rluserman.html#SEC_About"> ?
</A>]
</TD>
2016 <H1>About this document
</H1>
2017 This document was generated by
<I>Chet Ramey
</I> on
<I>June,
27 2002</I>
2018 using
<A HREF=
"http://www.mathematik.uni-kl.de/~obachman/Texi2html
2019 "><I>texi2html
</I></A>
2021 The buttons in the navigation panels have the following meaning:
2023 <table border =
"1">
2028 <TH> From
1.2.3 go to
</TH>
2037 previous section in reading order
2050 next section in reading order
2063 previous or up-and-previous section
2089 next or up-and-next section
2102 cover (top) of document
2149 where the
<STRONG> Example
</STRONG> assumes that the current position
2150 is at
<STRONG> Subsubsection One-Two-Three
</STRONG> of a document of
2151 the following structure:
2153 <LI> 1. Section One
</LI>
2155 <LI>1.1 Subsection One-One
</LI>
2159 <LI>1.2 Subsection One-Two
</LI>
2161 <LI>1.2.1 Subsubsection One-Two-One
2162 </LI><LI>1.2.2 Subsubsection One-Two-Two
2163 </LI><LI>1.2.3 Subsubsection One-Two-Three
<STRONG>
2164 <== Current Position
</STRONG>
2165 </LI><LI>1.2.4 Subsubsection One-Two-Four
2167 <LI>1.3 Subsection One-Three
</LI>
2171 <LI>1.4 Subsection One-Four
</LI>
2178 This document was generated
2179 by
<I>Chet Ramey
</I> on
<I>June,
27 2002</I>
2180 using
<A HREF=
"http://www.mathematik.uni-kl.de/~obachman/Texi2html
2181 "><I>texi2html
</I></A>