Debian Codegraph @

doc/rluserman.html

raw
1 <!DOCTYPE html>
2 <html>
3 <!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <!-- This manual describes the end user interface of the GNU Readline Library
7 (version 8.3, 30 December 2024), a library which aids in the
8 consistency of user interface across discrete programs which provide
9 a command line interface.
10
11 Copyright © 1988-2025 Free Software Foundation, Inc.
12
13 Permission is granted to copy, distribute and/or modify this document
14 under the terms of the GNU Free Documentation License, Version 1.3 or
15 any later version published by the Free Software Foundation; with no
16 Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
17 A copy of the license is included in the section entitled
18 "GNU Free Documentation License".
19 -->
20 <title>GNU Readline Library</title>
21
22 <meta name="description" content="GNU Readline Library">
23 <meta name="keywords" content="GNU Readline Library">
24 <meta name="resource-type" content="document">
25 <meta name="distribution" content="global">
26 <meta name="Generator" content="makeinfo">
27 <meta name="viewport" content="width=device-width,initial-scale=1">
28
29 <link href="#Top" rel="start" title="Top">
30 <link href="#SEC_Contents" rel="contents" title="Table of Contents">
31 <link href="#Command-Line-Editing" rel="next" title="Command Line Editing">
32 <style type="text/css">
33 <!--
34 a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
35 div.center {text-align:center}
36 div.display {margin-left: 3.2em}
37 div.example {margin-left: 3.2em}
38 kbd.kbd {font-style: oblique}
39 kbd.key {font-style: normal}
40 pre.display-preformatted {font-family: inherit}
41 span:hover a.copiable-link {visibility: visible}
42 ul.mark-bullet {list-style-type: disc}
43 ul.toc-numbered-mark {list-style: none}
44 -->
45 </style>
46
47
48 </head>
49
50 <body lang="en">
51
52
53
54
55
56
57
58
59
60 <div class="top-level-extent" id="Top">
61 <div class="nav-panel">
62 <p>
63 Next: <a href="#Command-Line-Editing" accesskey="n" rel="next">Command Line Editing</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
64 </div>
65 <h1 class="top" id="GNU-Readline-Library"><span>GNU Readline Library<a class="copiable-link" href="#GNU-Readline-Library"> &para;</a></span></h1>
66
67 <p>This document describes the end user interface of the GNU Readline Library,
68 a utility which aids in the consistency of user interface across discrete
69 programs which provide a command line interface.
70 The Readline home page is <a class="url" href="http://www.gnu.org/software/readline/">http://www.gnu.org/software/readline/</a>.
71 </p>
72
73
74
75
76
77 <div class="element-contents" id="SEC_Contents">
78 <h2 class="contents-heading">Table of Contents</h2>
79
80 <div class="contents">
81
82 <ul class="toc-numbered-mark">
83 <li><a id="toc-Command-Line-Editing-1" href="#Command-Line-Editing">1 Command Line Editing</a>
84 <ul class="toc-numbered-mark">
85 <li><a id="toc-Introduction-to-Line-Editing" href="#Introduction-and-Notation">1.1 Introduction to Line Editing</a></li>
86 <li><a id="toc-Readline-Interaction-1" href="#Readline-Interaction">1.2 Readline Interaction</a>
87 <ul class="toc-numbered-mark">
88 <li><a id="toc-Readline-Bare-Essentials-1" href="#Readline-Bare-Essentials">1.2.1 Readline Bare Essentials</a></li>
89 <li><a id="toc-Readline-Movement-Commands-1" href="#Readline-Movement-Commands">1.2.2 Readline Movement Commands</a></li>
90 <li><a id="toc-Readline-Killing-Commands-1" href="#Readline-Killing-Commands">1.2.3 Readline Killing Commands</a></li>
91 <li><a id="toc-Readline-Arguments-1" href="#Readline-Arguments">1.2.4 Readline Arguments</a></li>
92 <li><a id="toc-Searching-for-Commands-in-the-History" href="#Searching">1.2.5 Searching for Commands in the History</a></li>
93 </ul></li>
94 <li><a id="toc-Readline-Init-File-1" href="#Readline-Init-File">1.3 Readline Init File</a>
95 <ul class="toc-numbered-mark">
96 <li><a id="toc-Readline-Init-File-Syntax-1" href="#Readline-Init-File-Syntax">1.3.1 Readline Init File Syntax</a></li>
97 <li><a id="toc-Conditional-Init-Constructs-1" href="#Conditional-Init-Constructs">1.3.2 Conditional Init Constructs</a></li>
98 <li><a id="toc-Sample-Init-File-1" href="#Sample-Init-File">1.3.3 Sample Init File</a></li>
99 </ul></li>
100 <li><a id="toc-Bindable-Readline-Commands-1" href="#Bindable-Readline-Commands">1.4 Bindable Readline Commands</a>
101 <ul class="toc-numbered-mark">
102 <li><a id="toc-Commands-For-Moving-1" href="#Commands-For-Moving">1.4.1 Commands For Moving</a></li>
103 <li><a id="toc-Commands-For-Manipulating-The-History" href="#Commands-For-History">1.4.2 Commands For Manipulating The History</a></li>
104 <li><a id="toc-Commands-For-Changing-Text" href="#Commands-For-Text">1.4.3 Commands For Changing Text</a></li>
105 <li><a id="toc-Killing-And-Yanking" href="#Commands-For-Killing">1.4.4 Killing And Yanking</a></li>
106 <li><a id="toc-Specifying-Numeric-Arguments" href="#Numeric-Arguments">1.4.5 Specifying Numeric Arguments</a></li>
107 <li><a id="toc-Letting-Readline-Type-For-You" href="#Commands-For-Completion">1.4.6 Letting Readline Type For You</a></li>
108 <li><a id="toc-Keyboard-Macros-1" href="#Keyboard-Macros">1.4.7 Keyboard Macros</a></li>
109 <li><a id="toc-Some-Miscellaneous-Commands" href="#Miscellaneous-Commands">1.4.8 Some Miscellaneous Commands</a></li>
110 </ul></li>
111 <li><a id="toc-Readline-vi-Mode-1" href="#Readline-vi-Mode">1.5 Readline vi Mode</a></li>
112 </ul></li>
113 <li><a id="toc-GNU-Free-Documentation-License-1" href="#GNU-Free-Documentation-License">Appendix A GNU Free Documentation License</a></li>
114 </ul>
115 </div>
116 </div>
117 <hr>
118 <div class="chapter-level-extent" id="Command-Line-Editing">
119 <div class="nav-panel">
120 <p>
121 Next: <a href="#GNU-Free-Documentation-License" accesskey="n" rel="next">GNU Free Documentation License</a>, Previous: <a href="#Top" accesskey="p" rel="prev">GNU Readline Library</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU Readline Library</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
122 </div>
123 <h2 class="chapter" id="Command-Line-Editing-1"><span>1 Command Line Editing<a class="copiable-link" href="#Command-Line-Editing-1"> &para;</a></span></h2>
124
125 <p>This chapter describes the basic features of the <small class="sc">GNU</small>
126 command line editing interface.
127 </p>
128
129 <ul class="mini-toc">
130 <li><a href="#Introduction-and-Notation" accesskey="1">Introduction to Line Editing</a></li>
131 <li><a href="#Readline-Interaction" accesskey="2">Readline Interaction</a></li>
132 <li><a href="#Readline-Init-File" accesskey="3">Readline Init File</a></li>
133 <li><a href="#Bindable-Readline-Commands" accesskey="4">Bindable Readline Commands</a></li>
134 <li><a href="#Readline-vi-Mode" accesskey="5">Readline vi Mode</a></li>
135 </ul>
136 <hr>
137 <div class="section-level-extent" id="Introduction-and-Notation">
138 <div class="nav-panel">
139 <p>
140 Next: <a href="#Readline-Interaction" accesskey="n" rel="next">Readline Interaction</a>, Up: <a href="#Command-Line-Editing" accesskey="u" rel="up">Command Line Editing</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
141 </div>
142 <h3 class="section" id="Introduction-to-Line-Editing"><span>1.1 Introduction to Line Editing<a class="copiable-link" href="#Introduction-to-Line-Editing"> &para;</a></span></h3>
143
144 <p>The following paragraphs use Emacs style to
145 describe the notation used to represent keystrokes.
146 </p>
147 <p>The text <kbd class="kbd">C-k</kbd> is read as &lsquo;Control-K&rsquo; and describes the character
148 produced when the <kbd class="key">k</kbd> key is pressed while the Control key
149 is depressed.
150 </p>
151 <p>The text <kbd class="kbd">M-k</kbd> is read as &lsquo;Meta-K&rsquo; and describes the character
152 produced when the Meta key (if you have one) is depressed, and the <kbd class="key">k</kbd>
153 key is pressed (a <em class="dfn">meta character</em>), then both are released.
154 The Meta key is labeled <kbd class="key">ALT</kbd> or <kbd class="key">Option</kbd> on many keyboards.
155 On keyboards with two keys labeled <kbd class="key">ALT</kbd> (usually to either side of
156 the space bar), the <kbd class="key">ALT</kbd> on the left side is generally set to
157 work as a Meta key.
158 One of the <kbd class="key">ALT</kbd> keys may also be configured
159 as some other modifier, such as a
160 Compose key for typing accented characters.
161 </p>
162 <p>On some keyboards, the Meta key modifier produces characters with
163 the eighth bit (0200) set.
164 You can use the <code class="code">enable-meta-key</code> variable
165 to control whether or not it does this, if the keyboard allows it.
166 On many others, the terminal or terminal emulator converts the metafied
167 key to a key sequence beginning with <kbd class="key">ESC</kbd> as described in the
168 next paragraph.
169 </p>
170 <p>If you do not have a Meta or <kbd class="key">ALT</kbd> key, or another key working as
171 a Meta key, you can generally achieve the latter effect by typing <kbd class="key">ESC</kbd>
172 <em class="emph">first</em>, and then typing <kbd class="key">k</kbd>.
173 The <kbd class="key">ESC</kbd> character is known as the <em class="dfn">meta prefix</em>).
174 </p>
175 <p>Either process is known as <em class="dfn">metafying</em> the <kbd class="key">k</kbd> key.
176 </p>
177 <p>If your Meta key produces a key sequence with the <kbd class="key">ESC</kbd> meta prefix,
178 you can make <kbd class="kbd">M-key</kbd> key bindings you specify
179 (see <code class="code">Key Bindings</code> in <a class="ref" href="#Readline-Init-File-Syntax">Readline Init File Syntax</a>)
180 do the same thing by setting the <code class="code">force-meta-prefix</code> variable.
181 </p>
182 <p>The text <kbd class="kbd">M-C-k</kbd> is read as &lsquo;Meta-Control-k&rsquo; and describes the
183 character produced by metafying <kbd class="kbd">C-k</kbd>.
184 </p>
185 <p>In addition, several keys have their own names.
186 Specifically,
187 <kbd class="key">DEL</kbd>, <kbd class="key">ESC</kbd>, <kbd class="key">LFD</kbd>, <kbd class="key">SPC</kbd>, <kbd class="key">RET</kbd>, and <kbd class="key">TAB</kbd> all
188 stand for themselves when seen in this text, or in an init file
189 (see <a class="pxref" href="#Readline-Init-File">Readline Init File</a>).
190 If your keyboard lacks a <kbd class="key">LFD</kbd> key, typing <kbd class="key">C-j</kbd> will
191 output the appropriate character.
192 The <kbd class="key">RET</kbd> key may be labeled <kbd class="key">Return</kbd> or <kbd class="key">Enter</kbd> on
193 some keyboards.
194 </p>
195 <hr>
196 </div>
197 <div class="section-level-extent" id="Readline-Interaction">
198 <div class="nav-panel">
199 <p>
200 Next: <a href="#Readline-Init-File" accesskey="n" rel="next">Readline Init File</a>, Previous: <a href="#Introduction-and-Notation" accesskey="p" rel="prev">Introduction to Line Editing</a>, Up: <a href="#Command-Line-Editing" accesskey="u" rel="up">Command Line Editing</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
201 </div>
202 <h3 class="section" id="Readline-Interaction-1"><span>1.2 Readline Interaction<a class="copiable-link" href="#Readline-Interaction-1"> &para;</a></span></h3>
203 <a class="index-entry-id" id="index-interaction_002c-readline"></a>
204
205 <p>Often during an interactive session you type in a long line of text,
206 only to notice that the first word on the line is misspelled.
207 The Readline library gives you a set of commands for manipulating the text
208 as you type it in, allowing you to just fix your typo, and not forcing
209 you to retype the majority of the line.
210 Using these editing commands,
211 you move the cursor to the place that needs correction, and delete or
212 insert the text of the corrections.
213 Then, when you are satisfied with the line, you simply press <kbd class="key">RET</kbd>.
214 You do not have to be at the
215 end of the line to press <kbd class="key">RET</kbd>; the entire line is accepted
216 regardless of the location of the cursor within the line.
217 </p>
218
219 <ul class="mini-toc">
220 <li><a href="#Readline-Bare-Essentials" accesskey="1">Readline Bare Essentials</a></li>
221 <li><a href="#Readline-Movement-Commands" accesskey="2">Readline Movement Commands</a></li>
222 <li><a href="#Readline-Killing-Commands" accesskey="3">Readline Killing Commands</a></li>
223 <li><a href="#Readline-Arguments" accesskey="4">Readline Arguments</a></li>
224 <li><a href="#Searching" accesskey="5">Searching for Commands in the History</a></li>
225 </ul>
226 <hr>
227 <div class="subsection-level-extent" id="Readline-Bare-Essentials">
228 <div class="nav-panel">
229 <p>
230 Next: <a href="#Readline-Movement-Commands" accesskey="n" rel="next">Readline Movement Commands</a>, Up: <a href="#Readline-Interaction" accesskey="u" rel="up">Readline Interaction</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
231 </div>
232 <h4 class="subsection" id="Readline-Bare-Essentials-1"><span>1.2.1 Readline Bare Essentials<a class="copiable-link" href="#Readline-Bare-Essentials-1"> &para;</a></span></h4>
233 <a class="index-entry-id" id="index-notation_002c-readline"></a>
234 <a class="index-entry-id" id="index-command-editing"></a>
235 <a class="index-entry-id" id="index-editing-command-lines"></a>
236
237 <p>In order to enter characters into the line, simply type them.
238 The typed
239 character appears where the cursor was, and then the cursor moves one
240 space to the right.
241 If you mistype a character, you can use your
242 erase character to back up and delete the mistyped character.
243 </p>
244 <p>Sometimes you may mistype a character, and
245 not notice the error until you have typed several other characters.
246 In that case, you can type <kbd class="kbd">C-b</kbd> to move the cursor to the left,
247 and then correct your mistake.
248 Afterwards, you can move the cursor to the right with <kbd class="kbd">C-f</kbd>.
249 </p>
250 <p>When you add text in the middle of a line, you will notice that characters
251 to the right of the cursor are &lsquo;pushed over&rsquo; to make room for the text
252 that you have inserted.
253 Likewise, when you delete text behind the cursor,
254 characters to the right of the cursor are &lsquo;pulled back&rsquo; to fill in the
255 blank space created by the removal of the text.
256 These are the bare
257 essentials for editing the text of an input line:
258 </p>
259 <dl class="table">
260 <dt><kbd class="kbd">C-b</kbd></dt>
261 <dd><p>Move back one character.
262 </p></dd>
263 <dt><kbd class="kbd">C-f</kbd></dt>
264 <dd><p>Move forward one character.
265 </p></dd>
266 <dt><kbd class="key">DEL</kbd> or <kbd class="key">Backspace</kbd></dt>
267 <dd><p>Delete the character to the left of the cursor.
268 </p></dd>
269 <dt><kbd class="kbd">C-d</kbd></dt>
270 <dd><p>Delete the character underneath the cursor.
271 </p></dd>
272 <dt>Printing&nbsp;characters<!-- /@w --></dt>
273 <dd><p>Insert the character into the line at the cursor.
274 </p></dd>
275 <dt><kbd class="kbd">C-_</kbd> or <kbd class="kbd">C-x C-u</kbd></dt>
276 <dd><p>Undo the last editing command.
277 You can undo all the way back to an empty line.
278 </p></dd>
279 </dl>
280
281 <p>Depending on your configuration, the <kbd class="key">Backspace</kbd> key might be set to
282 delete the character to the left of the cursor and the <kbd class="key">DEL</kbd> key set
283 to delete the character underneath the cursor, like <kbd class="kbd">C-d</kbd>, rather
284 than the character to the left of the cursor.
285 </p>
286 <hr>
287 </div>
288 <div class="subsection-level-extent" id="Readline-Movement-Commands">
289 <div class="nav-panel">
290 <p>
291 Next: <a href="#Readline-Killing-Commands" accesskey="n" rel="next">Readline Killing Commands</a>, Previous: <a href="#Readline-Bare-Essentials" accesskey="p" rel="prev">Readline Bare Essentials</a>, Up: <a href="#Readline-Interaction" accesskey="u" rel="up">Readline Interaction</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
292 </div>
293 <h4 class="subsection" id="Readline-Movement-Commands-1"><span>1.2.2 Readline Movement Commands<a class="copiable-link" href="#Readline-Movement-Commands-1"> &para;</a></span></h4>
294
295 <p>The above table describes the most basic keystrokes that you need
296 in order to do editing of the input line.
297 For your convenience, many other commands are available in
298 addition to <kbd class="kbd">C-b</kbd>, <kbd class="kbd">C-f</kbd>, <kbd class="kbd">C-d</kbd>, and <kbd class="key">DEL</kbd>.
299 Here are some commands for moving more rapidly within the line.
300 </p>
301 <dl class="table">
302 <dt><kbd class="kbd">C-a</kbd></dt>
303 <dd><p>Move to the start of the line.
304 </p></dd>
305 <dt><kbd class="kbd">C-e</kbd></dt>
306 <dd><p>Move to the end of the line.
307 </p></dd>
308 <dt><kbd class="kbd">M-f</kbd></dt>
309 <dd><p>Move forward a word, where a word is composed of letters and digits.
310 </p></dd>
311 <dt><kbd class="kbd">M-b</kbd></dt>
312 <dd><p>Move backward a word.
313 </p></dd>
314 <dt><kbd class="kbd">C-l</kbd></dt>
315 <dd><p>Clear the screen, reprinting the current line at the top.
316 </p></dd>
317 </dl>
318
319 <p>Notice how <kbd class="kbd">C-f</kbd> moves forward a character, while <kbd class="kbd">M-f</kbd> moves
320 forward a word.
321 It is a loose convention that control keystrokes
322 operate on characters while meta keystrokes operate on words.
323 </p>
324 <hr>
325 </div>
326 <div class="subsection-level-extent" id="Readline-Killing-Commands">
327 <div class="nav-panel">
328 <p>
329 Next: <a href="#Readline-Arguments" accesskey="n" rel="next">Readline Arguments</a>, Previous: <a href="#Readline-Movement-Commands" accesskey="p" rel="prev">Readline Movement Commands</a>, Up: <a href="#Readline-Interaction" accesskey="u" rel="up">Readline Interaction</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
330 </div>
331 <h4 class="subsection" id="Readline-Killing-Commands-1"><span>1.2.3 Readline Killing Commands<a class="copiable-link" href="#Readline-Killing-Commands-1"> &para;</a></span></h4>
332
333 <a class="index-entry-id" id="index-killing-text"></a>
334 <a class="index-entry-id" id="index-yanking-text"></a>
335
336 <p><em class="dfn">Killing</em> text means to delete the text from the line, but to save
337 it away for later use, usually by <em class="dfn">yanking</em> (re-inserting)
338 it back into the line.
339 (&lsquo;Cut&rsquo; and &lsquo;paste&rsquo; are more recent jargon for &lsquo;kill&rsquo; and &lsquo;yank&rsquo;.)
340 </p>
341 <p>If the description for a command says that it &lsquo;kills&rsquo; text, then you can
342 be sure that you can get the text back in a different (or the same)
343 place later.
344 </p>
345 <p>When you use a kill command, the text is saved in a <em class="dfn">kill-ring</em>.
346 Any number of consecutive kills save all of the killed text together, so
347 that when you yank it back, you get it all.
348 The kill ring is not line specific; the text that you killed on a previously
349 typed line is available to be yanked back later, when you are typing
350 another line.
351 <a class="index-entry-id" id="index-kill-ring"></a>
352 </p>
353 <p>Here is the list of commands for killing text.
354 </p>
355 <dl class="table">
356 <dt><kbd class="kbd">C-k</kbd></dt>
357 <dd><p>Kill the text from the current cursor position to the end of the line.
358 </p>
359 </dd>
360 <dt><kbd class="kbd">M-d</kbd></dt>
361 <dd><p>Kill from the cursor to the end of the current word, or, if between
362 words, to the end of the next word.
363 Word boundaries are the same as those used by <kbd class="kbd">M-f</kbd>.
364 </p>
365 </dd>
366 <dt><kbd class="kbd">M-<kbd class="key">DEL</kbd></kbd></dt>
367 <dd><p>Kill from the cursor to the start of the current word, or, if between
368 words, to the start of the previous word.
369 Word boundaries are the same as those used by <kbd class="kbd">M-b</kbd>.
370 </p>
371 </dd>
372 <dt><kbd class="kbd">C-w</kbd></dt>
373 <dd><p>Kill from the cursor to the previous whitespace.
374 This is different than
375 <kbd class="kbd">M-<kbd class="key">DEL</kbd></kbd> because the word boundaries differ.
376 </p>
377 </dd>
378 </dl>
379
380 <p>Here is how to <em class="dfn">yank</em> the text back into the line. Yanking
381 means to copy the most-recently-killed text from the kill buffer
382 into the line at the current cursor position.
383 </p>
384 <dl class="table">
385 <dt><kbd class="kbd">C-y</kbd></dt>
386 <dd><p>Yank the most recently killed text back into the buffer at the cursor.
387 </p>
388 </dd>
389 <dt><kbd class="kbd">M-y</kbd></dt>
390 <dd><p>Rotate the kill-ring, and yank the new top.
391 You can only do this if the prior command is <kbd class="kbd">C-y</kbd> or <kbd class="kbd">M-y</kbd>.
392 </p></dd>
393 </dl>
394
395 <hr>
396 </div>
397 <div class="subsection-level-extent" id="Readline-Arguments">
398 <div class="nav-panel">
399 <p>
400 Next: <a href="#Searching" accesskey="n" rel="next">Searching for Commands in the History</a>, Previous: <a href="#Readline-Killing-Commands" accesskey="p" rel="prev">Readline Killing Commands</a>, Up: <a href="#Readline-Interaction" accesskey="u" rel="up">Readline Interaction</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
401 </div>
402 <h4 class="subsection" id="Readline-Arguments-1"><span>1.2.4 Readline Arguments<a class="copiable-link" href="#Readline-Arguments-1"> &para;</a></span></h4>
403
404 <p>You can pass numeric arguments to Readline commands.
405 Sometimes the
406 argument acts as a repeat count, other times it is the <i class="i">sign</i> of the
407 argument that is significant.
408 If you pass a negative argument to a
409 command which normally acts in a forward direction, that command will
410 act in a backward direction.
411 For example, to kill text back to the
412 start of the line, you might type &lsquo;<samp class="samp">M-- C-k</samp>&rsquo;.
413 </p>
414 <p>The general way to pass numeric arguments to a command is to type meta
415 digits before the command.
416 If the first &lsquo;digit&rsquo; typed is a minus
417 sign (&lsquo;<samp class="samp">-</samp>&rsquo;), then the sign of the argument will be negative.
418 Once you have typed one meta digit to get the argument started, you can
419 type the remainder of the digits, and then the command.
420 For example, to give
421 the <kbd class="kbd">C-d</kbd> command an argument of 10, you could type &lsquo;<samp class="samp">M-1 0 C-d</samp>&rsquo;,
422 which will delete the next ten characters on the input line.
423 </p>
424 <hr>
425 </div>
426 <div class="subsection-level-extent" id="Searching">
427 <div class="nav-panel">
428 <p>
429 Previous: <a href="#Readline-Arguments" accesskey="p" rel="prev">Readline Arguments</a>, Up: <a href="#Readline-Interaction" accesskey="u" rel="up">Readline Interaction</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
430 </div>
431 <h4 class="subsection" id="Searching-for-Commands-in-the-History"><span>1.2.5 Searching for Commands in the History<a class="copiable-link" href="#Searching-for-Commands-in-the-History"> &para;</a></span></h4>
432
433 <p>Readline provides commands for searching through the command history
434 for lines containing a specified string.
435 There are two search modes: <em class="dfn">incremental</em> and <em class="dfn">non-incremental</em>.
436 </p>
437 <p>Incremental searches begin before the user has finished typing the
438 search string.
439 As each character of the search string is typed, Readline displays
440 the next entry from the history matching the string typed so far.
441 An incremental search requires only as many characters as needed to
442 find the desired history entry.
443 When using emacs editing mode, type <kbd class="kbd">C-r</kbd>
444 to search backward in the history for a particular string.
445 Typing <kbd class="kbd">C-s</kbd> searches forward through the history.
446 The characters present in the value of the <code class="code">isearch-terminators</code> variable
447 are used to terminate an incremental search.
448 If that variable has not been assigned a value, the <kbd class="key">ESC</kbd> and
449 <kbd class="kbd">C-j</kbd> characters terminate an incremental search.
450 <kbd class="kbd">C-g</kbd> aborts an incremental search and restores the original line.
451 When the search is terminated, the history entry containing the
452 search string becomes the current line.
453 </p>
454 <p>To find other matching entries in the history list, type <kbd class="kbd">C-r</kbd> or
455 <kbd class="kbd">C-s</kbd> as appropriate.
456 This searches backward or forward in the history for the next
457 entry matching the search string typed so far.
458 Any other key sequence bound to a Readline command terminates
459 the search and executes that command.
460 For instance, a <kbd class="key">RET</kbd> terminates the search and accepts
461 the line, thereby executing the command from the history list.
462 A movement command will terminate the search, make the last line found
463 the current line, and begin editing.
464 </p>
465 <p>Readline remembers the last incremental search string.
466 If two <kbd class="kbd">C-r</kbd>s are typed without any intervening characters defining
467 a new search string, Readline uses any remembered search string.
468 </p>
469 <p>Non-incremental searches read the entire search string before starting
470 to search for matching history entries.
471 The search string may be typed by the user or be part of the contents of
472 the current line.
473 </p>
474 <hr>
475 </div>
476 </div>
477 <div class="section-level-extent" id="Readline-Init-File">
478 <div class="nav-panel">
479 <p>
480 Next: <a href="#Bindable-Readline-Commands" accesskey="n" rel="next">Bindable Readline Commands</a>, Previous: <a href="#Readline-Interaction" accesskey="p" rel="prev">Readline Interaction</a>, Up: <a href="#Command-Line-Editing" accesskey="u" rel="up">Command Line Editing</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
481 </div>
482 <h3 class="section" id="Readline-Init-File-1"><span>1.3 Readline Init File<a class="copiable-link" href="#Readline-Init-File-1"> &para;</a></span></h3>
483 <a class="index-entry-id" id="index-initialization-file_002c-readline"></a>
484
485 <p>Although the Readline library comes with a set of Emacs-like
486 keybindings installed by default, it is possible to use a different set
487 of keybindings.
488 Any user can customize programs that use Readline by putting
489 commands in an <em class="dfn">inputrc</em> file, conventionally in their home directory.
490 The name of this file is taken from the value of the
491 environment variable <code class="env">INPUTRC</code>.
492 If that variable is unset, the default is <samp class="file">~/.inputrc</samp>.
493 If that file does not exist or cannot be read, Readline looks for
494 <samp class="file">/etc/inputrc</samp>.
495 </p>
496 <p>When a program that uses the Readline library starts up, Readline reads
497 the init file and sets any variables and key bindings it contains.
498 </p>
499 <p>In addition, the <code class="code">C-x C-r</code> command re-reads this init file, thus
500 incorporating any changes that you might have made to it.
501 </p>
502
503 <ul class="mini-toc">
504 <li><a href="#Readline-Init-File-Syntax" accesskey="1">Readline Init File Syntax</a></li>
505 <li><a href="#Conditional-Init-Constructs" accesskey="2">Conditional Init Constructs</a></li>
506 <li><a href="#Sample-Init-File" accesskey="3">Sample Init File</a></li>
507 </ul>
508 <hr>
509 <div class="subsection-level-extent" id="Readline-Init-File-Syntax">
510 <div class="nav-panel">
511 <p>
512 Next: <a href="#Conditional-Init-Constructs" accesskey="n" rel="next">Conditional Init Constructs</a>, Up: <a href="#Readline-Init-File" accesskey="u" rel="up">Readline Init File</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
513 </div>
514 <h4 class="subsection" id="Readline-Init-File-Syntax-1"><span>1.3.1 Readline Init File Syntax<a class="copiable-link" href="#Readline-Init-File-Syntax-1"> &para;</a></span></h4>
515
516 <p>There are only a few basic constructs allowed in the
517 Readline init file.
518 Blank lines are ignored.
519 Lines beginning with a &lsquo;<samp class="samp">#</samp>&rsquo; are comments.
520 Lines beginning with a &lsquo;<samp class="samp">$</samp>&rsquo; indicate conditional
521 constructs (see <a class="pxref" href="#Conditional-Init-Constructs">Conditional Init Constructs</a>).
522 Other lines denote variable settings and key bindings.
523 </p>
524 <dl class="table">
525 <dt>Variable Settings</dt>
526 <dd><p>You can modify the run-time behavior of Readline by
527 altering the values of variables in Readline
528 using the <code class="code">set</code> command within the init file.
529 The syntax is simple:
530 </p>
531 <div class="example">
532 <pre class="example-preformatted">set <var class="var">variable</var> <var class="var">value</var>
533 </pre></div>
534
535 <p>Here, for example, is how to
536 change from the default Emacs-like key binding to use
537 <code class="code">vi</code> line editing commands:
538 </p>
539 <div class="example">
540 <pre class="example-preformatted">set editing-mode vi
541 </pre></div>
542
543 <p>Variable names and values, where appropriate, are recognized without
544 regard to case.
545 Unrecognized variable names are ignored.
546 </p>
547 <p>Boolean variables (those that can be set to on or off) are set to on if
548 the value is null or empty, <var class="var">on</var> (case-insensitive), or 1.
549 Any other value results in the variable being set to off.
550 </p>
551
552 <p>A great deal of run-time behavior is changeable with the following
553 variables.
554 </p>
555 <a class="index-entry-id" id="index-variables_002c-readline"></a>
556 <dl class="table">
557 <dt><a id="index-active_002dregion_002dstart_002dcolor"></a><span><code class="code">active-region-start-color</code><a class="copiable-link" href="#index-active_002dregion_002dstart_002dcolor"> &para;</a></span></dt>
558 <dd><p>A string variable that controls the text color and background when displaying
559 the text in the active region (see the description of
560 <code class="code">enable-active-region</code> below).
561 This string must not take up any physical character positions on the display,
562 so it should consist only of terminal escape sequences.
563 It is output to the terminal before displaying the text in the active region.
564 This variable is reset to the default value whenever the terminal type changes.
565 The default value is the string that puts the terminal in standout mode,
566 as obtained from the terminal&rsquo;s terminfo description.
567 A sample value might be &lsquo;<samp class="samp">\e[01;33m</samp>&rsquo;.
568 </p>
569 </dd>
570 <dt><a id="index-active_002dregion_002dend_002dcolor"></a><span><code class="code">active-region-end-color</code><a class="copiable-link" href="#index-active_002dregion_002dend_002dcolor"> &para;</a></span></dt>
571 <dd><p>A string variable that &ldquo;undoes&rdquo;
572 the effects of <code class="code">active-region-start-color</code>
573 and restores &ldquo;normal&rdquo;
574 terminal display appearance after displaying text in the active region.
575 This string must not take up any physical character positions on the display,
576 so it should consist only of terminal escape sequences.
577 It is output to the terminal after displaying the text in the active region.
578 This variable is reset to the default value whenever the terminal type changes.
579 The default value is the string that restores the terminal from standout mode,
580 as obtained from the terminal&rsquo;s terminfo description.
581 A sample value might be &lsquo;<samp class="samp">\e[0m</samp>&rsquo;.
582 </p>
583 </dd>
584 <dt><a id="index-bell_002dstyle"></a><span><code class="code">bell-style</code><a class="copiable-link" href="#index-bell_002dstyle"> &para;</a></span></dt>
585 <dd><p>Controls what happens when Readline wants to ring the terminal bell.
586 If set to &lsquo;<samp class="samp">none</samp>&rsquo;, Readline never rings the bell.
587 If set to &lsquo;<samp class="samp">visible</samp>&rsquo;, Readline uses a visible bell if one is available.
588 If set to &lsquo;<samp class="samp">audible</samp>&rsquo; (the default), Readline attempts to ring
589 the terminal&rsquo;s bell.
590 </p>
591 </dd>
592 <dt><a id="index-bind_002dtty_002dspecial_002dchars"></a><span><code class="code">bind-tty-special-chars</code><a class="copiable-link" href="#index-bind_002dtty_002dspecial_002dchars"> &para;</a></span></dt>
593 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo; (the default), Readline attempts to bind the control
594 characters that are
595 treated specially by the kernel&rsquo;s terminal driver to their
596 Readline equivalents.
597 These override the default Readline bindings described here.
598 Type &lsquo;<samp class="samp">stty -a</samp>&rsquo; at a Bash prompt to see your current terminal settings,
599 including the special control characters (usually <code class="code">cchars</code>).
600 </p>
601 </dd>
602 <dt><a id="index-blink_002dmatching_002dparen"></a><span><code class="code">blink-matching-paren</code><a class="copiable-link" href="#index-blink_002dmatching_002dparen"> &para;</a></span></dt>
603 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, Readline attempts to briefly move the cursor to an
604 opening parenthesis when a closing parenthesis is inserted.
605 The default is &lsquo;<samp class="samp">off</samp>&rsquo;.
606 </p>
607 </dd>
608 <dt><a id="index-colored_002dcompletion_002dprefix"></a><span><code class="code">colored-completion-prefix</code><a class="copiable-link" href="#index-colored_002dcompletion_002dprefix"> &para;</a></span></dt>
609 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, when listing completions, Readline displays the
610 common prefix of the set of possible completions using a different color.
611 The color definitions are taken from the value of the <code class="env">LS_COLORS</code>
612 environment variable.
613 If there is a color definition in <code class="env">LS_COLORS</code> for the custom suffix
614 &lsquo;<samp class="samp">readline-colored-completion-prefix</samp>&rsquo;, Readline uses this color for
615 the common prefix instead of its default.
616 The default is &lsquo;<samp class="samp">off</samp>&rsquo;.
617 </p>
618 </dd>
619 <dt><a id="index-colored_002dstats"></a><span><code class="code">colored-stats</code><a class="copiable-link" href="#index-colored_002dstats"> &para;</a></span></dt>
620 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, Readline displays possible completions using different
621 colors to indicate their file type.
622 The color definitions are taken from the value of the <code class="env">LS_COLORS</code>
623 environment variable.
624 The default is &lsquo;<samp class="samp">off</samp>&rsquo;.
625 </p>
626 </dd>
627 <dt><a id="index-comment_002dbegin"></a><span><code class="code">comment-begin</code><a class="copiable-link" href="#index-comment_002dbegin"> &para;</a></span></dt>
628 <dd><p>The string to insert at the beginning of the line by the
629 <code class="code">insert-comment</code> command.
630 The default value is <code class="code">&quot;#&quot;</code>.
631 </p>
632 </dd>
633 <dt><a id="index-completion_002ddisplay_002dwidth"></a><span><code class="code">completion-display-width</code><a class="copiable-link" href="#index-completion_002ddisplay_002dwidth"> &para;</a></span></dt>
634 <dd><p>The number of screen columns used to display possible matches
635 when performing completion.
636 The value is ignored if it is less than 0 or greater than the terminal
637 screen width.
638 A value of 0 causes matches to be displayed one per line.
639 The default value is -1.
640 </p>
641 </dd>
642 <dt><a id="index-completion_002dignore_002dcase"></a><span><code class="code">completion-ignore-case</code><a class="copiable-link" href="#index-completion_002dignore_002dcase"> &para;</a></span></dt>
643 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, Readline performs filename matching and completion
644 in a case-insensitive fashion.
645 The default value is &lsquo;<samp class="samp">off</samp>&rsquo;.
646 </p>
647 </dd>
648 <dt><a id="index-completion_002dmap_002dcase"></a><span><code class="code">completion-map-case</code><a class="copiable-link" href="#index-completion_002dmap_002dcase"> &para;</a></span></dt>
649 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, and <var class="var">completion-ignore-case</var> is enabled, Readline
650 treats hyphens (&lsquo;<samp class="samp">-</samp>&rsquo;) and underscores (&lsquo;<samp class="samp">_</samp>&rsquo;) as equivalent when
651 performing case-insensitive filename matching and completion.
652 The default value is &lsquo;<samp class="samp">off</samp>&rsquo;.
653 </p>
654 </dd>
655 <dt><a id="index-completion_002dprefix_002ddisplay_002dlength"></a><span><code class="code">completion-prefix-display-length</code><a class="copiable-link" href="#index-completion_002dprefix_002ddisplay_002dlength"> &para;</a></span></dt>
656 <dd><p>The maximum
657 length in characters of the common prefix of a list of possible
658 completions that is displayed without modification.
659 When set to a value greater than zero, Readline
660 replaces common prefixes longer than this value
661 with an ellipsis when displaying possible completions.
662 If a completion begins with a period,
663 and Readline is completing filenames,
664 it uses three underscores instead of an ellipsis.
665 </p>
666 </dd>
667 <dt><a id="index-completion_002dquery_002ditems"></a><span><code class="code">completion-query-items</code><a class="copiable-link" href="#index-completion_002dquery_002ditems"> &para;</a></span></dt>
668 <dd><p>The number of possible completions that determines when the user is asked
669 whether the list of possibilities should be displayed.
670 If the number of possible completions is greater than
671 or equal to this value,
672 Readline asks whether or not the user wishes to view them;
673 otherwise, Readline simply lists the completions.
674 This variable must be set to an integer value greater than or equal to zero.
675 A zero value means Readline should never ask; negative
676 values are treated as zero.
677 The default limit is <code class="code">100</code>.
678 </p>
679 </dd>
680 <dt><a id="index-convert_002dmeta"></a><span><code class="code">convert-meta</code><a class="copiable-link" href="#index-convert_002dmeta"> &para;</a></span></dt>
681 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, Readline converts characters it reads
682 that have the eighth bit set to an <small class="sc">ASCII</small> key sequence by
683 clearing the eighth bit and prefixing an <kbd class="key">ESC</kbd> character,
684 converting them to a meta-prefixed key sequence.
685 The default value is &lsquo;<samp class="samp">on</samp>&rsquo;, but Readline sets it to &lsquo;<samp class="samp">off</samp>&rsquo;
686 if the locale contains
687 characters whose encodings may include bytes with the eighth bit set.
688 This variable is dependent on the <code class="code">LC_CTYPE</code> locale category, and
689 may change if the locale changes.
690 This variable also affects key bindings;
691 see the description of <code class="code">force-meta-prefix</code> below.
692 </p>
693 </dd>
694 <dt><a id="index-disable_002dcompletion"></a><span><code class="code">disable-completion</code><a class="copiable-link" href="#index-disable_002dcompletion"> &para;</a></span></dt>
695 <dd><p>If set to &lsquo;<samp class="samp">On</samp>&rsquo;, Readline inhibits word completion.
696 Completion characters are inserted into the line as if they
697 had been mapped to <code class="code">self-insert</code>.
698 The default is &lsquo;<samp class="samp">off</samp>&rsquo;.
699 </p>
700 </dd>
701 <dt><a id="index-echo_002dcontrol_002dcharacters"></a><span><code class="code">echo-control-characters</code><a class="copiable-link" href="#index-echo_002dcontrol_002dcharacters"> &para;</a></span></dt>
702 <dd><p>When set to &lsquo;<samp class="samp">on</samp>&rsquo;, on operating systems that indicate they support it,
703 Readline echoes a character corresponding to a signal generated from the
704 keyboard.
705 The default is &lsquo;<samp class="samp">on</samp>&rsquo;.
706 </p>
707 </dd>
708 <dt><a id="index-editing_002dmode"></a><span><code class="code">editing-mode</code><a class="copiable-link" href="#index-editing_002dmode"> &para;</a></span></dt>
709 <dd><p>The <code class="code">editing-mode</code> variable controls the default set of
710 key bindings.
711 By default, Readline starts up in emacs editing mode, where
712 the keystrokes are most similar to Emacs.
713 This variable can be set to either &lsquo;<samp class="samp">emacs</samp>&rsquo; or &lsquo;<samp class="samp">vi</samp>&rsquo;.
714 </p>
715 </dd>
716 <dt><a id="index-emacs_002dmode_002dstring"></a><span><code class="code">emacs-mode-string</code><a class="copiable-link" href="#index-emacs_002dmode_002dstring"> &para;</a></span></dt>
717 <dd><p>If the <var class="var">show-mode-in-prompt</var> variable is enabled,
718 this string is displayed immediately before the last line of the primary
719 prompt when emacs editing mode is active.
720 The value is expanded like a
721 key binding, so the standard set of meta- and control- prefixes and
722 backslash escape sequences is available.
723 The &lsquo;<samp class="samp">\1</samp>&rsquo; and &lsquo;<samp class="samp">\2</samp>&rsquo; escapes begin and end sequences of
724 non-printing characters, which can be used to embed a terminal control
725 sequence into the mode string.
726 The default is &lsquo;<samp class="samp">@</samp>&rsquo;.
727 </p>
728 </dd>
729 <dt><a id="index-enable_002dactive_002dregion-The"></a><span><code class="code">enable-active-region</code><a class="copiable-link" href="#index-enable_002dactive_002dregion-The"> &para;</a></span></dt>
730 <dd><p><em class="dfn">point</em> is the current cursor position, and <em class="dfn">mark</em> refers to a
731 saved cursor position (see <a class="pxref" href="#Commands-For-Moving">Commands For Moving</a>).
732 The text between the point and mark is referred to as the <em class="dfn">region</em>.
733 When this variable is set to &lsquo;<samp class="samp">On</samp>&rsquo;, Readline allows certain commands
734 to designate the region as <em class="dfn">active</em>.
735 When the region is active, Readline highlights the text in the region using
736 the value of the <code class="code">active-region-start-color</code>, which defaults to the
737 string that enables the terminal&rsquo;s standout mode.
738 The active region shows the text inserted by bracketed-paste and any
739 matching text found by incremental and non-incremental history searches.
740 The default is &lsquo;<samp class="samp">On</samp>&rsquo;.
741 </p>
742 </dd>
743 <dt><a id="index-enable_002dbracketed_002dpaste"></a><span><code class="code">enable-bracketed-paste</code><a class="copiable-link" href="#index-enable_002dbracketed_002dpaste"> &para;</a></span></dt>
744 <dd><p>When set to &lsquo;<samp class="samp">On</samp>&rsquo;, Readline configures the terminal to insert each
745 paste into the editing buffer as a single string of characters, instead
746 of treating each character as if it had been read from the keyboard.
747 This is called putting the terminal into <em class="dfn">bracketed paste mode</em>;
748 it prevents Readline from executing any editing commands bound
749 to key sequences appearing in the pasted text.
750 The default is &lsquo;<samp class="samp">On</samp>&rsquo;.
751 </p>
752 </dd>
753 <dt><a id="index-enable_002dkeypad"></a><span><code class="code">enable-keypad</code><a class="copiable-link" href="#index-enable_002dkeypad"> &para;</a></span></dt>
754 <dd><p>When set to &lsquo;<samp class="samp">on</samp>&rsquo;, Readline tries to enable the application
755 keypad when it is called.
756 Some systems need this to enable the arrow keys.
757 The default is &lsquo;<samp class="samp">off</samp>&rsquo;.
758 </p>
759 </dd>
760 <dt><a id="index-enable_002dmeta_002dkey"></a><span><code class="code">enable-meta-key</code><a class="copiable-link" href="#index-enable_002dmeta_002dkey"> &para;</a></span></dt>
761 <dd><p>When set to &lsquo;<samp class="samp">on</samp>&rsquo;, Readline tries to enable any meta
762 modifier key the terminal claims to support when it is called.
763 On many terminals, the Meta key is used to send eight-bit characters;
764 this variable checks for the terminal capability that indicates the
765 terminal can enable and disable a mode that sets the eighth bit of a
766 character (0200) if the Meta key is held down when the character is
767 typed (a meta character).
768 The default is &lsquo;<samp class="samp">on</samp>&rsquo;.
769 </p>
770 </dd>
771 <dt><a id="index-expand_002dtilde"></a><span><code class="code">expand-tilde</code><a class="copiable-link" href="#index-expand_002dtilde"> &para;</a></span></dt>
772 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, Readline attempts tilde expansion when it
773 attempts word completion.
774 The default is &lsquo;<samp class="samp">off</samp>&rsquo;.
775 </p>
776 </dd>
777 <dt><a id="index-force_002dmeta_002dprefix"></a><span><code class="code">force-meta-prefix</code><a class="copiable-link" href="#index-force_002dmeta_002dprefix"> &para;</a></span></dt>
778 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, Readline modifies its behavior when binding key
779 sequences containing <kbd class="kbd">\M-</kbd> or <code class="code">Meta-</code>
780 (see <code class="code">Key Bindings</code> in <a class="ref" href="#Readline-Init-File-Syntax">Readline Init File Syntax</a>)
781 by converting a key sequence of the form
782 <kbd class="kbd">\M-</kbd><var class="var">C</var> or <code class="code">Meta-</code><var class="var">C</var> to the two-character sequence
783 <kbd class="kbd">ESC</kbd> <var class="var">C</var> (adding the meta prefix).
784 If <code class="code">force-meta-prefix</code> is set to &lsquo;<samp class="samp">off</samp>&rsquo; (the default),
785 Readline uses the value of the <code class="code">convert-meta</code> variable to determine
786 whether to perform this conversion:
787 if <code class="code">convert-meta</code> is &lsquo;<samp class="samp">on</samp>&rsquo;,
788 Readline performs the conversion described above;
789 if it is &lsquo;<samp class="samp">off</samp>&rsquo;, Readline converts <var class="var">C</var> to a meta character by
790 setting the eighth bit (0200).
791 The default is &lsquo;<samp class="samp">off</samp>&rsquo;.
792 </p>
793 </dd>
794 <dt><a id="index-history_002dpreserve_002dpoint"></a><span><code class="code">history-preserve-point</code><a class="copiable-link" href="#index-history_002dpreserve_002dpoint"> &para;</a></span></dt>
795 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, the history code attempts to place the point (the
796 current cursor position) at the
797 same location on each history line retrieved with <code class="code">previous-history</code>
798 or <code class="code">next-history</code>.
799 The default is &lsquo;<samp class="samp">off</samp>&rsquo;.
800 </p>
801 </dd>
802 <dt><a id="index-history_002dsize"></a><span><code class="code">history-size</code><a class="copiable-link" href="#index-history_002dsize"> &para;</a></span></dt>
803 <dd><p>Set the maximum number of history entries saved in the history list.
804 If set to zero, any existing history entries are deleted and no new entries
805 are saved.
806 If set to a value less than zero, the number of history entries is not
807 limited.
808 By default, the number of history entries is not limited.
809 If you try to set <var class="var">history-size</var> to a non-numeric value,
810 the maximum number of history entries will be set to 500.
811 </p>
812 </dd>
813 <dt><a id="index-horizontal_002dscroll_002dmode"></a><span><code class="code">horizontal-scroll-mode</code><a class="copiable-link" href="#index-horizontal_002dscroll_002dmode"> &para;</a></span></dt>
814 <dd><p>Setting this variable to &lsquo;<samp class="samp">on</samp>&rsquo; means that the text of the lines
815 being edited will scroll horizontally on a single screen line when
816 the lines are longer than the width of the screen, instead of wrapping
817 onto a new screen line.
818 This variable is automatically set to &lsquo;<samp class="samp">on</samp>&rsquo; for terminals of height 1.
819 By default, this variable is set to &lsquo;<samp class="samp">off</samp>&rsquo;.
820 </p>
821 </dd>
822 <dt><a class="index-entry-id" id="index-meta_002dflag"></a>
823 <a id="index-input_002dmeta"></a><span><code class="code">input-meta</code><a class="copiable-link" href="#index-input_002dmeta"> &para;</a></span></dt>
824 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, Readline enables eight-bit input (that is, it
825 does not clear the eighth bit in the characters it reads),
826 regardless of what the terminal claims it can support.
827 The default value is &lsquo;<samp class="samp">off</samp>&rsquo;, but Readline sets it to &lsquo;<samp class="samp">on</samp>&rsquo;
828 if the locale contains characters whose encodings may include bytes
829 with the eighth bit set.
830 This variable is dependent on the <code class="code">LC_CTYPE</code> locale category, and
831 its value may change if the locale changes.
832 The name <code class="code">meta-flag</code> is a synonym for <code class="code">input-meta</code>.
833 </p>
834 </dd>
835 <dt><a id="index-isearch_002dterminators"></a><span><code class="code">isearch-terminators</code><a class="copiable-link" href="#index-isearch_002dterminators"> &para;</a></span></dt>
836 <dd><p>The string of characters that should terminate an incremental search without
837 subsequently executing the character as a command (see <a class="pxref" href="#Searching">Searching for Commands in the History</a>).
838 If this variable has not been given a value, the characters <kbd class="key">ESC</kbd> and
839 <kbd class="kbd">C-j</kbd> terminate an incremental search.
840 </p>
841 </dd>
842 <dt><a id="index-keymap"></a><span><code class="code">keymap</code><a class="copiable-link" href="#index-keymap"> &para;</a></span></dt>
843 <dd><p>Sets Readline&rsquo;s idea of the current keymap for key binding commands.
844 Built-in <code class="code">keymap</code> names are
845 <code class="code">emacs</code>,
846 <code class="code">emacs-standard</code>,
847 <code class="code">emacs-meta</code>,
848 <code class="code">emacs-ctlx</code>,
849 <code class="code">vi</code>,
850 <code class="code">vi-move</code>,
851 <code class="code">vi-command</code>, and
852 <code class="code">vi-insert</code>.
853 <code class="code">vi</code> is equivalent to <code class="code">vi-command</code> (<code class="code">vi-move</code> is also a
854 synonym); <code class="code">emacs</code> is equivalent to <code class="code">emacs-standard</code>.
855 Applications may add additional names.
856 The default value is <code class="code">emacs</code>;
857 the value of the <code class="code">editing-mode</code> variable also affects the
858 default keymap.
859 </p>
860 </dd>
861 <dt><code class="code">keyseq-timeout</code></dt>
862 <dd><p>Specifies the duration Readline will wait for a character when
863 reading an ambiguous key sequence
864 (one that can form a complete key sequence using the input read so far,
865 or can take additional input to complete a longer key sequence).
866 If Readline doesn&rsquo;t receive any input within the timeout, it uses the
867 shorter but complete key sequence.
868 Readline uses this value to determine whether or not input is
869 available on the current input source (<code class="code">rl_instream</code> by default).
870 The value is specified in milliseconds, so a value of 1000 means that
871 Readline will wait one second for additional input.
872 If this variable is set to a value less than or equal to zero, or to a
873 non-numeric value, Readline waits until another key is pressed to
874 decide which key sequence to complete.
875 The default value is <code class="code">500</code>.
876 </p>
877 </dd>
878 <dt><code class="code">mark-directories</code></dt>
879 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, completed directory names have a slash appended.
880 The default is &lsquo;<samp class="samp">on</samp>&rsquo;.
881 </p>
882 </dd>
883 <dt><a id="index-mark_002dmodified_002dlines"></a><span><code class="code">mark-modified-lines</code><a class="copiable-link" href="#index-mark_002dmodified_002dlines"> &para;</a></span></dt>
884 <dd><p>When this variable is set to &lsquo;<samp class="samp">on</samp>&rsquo;, Readline displays an
885 asterisk (&lsquo;<samp class="samp">*</samp>&rsquo;) at the start of history lines which have been modified.
886 This variable is &lsquo;<samp class="samp">off</samp>&rsquo; by default.
887 </p>
888 </dd>
889 <dt><a id="index-mark_002dsymlinked_002ddirectories"></a><span><code class="code">mark-symlinked-directories</code><a class="copiable-link" href="#index-mark_002dsymlinked_002ddirectories"> &para;</a></span></dt>
890 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, completed names which are symbolic links to directories
891 have a slash appended, subject to the value of <code class="code">mark-directories</code>.
892 The default is &lsquo;<samp class="samp">off</samp>&rsquo;.
893 </p>
894 </dd>
895 <dt><a id="index-match_002dhidden_002dfiles"></a><span><code class="code">match-hidden-files</code><a class="copiable-link" href="#index-match_002dhidden_002dfiles"> &para;</a></span></dt>
896 <dd><p>This variable, when set to &lsquo;<samp class="samp">on</samp>&rsquo;, forces Readline to match files whose
897 names begin with a &lsquo;<samp class="samp">.</samp>&rsquo; (hidden files) when performing filename
898 completion.
899 If set to &lsquo;<samp class="samp">off</samp>&rsquo;, the user must include the leading &lsquo;<samp class="samp">.</samp>&rsquo;
900 in the filename to be completed.
901 This variable is &lsquo;<samp class="samp">on</samp>&rsquo; by default.
902 </p>
903 </dd>
904 <dt><a id="index-menu_002dcomplete_002ddisplay_002dprefix"></a><span><code class="code">menu-complete-display-prefix</code><a class="copiable-link" href="#index-menu_002dcomplete_002ddisplay_002dprefix"> &para;</a></span></dt>
905 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, menu completion displays the common prefix of the
906 list of possible completions (which may be empty) before cycling through
907 the list.
908 The default is &lsquo;<samp class="samp">off</samp>&rsquo;.
909 </p>
910 </dd>
911 <dt><a id="index-output_002dmeta"></a><span><code class="code">output-meta</code><a class="copiable-link" href="#index-output_002dmeta"> &para;</a></span></dt>
912 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, Readline displays characters with the
913 eighth bit set directly rather than as a meta-prefixed escape
914 sequence.
915 The default is &lsquo;<samp class="samp">off</samp>&rsquo;, but Readline sets it to &lsquo;<samp class="samp">on</samp>&rsquo;
916 if the locale contains characters whose encodings may include
917 bytes with the eighth bit set.
918 This variable is dependent on the <code class="code">LC_CTYPE</code> locale category, and
919 its value may change if the locale changes.
920 </p>
921 </dd>
922 <dt><a id="index-page_002dcompletions"></a><span><code class="code">page-completions</code><a class="copiable-link" href="#index-page_002dcompletions"> &para;</a></span></dt>
923 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, Readline uses an internal pager resembling
924 <i class="i">more</i>(1)
925 to display a screenful of possible completions at a time.
926 This variable is &lsquo;<samp class="samp">on</samp>&rsquo; by default.
927 </p>
928 </dd>
929 <dt><code class="code">prefer-visible-bell</code></dt>
930 <dd><p>See <code class="code">bell-style</code>.
931 </p>
932 </dd>
933 <dt><code class="code">print-completions-horizontally</code></dt>
934 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, Readline displays completions with matches
935 sorted horizontally in alphabetical order, rather than down the screen.
936 The default is &lsquo;<samp class="samp">off</samp>&rsquo;.
937 </p>
938 </dd>
939 <dt><a id="index-revert_002dall_002dat_002dnewline"></a><span><code class="code">revert-all-at-newline</code><a class="copiable-link" href="#index-revert_002dall_002dat_002dnewline"> &para;</a></span></dt>
940 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, Readline will undo all changes to history lines
941 before returning when executing <code class="code">accept-line</code>.
942 By default,
943 history lines may be modified and retain individual undo lists across
944 calls to <code class="code">readline()</code>.
945 The default is &lsquo;<samp class="samp">off</samp>&rsquo;.
946 </p>
947 </dd>
948 <dt><a id="index-search_002dignore_002dcase"></a><span><code class="code">search-ignore-case</code><a class="copiable-link" href="#index-search_002dignore_002dcase"> &para;</a></span></dt>
949 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, Readline performs incremental and non-incremental
950 history list searches in a case-insensitive fashion.
951 The default value is &lsquo;<samp class="samp">off</samp>&rsquo;.
952 </p>
953 </dd>
954 <dt><a id="index-show_002dall_002dif_002dambiguous"></a><span><code class="code">show-all-if-ambiguous</code><a class="copiable-link" href="#index-show_002dall_002dif_002dambiguous"> &para;</a></span></dt>
955 <dd><p>This alters the default behavior of the completion functions.
956 If set to &lsquo;<samp class="samp">on</samp>&rsquo;,
957 words which have more than one possible completion cause the
958 matches to be listed immediately instead of ringing the bell.
959 The default value is &lsquo;<samp class="samp">off</samp>&rsquo;.
960 </p>
961 </dd>
962 <dt><a id="index-show_002dall_002dif_002dunmodified"></a><span><code class="code">show-all-if-unmodified</code><a class="copiable-link" href="#index-show_002dall_002dif_002dunmodified"> &para;</a></span></dt>
963 <dd><p>This alters the default behavior of the completion functions in
964 a fashion similar to <var class="var">show-all-if-ambiguous</var>.
965 If set to &lsquo;<samp class="samp">on</samp>&rsquo;,
966 words which have more than one possible completion without any
967 possible partial completion (the possible completions don&rsquo;t share
968 a common prefix) cause the matches to be listed immediately instead
969 of ringing the bell.
970 The default value is &lsquo;<samp class="samp">off</samp>&rsquo;.
971 </p>
972 </dd>
973 <dt><a id="index-show_002dmode_002din_002dprompt"></a><span><code class="code">show-mode-in-prompt</code><a class="copiable-link" href="#index-show_002dmode_002din_002dprompt"> &para;</a></span></dt>
974 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, add a string to the beginning of the prompt
975 indicating the editing mode: emacs, vi command, or vi insertion.
976 The mode strings are user-settable (e.g., <var class="var">emacs-mode-string</var>).
977 The default value is &lsquo;<samp class="samp">off</samp>&rsquo;.
978 </p>
979 </dd>
980 <dt><a id="index-skip_002dcompleted_002dtext"></a><span><code class="code">skip-completed-text</code><a class="copiable-link" href="#index-skip_002dcompleted_002dtext"> &para;</a></span></dt>
981 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, this alters the default completion behavior when
982 inserting a single match into the line.
983 It&rsquo;s only active when performing completion in the middle of a word.
984 If enabled, Readline does not insert characters from the completion
985 that match characters after point in the word being completed,
986 so portions of the word following the cursor are not duplicated.
987 For instance, if this is enabled, attempting completion when the cursor
988 is after the first &lsquo;<samp class="samp">e</samp>&rsquo; in &lsquo;<samp class="samp">Makefile</samp>&rsquo; will result in
989 &lsquo;<samp class="samp">Makefile</samp>&rsquo; rather than &lsquo;<samp class="samp">Makefilefile</samp>&rsquo;,
990 assuming there is a single possible completion.
991 The default value is &lsquo;<samp class="samp">off</samp>&rsquo;.
992 </p>
993 </dd>
994 <dt><a id="index-vi_002dcmd_002dmode_002dstring"></a><span><code class="code">vi-cmd-mode-string</code><a class="copiable-link" href="#index-vi_002dcmd_002dmode_002dstring"> &para;</a></span></dt>
995 <dd><p>If the <var class="var">show-mode-in-prompt</var> variable is enabled,
996 this string is displayed immediately before the last line of the primary
997 prompt when vi editing mode is active and in command mode.
998 The value is expanded like a key binding, so the standard set of
999 meta- and control- prefixes and backslash escape sequences is available.
1000 The &lsquo;<samp class="samp">\1</samp>&rsquo; and &lsquo;<samp class="samp">\2</samp>&rsquo; escapes begin and end sequences of
1001 non-printing characters, which can be used to embed a terminal control
1002 sequence into the mode string.
1003 The default is &lsquo;<samp class="samp">(cmd)</samp>&rsquo;.
1004 </p>
1005 </dd>
1006 <dt><a id="index-vi_002dins_002dmode_002dstring"></a><span><code class="code">vi-ins-mode-string</code><a class="copiable-link" href="#index-vi_002dins_002dmode_002dstring"> &para;</a></span></dt>
1007 <dd><p>If the <var class="var">show-mode-in-prompt</var> variable is enabled,
1008 this string is displayed immediately before the last line of the primary
1009 prompt when vi editing mode is active and in insertion mode.
1010 The value is expanded like a key binding, so the standard set of
1011 meta- and control- prefixes and backslash escape sequences is available.
1012 The &lsquo;<samp class="samp">\1</samp>&rsquo; and &lsquo;<samp class="samp">\2</samp>&rsquo; escapes begin and end sequences of
1013 non-printing characters, which can be used to embed a terminal control
1014 sequence into the mode string.
1015 The default is &lsquo;<samp class="samp">(ins)</samp>&rsquo;.
1016 </p>
1017 </dd>
1018 <dt><a id="index-visible_002dstats"></a><span><code class="code">visible-stats</code><a class="copiable-link" href="#index-visible_002dstats"> &para;</a></span></dt>
1019 <dd><p>If set to &lsquo;<samp class="samp">on</samp>&rsquo;, a character denoting a file&rsquo;s type
1020 is appended to the filename when listing possible
1021 completions.
1022 The default is &lsquo;<samp class="samp">off</samp>&rsquo;.
1023 </p>
1024 </dd>
1025 </dl>
1026
1027 </dd>
1028 <dt>Key Bindings</dt>
1029 <dd><p>The syntax for controlling key bindings in the init file is simple.
1030 First you need to find the name of the command that you
1031 want to change.
1032 The following sections contain tables of the command
1033 name, the default keybinding, if any, and a short description of what
1034 the command does.
1035 </p>
1036 <p>Once you know the name of the command, simply place on a line
1037 in the init file the name of the key
1038 you wish to bind the command to, a colon, and then the name of the
1039 command.
1040 There can be no space between the key name and the colon &ndash; that will be
1041 interpreted as part of the key name.
1042 The name of the key can be expressed in different ways, depending on
1043 what you find most comfortable.
1044 </p>
1045 <p>In addition to command names, Readline allows keys to be bound
1046 to a string that is inserted when the key is pressed (a <var class="var">macro</var>).
1047 The difference between a macro and a command is that a macro is
1048 enclosed in single or double quotes.
1049 </p>
1050
1051 <dl class="table">
1052 <dt><var class="var">keyname</var>:&nbsp;<var class="var">function-name</var>&nbsp;or&nbsp;<var class="var">macro</var><!-- /@w --></dt>
1053 <dd><p><var class="var">keyname</var> is the name of a key spelled out in English.
1054 For example:
1055 </p><div class="example">
1056 <pre class="example-preformatted">Control-u: universal-argument
1057 Meta-Rubout: backward-kill-word
1058 Control-o: &quot;&gt; output&quot;
1059 </pre></div>
1060
1061 <p>In the example above, <kbd class="kbd">C-u</kbd> is bound to the function
1062 <code class="code">universal-argument</code>,
1063 <kbd class="kbd">M-DEL</kbd> is bound to the function <code class="code">backward-kill-word</code>, and
1064 <kbd class="kbd">C-o</kbd> is bound to run the macro
1065 expressed on the right hand side (that is, to insert the text
1066 &lsquo;<samp class="samp">&gt; output</samp>&rsquo; into the line).
1067 </p>
1068 <p>This key binding syntax recognizes a number of symbolic character names:
1069 <var class="var">DEL</var>,
1070 <var class="var">ESC</var>,
1071 <var class="var">ESCAPE</var>,
1072 <var class="var">LFD</var>,
1073 <var class="var">NEWLINE</var>,
1074 <var class="var">RET</var>,
1075 <var class="var">RETURN</var>,
1076 <var class="var">RUBOUT</var>
1077 (a destructive backspace),
1078 <var class="var">SPACE</var>,
1079 <var class="var">SPC</var>,
1080 and
1081 <var class="var">TAB</var>.
1082 </p>
1083 </dd>
1084 <dt>&quot;<var class="var">keyseq</var>&quot;:&nbsp;<var class="var">function-name</var>&nbsp;or&nbsp;<var class="var">macro</var><!-- /@w --></dt>
1085 <dd><p><var class="var">keyseq</var> differs from <var class="var">keyname</var> above in that strings
1086 denoting an entire key sequence can be specified, by placing
1087 the key sequence in double quotes.
1088 Some <small class="sc">GNU</small> Emacs style key escapes can be used,
1089 as in the following example, but none of the
1090 special character names are recognized.
1091 </p>
1092 <div class="example">
1093 <pre class="example-preformatted">&quot;\C-u&quot;: universal-argument
1094 &quot;\C-x\C-r&quot;: re-read-init-file
1095 &quot;\e[11~&quot;: &quot;Function Key 1&quot;
1096 </pre></div>
1097
1098 <p>In the above example, <kbd class="kbd">C-u</kbd> is again bound to the function
1099 <code class="code">universal-argument</code> (just as it was in the first example),
1100 &lsquo;<samp class="samp"><kbd class="kbd">C-x</kbd> <kbd class="kbd">C-r</kbd></samp>&rsquo; is bound to the function <code class="code">re-read-init-file</code>,
1101 and &lsquo;<samp class="samp"><kbd class="key">ESC</kbd> <kbd class="key">[</kbd> <kbd class="key">1</kbd> <kbd class="key">1</kbd> <kbd class="key">~</kbd></samp>&rsquo; is bound to insert
1102 the text &lsquo;<samp class="samp">Function Key 1</samp>&rsquo;.
1103 </p>
1104 </dd>
1105 </dl>
1106
1107 <p>The following <small class="sc">GNU</small> Emacs style escape sequences are available when
1108 specifying key sequences:
1109 </p>
1110 <dl class="table">
1111 <dt><code class="code"><kbd class="kbd">\C-</kbd></code></dt>
1112 <dd><p>A control prefix.
1113 </p></dd>
1114 <dt><code class="code"><kbd class="kbd">\M-</kbd></code></dt>
1115 <dd><p>Adding the meta prefix or converting the following character to a meta
1116 character, as described above under <code class="code">force-meta-prefix</code>
1117 (see <code class="code">Variable Settings</code> in <a class="ref" href="#Readline-Init-File-Syntax">Readline Init File Syntax</a>).
1118 </p></dd>
1119 <dt><code class="code"><kbd class="kbd">\e</kbd></code></dt>
1120 <dd><p>An escape character.
1121 </p></dd>
1122 <dt><code class="code"><kbd class="kbd">\\</kbd></code></dt>
1123 <dd><p>Backslash.
1124 </p></dd>
1125 <dt><code class="code"><kbd class="kbd">\&quot;</kbd></code></dt>
1126 <dd><p><kbd class="key">&quot;</kbd>, a double quotation mark.
1127 </p></dd>
1128 <dt><code class="code"><kbd class="kbd">\'</kbd></code></dt>
1129 <dd><p><kbd class="key">'</kbd>, a single quote or apostrophe.
1130 </p></dd>
1131 </dl>
1132
1133 <p>In addition to the <small class="sc">GNU</small> Emacs style escape sequences, a second
1134 set of backslash escapes is available:
1135 </p>
1136 <dl class="table">
1137 <dt><code class="code">\a</code></dt>
1138 <dd><p>alert (bell)
1139 </p></dd>
1140 <dt><code class="code">\b</code></dt>
1141 <dd><p>backspace
1142 </p></dd>
1143 <dt><code class="code">\d</code></dt>
1144 <dd><p>delete
1145 </p></dd>
1146 <dt><code class="code">\f</code></dt>
1147 <dd><p>form feed
1148 </p></dd>
1149 <dt><code class="code">\n</code></dt>
1150 <dd><p>newline
1151 </p></dd>
1152 <dt><code class="code">\r</code></dt>
1153 <dd><p>carriage return
1154 </p></dd>
1155 <dt><code class="code">\t</code></dt>
1156 <dd><p>horizontal tab
1157 </p></dd>
1158 <dt><code class="code">\v</code></dt>
1159 <dd><p>vertical tab
1160 </p></dd>
1161 <dt><code class="code">\<var class="var">nnn</var></code></dt>
1162 <dd><p>The eight-bit character whose value is the octal value <var class="var">nnn</var>
1163 (one to three digits).
1164 </p></dd>
1165 <dt><code class="code">\x<var class="var">HH</var></code></dt>
1166 <dd><p>The eight-bit character whose value is the hexadecimal value <var class="var">HH</var>
1167 (one or two hex digits).
1168 </p></dd>
1169 </dl>
1170
1171 <p>When entering the text of a macro, single or double quotes must
1172 be used to indicate a macro definition.
1173 Unquoted text is assumed to be a function name.
1174 The backslash escapes described above are expanded
1175 in the macro body.
1176 Backslash will quote any other character in the macro text,
1177 including &lsquo;<samp class="samp">&quot;</samp>&rsquo; and &lsquo;<samp class="samp">'</samp>&rsquo;.
1178 For example, the following binding will make &lsquo;<samp class="samp"><kbd class="kbd">C-x</kbd> \</samp>&rsquo;
1179 insert a single &lsquo;<samp class="samp">\</samp>&rsquo; into the line:
1180 </p><div class="example">
1181 <pre class="example-preformatted">&quot;\C-x\\&quot;: &quot;\\&quot;
1182 </pre></div>
1183
1184 </dd>
1185 </dl>
1186
1187 <hr>
1188 </div>
1189 <div class="subsection-level-extent" id="Conditional-Init-Constructs">
1190 <div class="nav-panel">
1191 <p>
1192 Next: <a href="#Sample-Init-File" accesskey="n" rel="next">Sample Init File</a>, Previous: <a href="#Readline-Init-File-Syntax" accesskey="p" rel="prev">Readline Init File Syntax</a>, Up: <a href="#Readline-Init-File" accesskey="u" rel="up">Readline Init File</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1193 </div>
1194 <h4 class="subsection" id="Conditional-Init-Constructs-1"><span>1.3.2 Conditional Init Constructs<a class="copiable-link" href="#Conditional-Init-Constructs-1"> &para;</a></span></h4>
1195
1196 <p>Readline implements a facility similar in spirit to the conditional
1197 compilation features of the C preprocessor which allows key
1198 bindings and variable settings to be performed as the result
1199 of tests.
1200 There are four parser directives available.
1201 </p>
1202 <dl class="table">
1203 <dt><code class="code">$if</code></dt>
1204 <dd><p>The <code class="code">$if</code> construct allows bindings to be made based on the
1205 editing mode, the terminal being used, or the application using
1206 Readline.
1207 The text of the test, after any comparison operator,
1208 extends to the end of the line;
1209 unless otherwise noted, no characters are required to isolate it.
1210 </p>
1211 <dl class="table">
1212 <dt><code class="code">mode</code></dt>
1213 <dd><p>The <code class="code">mode=</code> form of the <code class="code">$if</code> directive is used to test
1214 whether Readline is in <code class="code">emacs</code> or <code class="code">vi</code> mode.
1215 This may be used in conjunction
1216 with the &lsquo;<samp class="samp">set keymap</samp>&rsquo; command, for instance, to set bindings in
1217 the <code class="code">emacs-standard</code> and <code class="code">emacs-ctlx</code> keymaps only if
1218 Readline is starting out in <code class="code">emacs</code> mode.
1219 </p>
1220 </dd>
1221 <dt><code class="code">term</code></dt>
1222 <dd><p>The <code class="code">term=</code> form may be used to include terminal-specific
1223 key bindings, perhaps to bind the key sequences output by the
1224 terminal&rsquo;s function keys.
1225 The word on the right side of the
1226 &lsquo;<samp class="samp">=</samp>&rsquo;
1227 is tested against both the full name of the terminal and the portion
1228 of the terminal name before the first &lsquo;<samp class="samp">-</samp>&rsquo;.
1229 This allows <code class="code">xterm</code> to match both <code class="code">xterm</code> and
1230 <code class="code">xterm-256color</code>, for instance.
1231 </p>
1232 </dd>
1233 <dt><code class="code">version</code></dt>
1234 <dd><p>The <code class="code">version</code> test may be used to perform comparisons against
1235 specific Readline versions.
1236 The <code class="code">version</code> expands to the current Readline version.
1237 The set of comparison operators includes
1238 &lsquo;<samp class="samp">=</samp>&rsquo; (and &lsquo;<samp class="samp">==</samp>&rsquo;), &lsquo;<samp class="samp">!=</samp>&rsquo;, &lsquo;<samp class="samp">&lt;=</samp>&rsquo;, &lsquo;<samp class="samp">&gt;=</samp>&rsquo;, &lsquo;<samp class="samp">&lt;</samp>&rsquo;,
1239 and &lsquo;<samp class="samp">&gt;</samp>&rsquo;.
1240 The version number supplied on the right side of the operator consists
1241 of a major version number, an optional decimal point, and an optional
1242 minor version (e.g., &lsquo;<samp class="samp">7.1</samp>&rsquo;).
1243 If the minor version is omitted, it
1244 defaults to &lsquo;<samp class="samp">0</samp>&rsquo;.
1245 The operator may be separated from the string <code class="code">version</code> and
1246 from the version number argument by whitespace.
1247 The following example sets a variable if the Readline version being used
1248 is 7.0 or newer:
1249 </p><div class="example">
1250 <pre class="example-preformatted">$if version &gt;= 7.0
1251 set show-mode-in-prompt on
1252 $endif
1253 </pre></div>
1254
1255 </dd>
1256 <dt><code class="code">application</code></dt>
1257 <dd><p>The <var class="var">application</var> construct is used to include
1258 application-specific settings.
1259 Each program using the Readline
1260 library sets the <var class="var">application name</var>, and you can test for
1261 a particular value.
1262 This could be used to bind key sequences to functions useful for
1263 a specific program.
1264 For instance, the following command adds a
1265 key sequence that quotes the current or previous word in Bash:
1266 </p><div class="example">
1267 <pre class="example-preformatted">$if Bash
1268 # Quote the current or previous word
1269 &quot;\C-xq&quot;: &quot;\eb\&quot;\ef\&quot;&quot;
1270 $endif
1271 </pre></div>
1272
1273 </dd>
1274 <dt><code class="code">variable</code></dt>
1275 <dd><p>The <var class="var">variable</var> construct provides simple equality tests for Readline
1276 variables and values.
1277 The permitted comparison operators are &lsquo;<samp class="samp">=</samp>&rsquo;, &lsquo;<samp class="samp">==</samp>&rsquo;, and &lsquo;<samp class="samp">!=</samp>&rsquo;.
1278 The variable name must be separated from the comparison operator by
1279 whitespace; the operator may be separated from the value on the right hand
1280 side by whitespace.
1281 String and boolean variables may be tested.
1282 Boolean variables must be
1283 tested against the values <var class="var">on</var> and <var class="var">off</var>.
1284 The following example is equivalent to the <code class="code">mode=emacs</code> test described
1285 above:
1286 </p><div class="example">
1287 <pre class="example-preformatted">$if editing-mode == emacs
1288 set show-mode-in-prompt on
1289 $endif
1290 </pre></div>
1291 </dd>
1292 </dl>
1293
1294 </dd>
1295 <dt><code class="code">$else</code></dt>
1296 <dd><p>Commands in this branch of the <code class="code">$if</code> directive are executed if
1297 the test fails.
1298 </p>
1299 </dd>
1300 <dt><code class="code">$endif</code></dt>
1301 <dd><p>This command, as seen in the previous example, terminates an
1302 <code class="code">$if</code> command.
1303 </p>
1304 </dd>
1305 <dt><code class="code">$include</code></dt>
1306 <dd><p>This directive takes a single filename as an argument and reads commands
1307 and key bindings from that file.
1308 For example, the following directive reads from <samp class="file">/etc/inputrc</samp>:
1309 </p><div class="example">
1310 <pre class="example-preformatted">$include /etc/inputrc
1311 </pre></div>
1312 </dd>
1313 </dl>
1314
1315 <hr>
1316 </div>
1317 <div class="subsection-level-extent" id="Sample-Init-File">
1318 <div class="nav-panel">
1319 <p>
1320 Previous: <a href="#Conditional-Init-Constructs" accesskey="p" rel="prev">Conditional Init Constructs</a>, Up: <a href="#Readline-Init-File" accesskey="u" rel="up">Readline Init File</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1321 </div>
1322 <h4 class="subsection" id="Sample-Init-File-1"><span>1.3.3 Sample Init File<a class="copiable-link" href="#Sample-Init-File-1"> &para;</a></span></h4>
1323
1324 <p>Here is an example of an <var class="var">inputrc</var> file. This illustrates key
1325 binding, variable assignment, and conditional syntax.
1326 </p>
1327 <div class="example">
1328 <pre class="example-preformatted"># This file controls the behavior of line input editing for
1329 # programs that use the GNU Readline library. Existing
1330 # programs include FTP, Bash, and GDB.
1331 #
1332 # You can re-read the inputrc file with C-x C-r.
1333 # Lines beginning with '#' are comments.
1334 #
1335 # First, include any system-wide bindings and variable
1336 # assignments from /etc/Inputrc
1337 $include /etc/Inputrc
1338
1339 #
1340 # Set various bindings for emacs mode.
1341
1342 set editing-mode emacs
1343
1344 $if mode=emacs
1345
1346 Meta-Control-h: backward-kill-word Text after the function name is ignored
1347
1348 #
1349 # Arrow keys in keypad mode
1350 #
1351 #&quot;\M-OD&quot;: backward-char
1352 #&quot;\M-OC&quot;: forward-char
1353 #&quot;\M-OA&quot;: previous-history
1354 #&quot;\M-OB&quot;: next-history
1355 #
1356 # Arrow keys in ANSI mode
1357 #
1358 &quot;\M-[D&quot;: backward-char
1359 &quot;\M-[C&quot;: forward-char
1360 &quot;\M-[A&quot;: previous-history
1361 &quot;\M-[B&quot;: next-history
1362 #
1363 # Arrow keys in 8 bit keypad mode
1364 #
1365 #&quot;\M-\C-OD&quot;: backward-char
1366 #&quot;\M-\C-OC&quot;: forward-char
1367 #&quot;\M-\C-OA&quot;: previous-history
1368 #&quot;\M-\C-OB&quot;: next-history
1369 #
1370 # Arrow keys in 8 bit ANSI mode
1371 #
1372 #&quot;\M-\C-[D&quot;: backward-char
1373 #&quot;\M-\C-[C&quot;: forward-char
1374 #&quot;\M-\C-[A&quot;: previous-history
1375 #&quot;\M-\C-[B&quot;: next-history
1376
1377 C-q: quoted-insert
1378
1379 $endif
1380
1381 # An old-style binding. This happens to be the default.
1382 TAB: complete
1383
1384 # Macros that are convenient for shell interaction
1385 $if Bash
1386 # edit the path
1387 &quot;\C-xp&quot;: &quot;PATH=${PATH}\e\C-e\C-a\ef\C-f&quot;
1388 # prepare to type a quoted word --
1389 # insert open and close double quotes
1390 # and move to just after the open quote
1391 &quot;\C-x\&quot;&quot;: &quot;\&quot;\&quot;\C-b&quot;
1392 # insert a backslash (testing backslash escapes
1393 # in sequences and macros)
1394 &quot;\C-x\\&quot;: &quot;\\&quot;
1395 # Quote the current or previous word
1396 &quot;\C-xq&quot;: &quot;\eb\&quot;\ef\&quot;&quot;
1397 # Add a binding to refresh the line, which is unbound
1398 &quot;\C-xr&quot;: redraw-current-line
1399 # Edit variable on current line.
1400 &quot;\M-\C-v&quot;: &quot;\C-a\C-k$\C-y\M-\C-e\C-a\C-y=&quot;
1401 $endif
1402
1403 # use a visible bell if one is available
1404 set bell-style visible
1405
1406 # don't strip characters to 7 bits when reading
1407 set input-meta on
1408
1409 # allow iso-latin1 characters to be inserted rather
1410 # than converted to prefix-meta sequences
1411 set convert-meta off
1412
1413 # display characters with the eighth bit set directly
1414 # rather than as meta-prefixed characters
1415 set output-meta on
1416
1417 # if there are 150 or more possible completions for a word,
1418 # ask whether or not the user wants to see all of them
1419 set completion-query-items 150
1420
1421 # For FTP
1422 $if Ftp
1423 &quot;\C-xg&quot;: &quot;get \M-?&quot;
1424 &quot;\C-xt&quot;: &quot;put \M-?&quot;
1425 &quot;\M-.&quot;: yank-last-arg
1426 $endif
1427 </pre></div>
1428
1429 <hr>
1430 </div>
1431 </div>
1432 <div class="section-level-extent" id="Bindable-Readline-Commands">
1433 <div class="nav-panel">
1434 <p>
1435 Next: <a href="#Readline-vi-Mode" accesskey="n" rel="next">Readline vi Mode</a>, Previous: <a href="#Readline-Init-File" accesskey="p" rel="prev">Readline Init File</a>, Up: <a href="#Command-Line-Editing" accesskey="u" rel="up">Command Line Editing</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1436 </div>
1437 <h3 class="section" id="Bindable-Readline-Commands-1"><span>1.4 Bindable Readline Commands<a class="copiable-link" href="#Bindable-Readline-Commands-1"> &para;</a></span></h3>
1438
1439
1440 <p>This section describes Readline commands that may be bound to key
1441 sequences.
1442 Command names without an accompanying key sequence are unbound by default.
1443 </p>
1444 <p>In the following descriptions, <em class="dfn">point</em> refers to the current cursor
1445 position, and <em class="dfn">mark</em> refers to a cursor position saved by the
1446 <code class="code">set-mark</code> command.
1447 The text between the point and mark is referred to as the <em class="dfn">region</em>.
1448 Readline
1449 has the concept of an <em class="emph">active region</em>:
1450 when the region is active,
1451 Readline redisplay highlights the region using the
1452 value of the
1453 <code class="code">active-region-start-color</code>
1454 variable.
1455 The <code class="code">enable-active-region</code> variable turns this on and off.
1456 Several commands set the region to active; those are noted below.
1457 </p>
1458 <ul class="mini-toc">
1459 <li><a href="#Commands-For-Moving" accesskey="1">Commands For Moving</a></li>
1460 <li><a href="#Commands-For-History" accesskey="2">Commands For Manipulating The History</a></li>
1461 <li><a href="#Commands-For-Text" accesskey="3">Commands For Changing Text</a></li>
1462 <li><a href="#Commands-For-Killing" accesskey="4">Killing And Yanking</a></li>
1463 <li><a href="#Numeric-Arguments" accesskey="5">Specifying Numeric Arguments</a></li>
1464 <li><a href="#Commands-For-Completion" accesskey="6">Letting Readline Type For You</a></li>
1465 <li><a href="#Keyboard-Macros" accesskey="7">Keyboard Macros</a></li>
1466 <li><a href="#Miscellaneous-Commands" accesskey="8">Some Miscellaneous Commands</a></li>
1467 </ul>
1468 <hr>
1469 <div class="subsection-level-extent" id="Commands-For-Moving">
1470 <div class="nav-panel">
1471 <p>
1472 Next: <a href="#Commands-For-History" accesskey="n" rel="next">Commands For Manipulating The History</a>, Up: <a href="#Bindable-Readline-Commands" accesskey="u" rel="up">Bindable Readline Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1473 </div>
1474 <h4 class="subsection" id="Commands-For-Moving-1"><span>1.4.1 Commands For Moving<a class="copiable-link" href="#Commands-For-Moving-1"> &para;</a></span></h4>
1475 <dl class="ftable">
1476 <dt><a id="index-beginning_002dof_002dline-_0028C_002da_0029"></a><span><code class="code">beginning-of-line (C-a)</code><a class="copiable-link" href="#index-beginning_002dof_002dline-_0028C_002da_0029"> &para;</a></span></dt>
1477 <dd><p>Move to the start of the current line.
1478 This may also be bound to the Home key on some keyboards.
1479 </p>
1480 </dd>
1481 <dt><a id="index-end_002dof_002dline-_0028C_002de_0029"></a><span><code class="code">end-of-line (C-e)</code><a class="copiable-link" href="#index-end_002dof_002dline-_0028C_002de_0029"> &para;</a></span></dt>
1482 <dd><p>Move to the end of the line.
1483 This may also be bound to the End key on some keyboards.
1484 </p>
1485 </dd>
1486 <dt><a id="index-forward_002dchar-_0028C_002df_0029"></a><span><code class="code">forward-char (C-f)</code><a class="copiable-link" href="#index-forward_002dchar-_0028C_002df_0029"> &para;</a></span></dt>
1487 <dd><p>Move forward a character.
1488 This may also be bound to the right arrow key on some keyboards.
1489 </p>
1490 </dd>
1491 <dt><a id="index-backward_002dchar-_0028C_002db_0029"></a><span><code class="code">backward-char (C-b)</code><a class="copiable-link" href="#index-backward_002dchar-_0028C_002db_0029"> &para;</a></span></dt>
1492 <dd><p>Move back a character.
1493 This may also be bound to the left arrow key on some keyboards.
1494 </p>
1495 </dd>
1496 <dt><a id="index-forward_002dword-_0028M_002df_0029"></a><span><code class="code">forward-word (M-f)</code><a class="copiable-link" href="#index-forward_002dword-_0028M_002df_0029"> &para;</a></span></dt>
1497 <dd><p>Move forward to the end of the next word.
1498 Words are composed of letters and digits.
1499 </p>
1500 </dd>
1501 <dt><a id="index-backward_002dword-_0028M_002db_0029"></a><span><code class="code">backward-word (M-b)</code><a class="copiable-link" href="#index-backward_002dword-_0028M_002db_0029"> &para;</a></span></dt>
1502 <dd><p>Move back to the start of the current or previous word.
1503 Words are composed of letters and digits.
1504 </p>
1505
1506 </dd>
1507 <dt><a id="index-previous_002dscreen_002dline-_0028_0029"></a><span><code class="code">previous-screen-line ()</code><a class="copiable-link" href="#index-previous_002dscreen_002dline-_0028_0029"> &para;</a></span></dt>
1508 <dd><p>Attempt to move point to the same physical screen column on the previous
1509 physical screen line.
1510 This will not have the desired effect if the current
1511 Readline line does not take up more than one physical line or if point is not
1512 greater than the length of the prompt plus the screen width.
1513 </p>
1514 </dd>
1515 <dt><a id="index-next_002dscreen_002dline-_0028_0029"></a><span><code class="code">next-screen-line ()</code><a class="copiable-link" href="#index-next_002dscreen_002dline-_0028_0029"> &para;</a></span></dt>
1516 <dd><p>Attempt to move point to the same physical screen column on the next
1517 physical screen line.
1518 This will not have the desired effect if the current
1519 Readline line does not take up more than one physical line or if the length
1520 of the current Readline line is not greater than the length of the prompt
1521 plus the screen width.
1522 </p>
1523 </dd>
1524 <dt><a id="index-clear_002ddisplay-_0028M_002dC_002dl_0029"></a><span><code class="code">clear-display (M-C-l)</code><a class="copiable-link" href="#index-clear_002ddisplay-_0028M_002dC_002dl_0029"> &para;</a></span></dt>
1525 <dd><p>Clear the screen and, if possible, the terminal&rsquo;s scrollback buffer,
1526 then redraw the current line,
1527 leaving the current line at the top of the screen.
1528 </p>
1529 </dd>
1530 <dt><a id="index-clear_002dscreen-_0028C_002dl_0029"></a><span><code class="code">clear-screen (C-l)</code><a class="copiable-link" href="#index-clear_002dscreen-_0028C_002dl_0029"> &para;</a></span></dt>
1531 <dd><p>Clear the screen,
1532 then redraw the current line,
1533 leaving the current line at the top of the screen.
1534 If given a numeric argument, this refreshes the current line
1535 without clearing the screen.
1536 </p>
1537 </dd>
1538 <dt><a id="index-redraw_002dcurrent_002dline-_0028_0029"></a><span><code class="code">redraw-current-line ()</code><a class="copiable-link" href="#index-redraw_002dcurrent_002dline-_0028_0029"> &para;</a></span></dt>
1539 <dd><p>Refresh the current line. By default, this is unbound.
1540 </p>
1541 </dd>
1542 </dl>
1543
1544 <hr>
1545 </div>
1546 <div class="subsection-level-extent" id="Commands-For-History">
1547 <div class="nav-panel">
1548 <p>
1549 Next: <a href="#Commands-For-Text" accesskey="n" rel="next">Commands For Changing Text</a>, Previous: <a href="#Commands-For-Moving" accesskey="p" rel="prev">Commands For Moving</a>, Up: <a href="#Bindable-Readline-Commands" accesskey="u" rel="up">Bindable Readline Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1550 </div>
1551 <h4 class="subsection" id="Commands-For-Manipulating-The-History"><span>1.4.2 Commands For Manipulating The History<a class="copiable-link" href="#Commands-For-Manipulating-The-History"> &para;</a></span></h4>
1552
1553 <dl class="ftable">
1554 <dt><a id="index-accept_002dline-_0028Newline-or-Return_0029"></a><span><code class="code">accept-line (Newline or Return)</code><a class="copiable-link" href="#index-accept_002dline-_0028Newline-or-Return_0029"> &para;</a></span></dt>
1555 <dd><p>Accept the line regardless of where the cursor is.
1556 If this line is non-empty, you can add it to the history list using
1557 <code class="code">add_history()</code>.
1558 If this line is a modified history line, then restore the history line
1559 to its original state.
1560 </p>
1561 </dd>
1562 <dt><a id="index-previous_002dhistory-_0028C_002dp_0029"></a><span><code class="code">previous-history (C-p)</code><a class="copiable-link" href="#index-previous_002dhistory-_0028C_002dp_0029"> &para;</a></span></dt>
1563 <dd><p>Move &lsquo;back&rsquo; through the history list, fetching the previous command.
1564 This may also be bound to the up arrow key on some keyboards.
1565 </p>
1566 </dd>
1567 <dt><a id="index-next_002dhistory-_0028C_002dn_0029"></a><span><code class="code">next-history (C-n)</code><a class="copiable-link" href="#index-next_002dhistory-_0028C_002dn_0029"> &para;</a></span></dt>
1568 <dd><p>Move &lsquo;forward&rsquo; through the history list, fetching the next command.
1569 This may also be bound to the down arrow key on some keyboards.
1570 </p>
1571 </dd>
1572 <dt><a id="index-beginning_002dof_002dhistory-_0028M_002d_003c_0029"></a><span><code class="code">beginning-of-history (M-&lt;)</code><a class="copiable-link" href="#index-beginning_002dof_002dhistory-_0028M_002d_003c_0029"> &para;</a></span></dt>
1573 <dd><p>Move to the first line in the history.
1574 </p>
1575 </dd>
1576 <dt><a id="index-end_002dof_002dhistory-_0028M_002d_003e_0029"></a><span><code class="code">end-of-history (M-&gt;)</code><a class="copiable-link" href="#index-end_002dof_002dhistory-_0028M_002d_003e_0029"> &para;</a></span></dt>
1577 <dd><p>Move to the end of the input history, i.e., the line currently
1578 being entered.
1579 </p>
1580 </dd>
1581 <dt><a id="index-reverse_002dsearch_002dhistory-_0028C_002dr_0029"></a><span><code class="code">reverse-search-history (C-r)</code><a class="copiable-link" href="#index-reverse_002dsearch_002dhistory-_0028C_002dr_0029"> &para;</a></span></dt>
1582 <dd><p>Search backward starting at the current line and moving &lsquo;up&rsquo; through
1583 the history as necessary.
1584 This is an incremental search.
1585 This command sets the region to the matched text and activates the region.
1586 </p>
1587 </dd>
1588 <dt><a id="index-forward_002dsearch_002dhistory-_0028C_002ds_0029"></a><span><code class="code">forward-search-history (C-s)</code><a class="copiable-link" href="#index-forward_002dsearch_002dhistory-_0028C_002ds_0029"> &para;</a></span></dt>
1589 <dd><p>Search forward starting at the current line and moving &lsquo;down&rsquo; through
1590 the history as necessary.
1591 This is an incremental search.
1592 This command sets the region to the matched text and activates the region.
1593 </p>
1594 </dd>
1595 <dt><a id="index-non_002dincremental_002dreverse_002dsearch_002dhistory-_0028M_002dp_0029"></a><span><code class="code">non-incremental-reverse-search-history (M-p)</code><a class="copiable-link" href="#index-non_002dincremental_002dreverse_002dsearch_002dhistory-_0028M_002dp_0029"> &para;</a></span></dt>
1596 <dd><p>Search backward starting at the current line and moving &lsquo;up&rsquo;
1597 through the history as necessary using a non-incremental search
1598 for a string supplied by the user.
1599 The search string may match anywhere in a history line.
1600 </p>
1601 </dd>
1602 <dt><a id="index-non_002dincremental_002dforward_002dsearch_002dhistory-_0028M_002dn_0029"></a><span><code class="code">non-incremental-forward-search-history (M-n)</code><a class="copiable-link" href="#index-non_002dincremental_002dforward_002dsearch_002dhistory-_0028M_002dn_0029"> &para;</a></span></dt>
1603 <dd><p>Search forward starting at the current line and moving &lsquo;down&rsquo;
1604 through the history as necessary using a non-incremental search
1605 for a string supplied by the user.
1606 The search string may match anywhere in a history line.
1607 </p>
1608 </dd>
1609 <dt><a id="index-history_002dsearch_002dbackward-_0028_0029"></a><span><code class="code">history-search-backward ()</code><a class="copiable-link" href="#index-history_002dsearch_002dbackward-_0028_0029"> &para;</a></span></dt>
1610 <dd><p>Search backward through the history for the string of characters
1611 between the start of the current line and the point.
1612 The search string must match at the beginning of a history line.
1613 This is a non-incremental search.
1614 By default, this command is unbound, but may be bound to the Page Down
1615 key on some keyboards.
1616 </p>
1617 </dd>
1618 <dt><a id="index-history_002dsearch_002dforward-_0028_0029"></a><span><code class="code">history-search-forward ()</code><a class="copiable-link" href="#index-history_002dsearch_002dforward-_0028_0029"> &para;</a></span></dt>
1619 <dd><p>Search forward through the history for the string of characters
1620 between the start of the current line and the point.
1621 The search string must match at the beginning of a history line.
1622 This is a non-incremental search.
1623 By default, this command is unbound, but may be bound to the Page Up
1624 key on some keyboards.
1625 </p>
1626 </dd>
1627 <dt><a id="index-history_002dsubstring_002dsearch_002dbackward-_0028_0029"></a><span><code class="code">history-substring-search-backward ()</code><a class="copiable-link" href="#index-history_002dsubstring_002dsearch_002dbackward-_0028_0029"> &para;</a></span></dt>
1628 <dd><p>Search backward through the history for the string of characters
1629 between the start of the current line and the point.
1630 The search string may match anywhere in a history line.
1631 This is a non-incremental search.
1632 By default, this command is unbound.
1633 </p>
1634 </dd>
1635 <dt><a id="index-history_002dsubstring_002dsearch_002dforward-_0028_0029"></a><span><code class="code">history-substring-search-forward ()</code><a class="copiable-link" href="#index-history_002dsubstring_002dsearch_002dforward-_0028_0029"> &para;</a></span></dt>
1636 <dd><p>Search forward through the history for the string of characters
1637 between the start of the current line and the point.
1638 The search string may match anywhere in a history line.
1639 This is a non-incremental search.
1640 By default, this command is unbound.
1641 </p>
1642 </dd>
1643 <dt><a id="index-yank_002dnth_002darg-_0028M_002dC_002dy_0029"></a><span><code class="code">yank-nth-arg (M-C-y)</code><a class="copiable-link" href="#index-yank_002dnth_002darg-_0028M_002dC_002dy_0029"> &para;</a></span></dt>
1644 <dd><p>Insert the first argument to the previous command (usually
1645 the second word on the previous line) at point.
1646 With an argument <var class="var">n</var>,
1647 insert the <var class="var">n</var>th word from the previous command (the words
1648 in the previous command begin with word 0).
1649 A negative argument inserts the <var class="var">n</var>th word from the end of
1650 the previous command.
1651 Once the argument <var class="var">n</var> is computed,
1652 this uses the history expansion facilities to extract the
1653 <var class="var">n</var>th word, as if the
1654 &lsquo;<samp class="samp">!<var class="var">n</var></samp>&rsquo; history expansion had been specified.
1655 </p>
1656 </dd>
1657 <dt><a id="index-yank_002dlast_002darg-_0028M_002d_002e-or-M_002d_005f_0029"></a><span><code class="code">yank-last-arg (M-. or M-_)</code><a class="copiable-link" href="#index-yank_002dlast_002darg-_0028M_002d_002e-or-M_002d_005f_0029"> &para;</a></span></dt>
1658 <dd><p>Insert last argument to the previous command (the last word of the
1659 previous history entry).
1660 With a numeric argument, behave exactly like <code class="code">yank-nth-arg</code>.
1661 Successive calls to <code class="code">yank-last-arg</code> move back through the history
1662 list, inserting the last word (or the word specified by the argument to
1663 the first call) of each line in turn.
1664 Any numeric argument supplied to these successive calls determines
1665 the direction to move through the history.
1666 A negative argument switches the direction through the history
1667 (back or forward).
1668 This uses the history expansion facilities to extract the
1669 last word, as if the
1670 &lsquo;<samp class="samp">!$</samp>&rsquo; history expansion had been specified.
1671 </p>
1672 </dd>
1673 <dt><a id="index-operate_002dand_002dget_002dnext-_0028C_002do_0029"></a><span><code class="code">operate-and-get-next (C-o)</code><a class="copiable-link" href="#index-operate_002dand_002dget_002dnext-_0028C_002do_0029"> &para;</a></span></dt>
1674 <dd><p>Accept the current line for return to the calling application as if a
1675 newline had been entered,
1676 and fetch the next line relative to the current line from the history
1677 for editing.
1678 A numeric argument, if supplied, specifies the history entry
1679 to use instead of the current line.
1680 </p>
1681 </dd>
1682 <dt><a id="index-fetch_002dhistory-_0028_0029"></a><span><code class="code">fetch-history ()</code><a class="copiable-link" href="#index-fetch_002dhistory-_0028_0029"> &para;</a></span></dt>
1683 <dd><p>With a numeric argument, fetch that entry from the history list
1684 and make it the current line.
1685 Without an argument, move back to the first entry in the history list.
1686 </p>
1687 </dd>
1688 </dl>
1689
1690 <hr>
1691 </div>
1692 <div class="subsection-level-extent" id="Commands-For-Text">
1693 <div class="nav-panel">
1694 <p>
1695 Next: <a href="#Commands-For-Killing" accesskey="n" rel="next">Killing And Yanking</a>, Previous: <a href="#Commands-For-History" accesskey="p" rel="prev">Commands For Manipulating The History</a>, Up: <a href="#Bindable-Readline-Commands" accesskey="u" rel="up">Bindable Readline Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1696 </div>
1697 <h4 class="subsection" id="Commands-For-Changing-Text"><span>1.4.3 Commands For Changing Text<a class="copiable-link" href="#Commands-For-Changing-Text"> &para;</a></span></h4>
1698
1699 <dl class="ftable">
1700 <dt><a id="index-end_002dof_002dfile-_0028usually-C_002dd_0029"></a><span><code class="code"><i class="i">end-of-file</i> (usually C-d)</code><a class="copiable-link" href="#index-end_002dof_002dfile-_0028usually-C_002dd_0029"> &para;</a></span></dt>
1701 <dd><p>The character indicating end-of-file as set, for example, by
1702 <code class="code">stty</code>.
1703 If this character is read when there are no characters
1704 on the line, and point is at the beginning of the line, Readline
1705 interprets it as the end of input and returns <small class="sc">EOF</small>.
1706 </p>
1707 </dd>
1708 <dt><a id="index-delete_002dchar-_0028C_002dd_0029"></a><span><code class="code">delete-char (C-d)</code><a class="copiable-link" href="#index-delete_002dchar-_0028C_002dd_0029"> &para;</a></span></dt>
1709 <dd><p>Delete the character at point.
1710 If this function is bound to the
1711 same character as the tty <small class="sc">EOF</small> character, as <kbd class="kbd">C-d</kbd>
1712 commonly is, see above for the effects.
1713 This may also be bound to the Delete key on some keyboards.
1714 </p>
1715 </dd>
1716 <dt><a id="index-backward_002ddelete_002dchar-_0028Rubout_0029"></a><span><code class="code">backward-delete-char (Rubout)</code><a class="copiable-link" href="#index-backward_002ddelete_002dchar-_0028Rubout_0029"> &para;</a></span></dt>
1717 <dd><p>Delete the character behind the cursor.
1718 A numeric argument means
1719 to kill the characters, saving them on the kill ring,
1720 instead of deleting them.
1721 </p>
1722 </dd>
1723 <dt><a id="index-forward_002dbackward_002ddelete_002dchar-_0028_0029"></a><span><code class="code">forward-backward-delete-char ()</code><a class="copiable-link" href="#index-forward_002dbackward_002ddelete_002dchar-_0028_0029"> &para;</a></span></dt>
1724 <dd><p>Delete the character under the cursor, unless the cursor is at the
1725 end of the line, in which case the character behind the cursor is
1726 deleted.
1727 By default, this is not bound to a key.
1728 </p>
1729 </dd>
1730 <dt><a id="index-quoted_002dinsert-_0028C_002dq-or-C_002dv_0029"></a><span><code class="code">quoted-insert (C-q or C-v)</code><a class="copiable-link" href="#index-quoted_002dinsert-_0028C_002dq-or-C_002dv_0029"> &para;</a></span></dt>
1731 <dd><p>Add the next character typed to the line verbatim.
1732 This is how to insert key sequences like <kbd class="kbd">C-q</kbd>, for example.
1733 </p>
1734 </dd>
1735 <dt><a id="index-tab_002dinsert-_0028M_002dTAB_0029"></a><span><code class="code">tab-insert (M-<kbd class="key">TAB</kbd>)</code><a class="copiable-link" href="#index-tab_002dinsert-_0028M_002dTAB_0029"> &para;</a></span></dt>
1736 <dd><p>Insert a tab character.
1737 </p>
1738 </dd>
1739 <dt><a id="index-self_002dinsert-_0028a_002c-b_002c-A_002c-1_002c-_0021_002c-_2026_0029"></a><span><code class="code">self-insert (a, b, A, 1, !, &hellip;)</code><a class="copiable-link" href="#index-self_002dinsert-_0028a_002c-b_002c-A_002c-1_002c-_0021_002c-_2026_0029"> &para;</a></span></dt>
1740 <dd><p>Insert the character typed.
1741 </p>
1742 </dd>
1743 <dt><a id="index-bracketed_002dpaste_002dbegin-_0028_0029"></a><span><code class="code">bracketed-paste-begin ()</code><a class="copiable-link" href="#index-bracketed_002dpaste_002dbegin-_0028_0029"> &para;</a></span></dt>
1744 <dd><p>This function is intended to be bound to the &quot;bracketed paste&quot; escape
1745 sequence sent by some terminals, and such a binding is assigned by default.
1746 It allows Readline to insert the pasted text as a single unit without treating
1747 each character as if it had been read from the keyboard.
1748 The characters
1749 are inserted as if each one was bound to <code class="code">self-insert</code> instead of
1750 executing any editing commands.
1751 </p>
1752 <p>Bracketed paste sets the region (the characters between point and the mark)
1753 to the inserted text.
1754 It sets the <em class="emph">active region</em>.
1755 </p>
1756 </dd>
1757 <dt><a id="index-transpose_002dchars-_0028C_002dt_0029"></a><span><code class="code">transpose-chars (C-t)</code><a class="copiable-link" href="#index-transpose_002dchars-_0028C_002dt_0029"> &para;</a></span></dt>
1758 <dd><p>Drag the character before the cursor forward over
1759 the character at the cursor, moving the
1760 cursor forward as well.
1761 If the insertion point
1762 is at the end of the line, then this
1763 transposes the last two characters of the line.
1764 Negative arguments have no effect.
1765 </p>
1766 </dd>
1767 <dt><a id="index-transpose_002dwords-_0028M_002dt_0029"></a><span><code class="code">transpose-words (M-t)</code><a class="copiable-link" href="#index-transpose_002dwords-_0028M_002dt_0029"> &para;</a></span></dt>
1768 <dd><p>Drag the word before point past the word after point,
1769 moving point past that word as well.
1770 If the insertion point is at the end of the line, this transposes
1771 the last two words on the line.
1772 </p>
1773
1774 </dd>
1775 <dt><a id="index-upcase_002dword-_0028M_002du_0029"></a><span><code class="code">upcase-word (M-u)</code><a class="copiable-link" href="#index-upcase_002dword-_0028M_002du_0029"> &para;</a></span></dt>
1776 <dd><p>Uppercase the current (or following) word.
1777 With a negative argument,
1778 uppercase the previous word, but do not move the cursor.
1779 </p>
1780 </dd>
1781 <dt><a id="index-downcase_002dword-_0028M_002dl_0029"></a><span><code class="code">downcase-word (M-l)</code><a class="copiable-link" href="#index-downcase_002dword-_0028M_002dl_0029"> &para;</a></span></dt>
1782 <dd><p>Lowercase the current (or following) word.
1783 With a negative argument,
1784 lowercase the previous word, but do not move the cursor.
1785 </p>
1786 </dd>
1787 <dt><a id="index-capitalize_002dword-_0028M_002dc_0029"></a><span><code class="code">capitalize-word (M-c)</code><a class="copiable-link" href="#index-capitalize_002dword-_0028M_002dc_0029"> &para;</a></span></dt>
1788 <dd><p>Capitalize the current (or following) word.
1789 With a negative argument,
1790 capitalize the previous word, but do not move the cursor.
1791 </p>
1792 </dd>
1793 <dt><a id="index-overwrite_002dmode-_0028_0029"></a><span><code class="code">overwrite-mode ()</code><a class="copiable-link" href="#index-overwrite_002dmode-_0028_0029"> &para;</a></span></dt>
1794 <dd><p>Toggle overwrite mode.
1795 With an explicit positive numeric argument, switches to overwrite mode.
1796 With an explicit non-positive numeric argument, switches to insert mode.
1797 This command affects only <code class="code">emacs</code> mode;
1798 <code class="code">vi</code> mode does overwrite differently.
1799 Each call to <code class="code">readline()</code> starts in insert mode.
1800 </p>
1801 <p>In overwrite mode, characters bound to <code class="code">self-insert</code> replace
1802 the text at point rather than pushing the text to the right.
1803 Characters bound to <code class="code">backward-delete-char</code> replace the character
1804 before point with a space.
1805 </p>
1806 <p>By default, this command is unbound, but may be bound to the Insert
1807 key on some keyboards.
1808 </p>
1809 </dd>
1810 </dl>
1811
1812 <hr>
1813 </div>
1814 <div class="subsection-level-extent" id="Commands-For-Killing">
1815 <div class="nav-panel">
1816 <p>
1817 Next: <a href="#Numeric-Arguments" accesskey="n" rel="next">Specifying Numeric Arguments</a>, Previous: <a href="#Commands-For-Text" accesskey="p" rel="prev">Commands For Changing Text</a>, Up: <a href="#Bindable-Readline-Commands" accesskey="u" rel="up">Bindable Readline Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1818 </div>
1819 <h4 class="subsection" id="Killing-And-Yanking"><span>1.4.4 Killing And Yanking<a class="copiable-link" href="#Killing-And-Yanking"> &para;</a></span></h4>
1820
1821 <dl class="ftable">
1822 <dt><a id="index-kill_002dline-_0028C_002dk_0029"></a><span><code class="code">kill-line (C-k)</code><a class="copiable-link" href="#index-kill_002dline-_0028C_002dk_0029"> &para;</a></span></dt>
1823 <dd><p>Kill the text from point to the end of the current line.
1824 With a negative numeric argument, kill backward from the cursor to the
1825 beginning of the line.
1826 </p>
1827 </dd>
1828 <dt><a id="index-backward_002dkill_002dline-_0028C_002dx-Rubout_0029"></a><span><code class="code">backward-kill-line (C-x Rubout)</code><a class="copiable-link" href="#index-backward_002dkill_002dline-_0028C_002dx-Rubout_0029"> &para;</a></span></dt>
1829 <dd><p>Kill backward from the cursor to the beginning of the current line.
1830 With a negative numeric argument, kill forward from the cursor to the
1831 end of the line.
1832 </p>
1833 </dd>
1834 <dt><a id="index-unix_002dline_002ddiscard-_0028C_002du_0029"></a><span><code class="code">unix-line-discard (C-u)</code><a class="copiable-link" href="#index-unix_002dline_002ddiscard-_0028C_002du_0029"> &para;</a></span></dt>
1835 <dd><p>Kill backward from the cursor to the beginning of the current line.
1836 </p>
1837 </dd>
1838 <dt><a id="index-kill_002dwhole_002dline-_0028_0029"></a><span><code class="code">kill-whole-line ()</code><a class="copiable-link" href="#index-kill_002dwhole_002dline-_0028_0029"> &para;</a></span></dt>
1839 <dd><p>Kill all characters on the current line, no matter where point is.
1840 By default, this is unbound.
1841 </p>
1842 </dd>
1843 <dt><a id="index-kill_002dword-_0028M_002dd_0029"></a><span><code class="code">kill-word (M-d)</code><a class="copiable-link" href="#index-kill_002dword-_0028M_002dd_0029"> &para;</a></span></dt>
1844 <dd><p>Kill from point to the end of the current word, or if between
1845 words, to the end of the next word.
1846 Word boundaries are the same as <code class="code">forward-word</code>.
1847 </p>
1848 </dd>
1849 <dt><a id="index-backward_002dkill_002dword-_0028M_002dDEL_0029"></a><span><code class="code">backward-kill-word (M-<kbd class="key">DEL</kbd>)</code><a class="copiable-link" href="#index-backward_002dkill_002dword-_0028M_002dDEL_0029"> &para;</a></span></dt>
1850 <dd><p>Kill the word behind point.
1851 Word boundaries are the same as <code class="code">backward-word</code>.
1852 </p>
1853
1854 </dd>
1855 <dt><a id="index-unix_002dword_002drubout-_0028C_002dw_0029"></a><span><code class="code">unix-word-rubout (C-w)</code><a class="copiable-link" href="#index-unix_002dword_002drubout-_0028C_002dw_0029"> &para;</a></span></dt>
1856 <dd><p>Kill the word behind point, using white space as a word boundary,
1857 saving the killed text on the kill-ring.
1858 </p>
1859 </dd>
1860 <dt><a id="index-unix_002dfilename_002drubout-_0028_0029"></a><span><code class="code">unix-filename-rubout ()</code><a class="copiable-link" href="#index-unix_002dfilename_002drubout-_0028_0029"> &para;</a></span></dt>
1861 <dd><p>Kill the word behind point, using white space and the slash character
1862 as the word boundaries,
1863 saving the killed text on the kill-ring.
1864 </p>
1865 </dd>
1866 <dt><a id="index-delete_002dhorizontal_002dspace-_0028_0029"></a><span><code class="code">delete-horizontal-space ()</code><a class="copiable-link" href="#index-delete_002dhorizontal_002dspace-_0028_0029"> &para;</a></span></dt>
1867 <dd><p>Delete all spaces and tabs around point.
1868 By default, this is unbound.
1869 </p>
1870 </dd>
1871 <dt><a id="index-kill_002dregion-_0028_0029"></a><span><code class="code">kill-region ()</code><a class="copiable-link" href="#index-kill_002dregion-_0028_0029"> &para;</a></span></dt>
1872 <dd><p>Kill the text in the current region.
1873 By default, this command is unbound.
1874 </p>
1875 </dd>
1876 <dt><a id="index-copy_002dregion_002das_002dkill-_0028_0029"></a><span><code class="code">copy-region-as-kill ()</code><a class="copiable-link" href="#index-copy_002dregion_002das_002dkill-_0028_0029"> &para;</a></span></dt>
1877 <dd><p>Copy the text in the region to the kill buffer, so it can be yanked
1878 right away.
1879 By default, this command is unbound.
1880 </p>
1881 </dd>
1882 <dt><a id="index-copy_002dbackward_002dword-_0028_0029"></a><span><code class="code">copy-backward-word ()</code><a class="copiable-link" href="#index-copy_002dbackward_002dword-_0028_0029"> &para;</a></span></dt>
1883 <dd><p>Copy the word before point to the kill buffer.
1884 The word boundaries are the same as <code class="code">backward-word</code>.
1885 By default, this command is unbound.
1886 </p>
1887 </dd>
1888 <dt><a id="index-copy_002dforward_002dword-_0028_0029"></a><span><code class="code">copy-forward-word ()</code><a class="copiable-link" href="#index-copy_002dforward_002dword-_0028_0029"> &para;</a></span></dt>
1889 <dd><p>Copy the word following point to the kill buffer.
1890 The word boundaries are the same as <code class="code">forward-word</code>.
1891 By default, this command is unbound.
1892 </p>
1893 </dd>
1894 <dt><a id="index-yank-_0028C_002dy_0029"></a><span><code class="code">yank (C-y)</code><a class="copiable-link" href="#index-yank-_0028C_002dy_0029"> &para;</a></span></dt>
1895 <dd><p>Yank the top of the kill ring into the buffer at point.
1896 </p>
1897 </dd>
1898 <dt><a id="index-yank_002dpop-_0028M_002dy_0029"></a><span><code class="code">yank-pop (M-y)</code><a class="copiable-link" href="#index-yank_002dpop-_0028M_002dy_0029"> &para;</a></span></dt>
1899 <dd><p>Rotate the kill-ring, and yank the new top.
1900 You can only do this if
1901 the prior command is <code class="code">yank</code> or <code class="code">yank-pop</code>.
1902 </p></dd>
1903 </dl>
1904
1905 <hr>
1906 </div>
1907 <div class="subsection-level-extent" id="Numeric-Arguments">
1908 <div class="nav-panel">
1909 <p>
1910 Next: <a href="#Commands-For-Completion" accesskey="n" rel="next">Letting Readline Type For You</a>, Previous: <a href="#Commands-For-Killing" accesskey="p" rel="prev">Killing And Yanking</a>, Up: <a href="#Bindable-Readline-Commands" accesskey="u" rel="up">Bindable Readline Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1911 </div>
1912 <h4 class="subsection" id="Specifying-Numeric-Arguments"><span>1.4.5 Specifying Numeric Arguments<a class="copiable-link" href="#Specifying-Numeric-Arguments"> &para;</a></span></h4>
1913 <dl class="ftable">
1914 <dt><a id="index-digit_002dargument-_0028M_002d0_002c-M_002d1_002c-_2026-M_002d_002d_0029"></a><span><code class="code">digit-argument (<kbd class="kbd">M-0</kbd>, <kbd class="kbd">M-1</kbd>, &hellip; <kbd class="kbd">M--</kbd>)</code><a class="copiable-link" href="#index-digit_002dargument-_0028M_002d0_002c-M_002d1_002c-_2026-M_002d_002d_0029"> &para;</a></span></dt>
1915 <dd><p>Add this digit to the argument already accumulating, or start a new
1916 argument.
1917 <kbd class="kbd">M--</kbd> starts a negative argument.
1918 </p>
1919 </dd>
1920 <dt><a id="index-universal_002dargument-_0028_0029"></a><span><code class="code">universal-argument ()</code><a class="copiable-link" href="#index-universal_002dargument-_0028_0029"> &para;</a></span></dt>
1921 <dd><p>This is another way to specify an argument.
1922 If this command is followed by one or more digits, optionally with a
1923 leading minus sign, those digits define the argument.
1924 If the command is followed by digits, executing <code class="code">universal-argument</code>
1925 again ends the numeric argument, but is otherwise ignored.
1926 As a special case, if this command is immediately followed by a
1927 character that is neither a digit nor minus sign, the argument count
1928 for the next command is multiplied by four.
1929 The argument count is initially one, so executing this function the
1930 first time makes the argument count four, a second time makes the
1931 argument count sixteen, and so on.
1932 By default, this is not bound to a key.
1933 </p></dd>
1934 </dl>
1935
1936 <hr>
1937 </div>
1938 <div class="subsection-level-extent" id="Commands-For-Completion">
1939 <div class="nav-panel">
1940 <p>
1941 Next: <a href="#Keyboard-Macros" accesskey="n" rel="next">Keyboard Macros</a>, Previous: <a href="#Numeric-Arguments" accesskey="p" rel="prev">Specifying Numeric Arguments</a>, Up: <a href="#Bindable-Readline-Commands" accesskey="u" rel="up">Bindable Readline Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1942 </div>
1943 <h4 class="subsection" id="Letting-Readline-Type-For-You"><span>1.4.6 Letting Readline Type For You<a class="copiable-link" href="#Letting-Readline-Type-For-You"> &para;</a></span></h4>
1944
1945 <dl class="ftable">
1946 <dt><a id="index-complete-_0028TAB_0029"></a><span><code class="code">complete (<kbd class="key">TAB</kbd>)</code><a class="copiable-link" href="#index-complete-_0028TAB_0029"> &para;</a></span></dt>
1947 <dd><p>Attempt to perform completion on the text before point.
1948 The actual completion performed is application-specific.
1949 The default is filename completion.
1950 </p>
1951 </dd>
1952 <dt><a id="index-possible_002dcompletions-_0028M_002d_003f_0029"></a><span><code class="code">possible-completions (M-?)</code><a class="copiable-link" href="#index-possible_002dcompletions-_0028M_002d_003f_0029"> &para;</a></span></dt>
1953 <dd><p>List the possible completions of the text before point.
1954 When displaying completions, Readline sets the number of columns used
1955 for display to the value of <code class="code">completion-display-width</code>, the value of
1956 the environment variable <code class="env">COLUMNS</code>, or the screen width, in that order.
1957 </p>
1958 </dd>
1959 <dt><a id="index-insert_002dcompletions-_0028M_002d_002a_0029"></a><span><code class="code">insert-completions (M-*)</code><a class="copiable-link" href="#index-insert_002dcompletions-_0028M_002d_002a_0029"> &para;</a></span></dt>
1960 <dd><p>Insert all completions of the text before point that would have
1961 been generated by <code class="code">possible-completions</code>,
1962 separated by a space.
1963 </p>
1964 </dd>
1965 <dt><a id="index-menu_002dcomplete-_0028_0029"></a><span><code class="code">menu-complete ()</code><a class="copiable-link" href="#index-menu_002dcomplete-_0028_0029"> &para;</a></span></dt>
1966 <dd><p>Similar to <code class="code">complete</code>, but replaces the word to be completed
1967 with a single match from the list of possible completions.
1968 Repeatedly executing <code class="code">menu-complete</code> steps through the list
1969 of possible completions, inserting each match in turn.
1970 At the end of the list of completions,
1971 <code class="code">menu-complete</code> rings the bell
1972 (subject to the setting of <code class="code">bell-style</code>)
1973 and restores the original text.
1974 An argument of <var class="var">n</var> moves <var class="var">n</var> positions forward in the list
1975 of matches; a negative argument moves backward through the list.
1976 This command is intended to be bound to <kbd class="key">TAB</kbd>, but is unbound
1977 by default.
1978 </p>
1979 </dd>
1980 <dt><a id="index-menu_002dcomplete_002dbackward-_0028_0029"></a><span><code class="code">menu-complete-backward ()</code><a class="copiable-link" href="#index-menu_002dcomplete_002dbackward-_0028_0029"> &para;</a></span></dt>
1981 <dd><p>Identical to <code class="code">menu-complete</code>, but moves backward through the list
1982 of possible completions, as if <code class="code">menu-complete</code> had been given a
1983 negative argument.
1984 This command is unbound by default.
1985 </p>
1986 </dd>
1987 <dt><a id="index-export_002dcompletions-_0028_0029"></a><span><code class="code">export-completions ()</code><a class="copiable-link" href="#index-export_002dcompletions-_0028_0029"> &para;</a></span></dt>
1988 <dd><p>Perform completion on the word before point as described above
1989 and write the list of possible completions to Readline&rsquo;s output stream
1990 using the following format, writing information on separate lines:
1991 </p>
1992 <ul class="itemize mark-bullet">
1993 <li>the number of matches <var class="var">N</var>;
1994 </li><li>the word being completed;
1995 </li><li><var class="var">S</var>:<var class="var">E</var>,
1996 where <var class="var">S</var> and <var class="var">E</var> are the start and end offsets of the word
1997 in the Readline line buffer; then
1998 </li><li>each match, one per line
1999 </li></ul>
2000
2001 <p>If there are no matches, the first line will be &ldquo;0&rdquo;,
2002 and this command does not print any output after the <var class="var">S</var>:<var class="var">E</var>.
2003 If there is only a single match, this prints a single line containing it.
2004 If there is more than one match, this prints the common prefix of the
2005 matches, which may be empty, on the first line after the <var class="var">S</var>:<var class="var">E</var>,
2006 then the matches on subsequent lines.
2007 In this case, <var class="var">N</var> will include the first line with the common prefix.
2008 </p>
2009 <p>The user or application
2010 should be able to accommodate the possibility of a blank line.
2011 The intent is that the user or application reads <var class="var">N</var> lines after
2012 the line containing <var class="var">S</var>:<var class="var">E</var> to obtain the match list.
2013 This command is unbound by default.
2014 </p>
2015 </dd>
2016 <dt><a id="index-delete_002dchar_002dor_002dlist-_0028_0029"></a><span><code class="code">delete-char-or-list ()</code><a class="copiable-link" href="#index-delete_002dchar_002dor_002dlist-_0028_0029"> &para;</a></span></dt>
2017 <dd><p>Deletes the character under the cursor if not at the beginning or
2018 end of the line (like <code class="code">delete-char</code>).
2019 At the end of the line, it behaves identically to <code class="code">possible-completions</code>.
2020 This command is unbound by default.
2021 </p>
2022 </dd>
2023 </dl>
2024
2025 <hr>
2026 </div>
2027 <div class="subsection-level-extent" id="Keyboard-Macros">
2028 <div class="nav-panel">
2029 <p>
2030 Next: <a href="#Miscellaneous-Commands" accesskey="n" rel="next">Some Miscellaneous Commands</a>, Previous: <a href="#Commands-For-Completion" accesskey="p" rel="prev">Letting Readline Type For You</a>, Up: <a href="#Bindable-Readline-Commands" accesskey="u" rel="up">Bindable Readline Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
2031 </div>
2032 <h4 class="subsection" id="Keyboard-Macros-1"><span>1.4.7 Keyboard Macros<a class="copiable-link" href="#Keyboard-Macros-1"> &para;</a></span></h4>
2033 <dl class="ftable">
2034 <dt><a id="index-start_002dkbd_002dmacro-_0028C_002dx-_0028_0029"></a><span><code class="code">start-kbd-macro (C-x ()</code><a class="copiable-link" href="#index-start_002dkbd_002dmacro-_0028C_002dx-_0028_0029"> &para;</a></span></dt>
2035 <dd><p>Begin saving the characters typed into the current keyboard macro.
2036 </p>
2037 </dd>
2038 <dt><a id="index-end_002dkbd_002dmacro-_0028C_002dx-_0029_0029"></a><span><code class="code">end-kbd-macro (C-x ))</code><a class="copiable-link" href="#index-end_002dkbd_002dmacro-_0028C_002dx-_0029_0029"> &para;</a></span></dt>
2039 <dd><p>Stop saving the characters typed into the current keyboard macro
2040 and save the definition.
2041 </p>
2042 </dd>
2043 <dt><a id="index-call_002dlast_002dkbd_002dmacro-_0028C_002dx-e_0029"></a><span><code class="code">call-last-kbd-macro (C-x e)</code><a class="copiable-link" href="#index-call_002dlast_002dkbd_002dmacro-_0028C_002dx-e_0029"> &para;</a></span></dt>
2044 <dd><p>Re-execute the last keyboard macro defined, by making the characters
2045 in the macro appear as if typed at the keyboard.
2046 </p>
2047 </dd>
2048 <dt><a id="index-print_002dlast_002dkbd_002dmacro-_0028_0029"></a><span><code class="code">print-last-kbd-macro ()</code><a class="copiable-link" href="#index-print_002dlast_002dkbd_002dmacro-_0028_0029"> &para;</a></span></dt>
2049 <dd><p>Print the last keyboard macro defined in a format suitable for the
2050 <var class="var">inputrc</var> file.
2051 </p>
2052 </dd>
2053 </dl>
2054
2055 <hr>
2056 </div>
2057 <div class="subsection-level-extent" id="Miscellaneous-Commands">
2058 <div class="nav-panel">
2059 <p>
2060 Previous: <a href="#Keyboard-Macros" accesskey="p" rel="prev">Keyboard Macros</a>, Up: <a href="#Bindable-Readline-Commands" accesskey="u" rel="up">Bindable Readline Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
2061 </div>
2062 <h4 class="subsection" id="Some-Miscellaneous-Commands"><span>1.4.8 Some Miscellaneous Commands<a class="copiable-link" href="#Some-Miscellaneous-Commands"> &para;</a></span></h4>
2063 <dl class="ftable">
2064 <dt><a id="index-re_002dread_002dinit_002dfile-_0028C_002dx-C_002dr_0029"></a><span><code class="code">re-read-init-file (C-x C-r)</code><a class="copiable-link" href="#index-re_002dread_002dinit_002dfile-_0028C_002dx-C_002dr_0029"> &para;</a></span></dt>
2065 <dd><p>Read in the contents of the <var class="var">inputrc</var> file, and incorporate
2066 any bindings or variable assignments found there.
2067 </p>
2068 </dd>
2069 <dt><a id="index-abort-_0028C_002dg_0029"></a><span><code class="code">abort (C-g)</code><a class="copiable-link" href="#index-abort-_0028C_002dg_0029"> &para;</a></span></dt>
2070 <dd><p>Abort the current editing command and
2071 ring the terminal&rsquo;s bell (subject to the setting of
2072 <code class="code">bell-style</code>).
2073 </p>
2074 </dd>
2075 <dt><a id="index-do_002dlowercase_002dversion-_0028M_002dA_002c-M_002dB_002c-M_002dx_002c-_2026_0029"></a><span><code class="code">do-lowercase-version (M-A, M-B, M-<var class="var">x</var>, &hellip;)</code><a class="copiable-link" href="#index-do_002dlowercase_002dversion-_0028M_002dA_002c-M_002dB_002c-M_002dx_002c-_2026_0029"> &para;</a></span></dt>
2076 <dd><p>If the metafied character <var class="var">x</var> is upper case, run the command
2077 that is bound to the corresponding metafied lower case character.
2078 The behavior is undefined if <var class="var">x</var> is already lower case.
2079 </p>
2080 </dd>
2081 <dt><a id="index-prefix_002dmeta-_0028ESC_0029"></a><span><code class="code">prefix-meta (<kbd class="key">ESC</kbd>)</code><a class="copiable-link" href="#index-prefix_002dmeta-_0028ESC_0029"> &para;</a></span></dt>
2082 <dd><p>Metafy the next character typed.
2083 Typing &lsquo;<samp class="samp"><kbd class="key">ESC</kbd> f</samp>&rsquo; is equivalent to typing <kbd class="kbd">M-f</kbd>.
2084 </p>
2085 </dd>
2086 <dt><a id="index-undo-_0028C_002d_005f-or-C_002dx-C_002du_0029"></a><span><code class="code">undo (C-_ or C-x C-u)</code><a class="copiable-link" href="#index-undo-_0028C_002d_005f-or-C_002dx-C_002du_0029"> &para;</a></span></dt>
2087 <dd><p>Incremental undo, separately remembered for each line.
2088 </p>
2089 </dd>
2090 <dt><a id="index-revert_002dline-_0028M_002dr_0029"></a><span><code class="code">revert-line (M-r)</code><a class="copiable-link" href="#index-revert_002dline-_0028M_002dr_0029"> &para;</a></span></dt>
2091 <dd><p>Undo all changes made to this line.
2092 This is like executing the <code class="code">undo</code>
2093 command enough times to get back to the initial state.
2094 </p>
2095 </dd>
2096 <dt><a id="index-tilde_002dexpand-_0028M_002d_007e_0029"></a><span><code class="code">tilde-expand (M-~)</code><a class="copiable-link" href="#index-tilde_002dexpand-_0028M_002d_007e_0029"> &para;</a></span></dt>
2097 <dd><p>Perform tilde expansion on the current word.
2098 </p>
2099 </dd>
2100 <dt><a id="index-set_002dmark-_0028C_002d_0040_0029"></a><span><code class="code">set-mark (C-@)</code><a class="copiable-link" href="#index-set_002dmark-_0028C_002d_0040_0029"> &para;</a></span></dt>
2101 <dd><p>Set the mark to the point.
2102 If a numeric argument is supplied, set the mark to that position.
2103 </p>
2104 </dd>
2105 <dt><a id="index-exchange_002dpoint_002dand_002dmark-_0028C_002dx-C_002dx_0029"></a><span><code class="code">exchange-point-and-mark (C-x C-x)</code><a class="copiable-link" href="#index-exchange_002dpoint_002dand_002dmark-_0028C_002dx-C_002dx_0029"> &para;</a></span></dt>
2106 <dd><p>Swap the point with the mark.
2107 Set the current cursor position to the saved position,
2108 then set the mark to the old cursor position.
2109 </p>
2110 </dd>
2111 <dt><a id="index-character_002dsearch-_0028C_002d_005d_0029"></a><span><code class="code">character-search (C-])</code><a class="copiable-link" href="#index-character_002dsearch-_0028C_002d_005d_0029"> &para;</a></span></dt>
2112 <dd><p>Read a character and move point to the next occurrence of that character.
2113 A negative argument searches for previous occurrences.
2114 </p>
2115 </dd>
2116 <dt><a id="index-character_002dsearch_002dbackward-_0028M_002dC_002d_005d_0029"></a><span><code class="code">character-search-backward (M-C-])</code><a class="copiable-link" href="#index-character_002dsearch_002dbackward-_0028M_002dC_002d_005d_0029"> &para;</a></span></dt>
2117 <dd><p>Read a character and move point to the previous occurrence of that character.
2118 A negative argument searches for subsequent occurrences.
2119 </p>
2120 </dd>
2121 <dt><a id="index-skip_002dcsi_002dsequence-_0028_0029"></a><span><code class="code">skip-csi-sequence ()</code><a class="copiable-link" href="#index-skip_002dcsi_002dsequence-_0028_0029"> &para;</a></span></dt>
2122 <dd><p>Read enough characters to consume a multi-key sequence such as those
2123 defined for keys like Home and End.
2124 CSI sequences begin with a Control Sequence Indicator (CSI), usually
2125 <kbd class="kbd">ESC [</kbd>.
2126 If this sequence is bound to &quot;\e[&quot;,
2127 keys producing CSI sequences have no effect
2128 unless explicitly bound to a Readline command,
2129 instead of inserting stray characters into the editing buffer.
2130 This is unbound by default, but usually bound to
2131 <kbd class="kbd">ESC [</kbd>.
2132 </p>
2133 </dd>
2134 <dt><a id="index-insert_002dcomment-_0028M_002d_0023_0029"></a><span><code class="code">insert-comment (M-#)</code><a class="copiable-link" href="#index-insert_002dcomment-_0028M_002d_0023_0029"> &para;</a></span></dt>
2135 <dd><p>Without a numeric argument, insert the value of the <code class="code">comment-begin</code>
2136 variable at the beginning of the current line.
2137 If a numeric argument is supplied, this command acts as a toggle: if
2138 the characters at the beginning of the line do not match the value
2139 of <code class="code">comment-begin</code>, insert the value; otherwise delete
2140 the characters in <code class="code">comment-begin</code> from the beginning of the line.
2141 In either case, the line is accepted as if a newline had been typed.
2142 </p>
2143 </dd>
2144 <dt><a id="index-dump_002dfunctions-_0028_0029"></a><span><code class="code">dump-functions ()</code><a class="copiable-link" href="#index-dump_002dfunctions-_0028_0029"> &para;</a></span></dt>
2145 <dd><p>Print all of the functions and their key bindings
2146 to the Readline output stream.
2147 If a numeric argument is supplied,
2148 the output is formatted in such a way that it can be made part
2149 of an <var class="var">inputrc</var> file.
2150 This command is unbound by default.
2151 </p>
2152 </dd>
2153 <dt><a id="index-dump_002dvariables-_0028_0029"></a><span><code class="code">dump-variables ()</code><a class="copiable-link" href="#index-dump_002dvariables-_0028_0029"> &para;</a></span></dt>
2154 <dd><p>Print all of the settable variables and their values
2155 to the Readline output stream.
2156 If a numeric argument is supplied,
2157 the output is formatted in such a way that it can be made part
2158 of an <var class="var">inputrc</var> file.
2159 This command is unbound by default.
2160 </p>
2161 </dd>
2162 <dt><a id="index-dump_002dmacros-_0028_0029"></a><span><code class="code">dump-macros ()</code><a class="copiable-link" href="#index-dump_002dmacros-_0028_0029"> &para;</a></span></dt>
2163 <dd><p>Print all of the Readline key sequences bound to macros and the
2164 strings they output
2165 to the Readline output stream.
2166 If a numeric argument is supplied,
2167 the output is formatted in such a way that it can be made part
2168 of an <var class="var">inputrc</var> file.
2169 This command is unbound by default.
2170 </p>
2171 </dd>
2172 <dt><a id="index-execute_002dnamed_002dcommand-_0028M_002dx_0029"></a><span><code class="code">execute-named-command (M-x)</code><a class="copiable-link" href="#index-execute_002dnamed_002dcommand-_0028M_002dx_0029"> &para;</a></span></dt>
2173 <dd><p>Read a bindable Readline command name from the input and execute the
2174 function to which it&rsquo;s bound, as if the key sequence to which it was
2175 bound appeared in the input.
2176 If this function is supplied with a numeric argument, it passes that
2177 argument to the function it executes.
2178 </p>
2179
2180 </dd>
2181 <dt><a id="index-emacs_002dediting_002dmode-_0028C_002de_0029"></a><span><code class="code">emacs-editing-mode (C-e)</code><a class="copiable-link" href="#index-emacs_002dediting_002dmode-_0028C_002de_0029"> &para;</a></span></dt>
2182 <dd><p>When in <code class="code">vi</code> command mode, this causes a switch to <code class="code">emacs</code>
2183 editing mode.
2184 </p>
2185 </dd>
2186 <dt><a id="index-vi_002dediting_002dmode-_0028M_002dC_002dj_0029"></a><span><code class="code">vi-editing-mode (M-C-j)</code><a class="copiable-link" href="#index-vi_002dediting_002dmode-_0028M_002dC_002dj_0029"> &para;</a></span></dt>
2187 <dd><p>When in <code class="code">emacs</code> editing mode, this causes a switch to <code class="code">vi</code>
2188 editing mode.
2189 </p>
2190
2191 </dd>
2192 </dl>
2193
2194 <hr>
2195 </div>
2196 </div>
2197 <div class="section-level-extent" id="Readline-vi-Mode">
2198 <div class="nav-panel">
2199 <p>
2200 Previous: <a href="#Bindable-Readline-Commands" accesskey="p" rel="prev">Bindable Readline Commands</a>, Up: <a href="#Command-Line-Editing" accesskey="u" rel="up">Command Line Editing</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
2201 </div>
2202 <h3 class="section" id="Readline-vi-Mode-1"><span>1.5 Readline vi Mode<a class="copiable-link" href="#Readline-vi-Mode-1"> &para;</a></span></h3>
2203
2204 <p>While the Readline library does not have a full set of <code class="code">vi</code>
2205 editing functions, it does contain enough to allow simple editing
2206 of the line.
2207 The Readline <code class="code">vi</code> mode behaves as specified in the
2208 <code class="code">sh</code> description in the <small class="sc">POSIX</small> standard.
2209 </p>
2210 <p>In order to switch interactively between <code class="code">emacs</code> and <code class="code">vi</code>
2211 editing modes, use the command <kbd class="kbd">M-C-j</kbd> (bound to emacs-editing-mode
2212 when in <code class="code">vi</code> mode and to vi-editing-mode in <code class="code">emacs</code> mode).
2213 The Readline default is <code class="code">emacs</code> mode.
2214 </p>
2215 <p>When you enter a line in <code class="code">vi</code> mode, you are already placed in
2216 &lsquo;insertion&rsquo; mode, as if you had typed an &lsquo;<samp class="samp">i</samp>&rsquo;. Pressing <kbd class="key">ESC</kbd>
2217 switches you into &lsquo;command&rsquo; mode, where you can edit the text of the
2218 line with the standard <code class="code">vi</code> movement keys, move to previous
2219 history lines with &lsquo;<samp class="samp">k</samp>&rsquo; and subsequent lines with &lsquo;<samp class="samp">j</samp>&rsquo;, and
2220 so forth.
2221 </p>
2222
2223 <hr>
2224 </div>
2225 </div>
2226 <div class="appendix-level-extent" id="GNU-Free-Documentation-License">
2227 <div class="nav-panel">
2228 <p>
2229 Previous: <a href="#Command-Line-Editing" accesskey="p" rel="prev">Command Line Editing</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU Readline Library</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
2230 </div>
2231 <h2 class="appendix" id="GNU-Free-Documentation-License-1"><span>Appendix A GNU Free Documentation License<a class="copiable-link" href="#GNU-Free-Documentation-License-1"> &para;</a></span></h2>
2232
2233 <div class="center">Version 1.3, 3 November 2008
2234 </div>
2235
2236 <div class="display">
2237 <pre class="display-preformatted">Copyright &copy; 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
2238 <a class="uref" href="http://fsf.org/">http://fsf.org/</a>
2239
2240 Everyone is permitted to copy and distribute verbatim copies
2241 of this license document, but changing it is not allowed.
2242 </pre></div>
2243
2244 <ol class="enumerate" start="0">
2245 <li> PREAMBLE
2246
2247 <p>The purpose of this License is to make a manual, textbook, or other
2248 functional and useful document <em class="dfn">free</em> in the sense of freedom: to
2249 assure everyone the effective freedom to copy and redistribute it,
2250 with or without modifying it, either commercially or noncommercially.
2251 Secondarily, this License preserves for the author and publisher a way
2252 to get credit for their work, while not being considered responsible
2253 for modifications made by others.
2254 </p>
2255 <p>This License is a kind of &ldquo;copyleft&rdquo;, which means that derivative
2256 works of the document must themselves be free in the same sense. It
2257 complements the GNU General Public License, which is a copyleft
2258 license designed for free software.
2259 </p>
2260 <p>We have designed this License in order to use it for manuals for free
2261 software, because free software needs free documentation: a free
2262 program should come with manuals providing the same freedoms that the
2263 software does. But this License is not limited to software manuals;
2264 it can be used for any textual work, regardless of subject matter or
2265 whether it is published as a printed book. We recommend this License
2266 principally for works whose purpose is instruction or reference.
2267 </p>
2268 </li><li> APPLICABILITY AND DEFINITIONS
2269
2270 <p>This License applies to any manual or other work, in any medium, that
2271 contains a notice placed by the copyright holder saying it can be
2272 distributed under the terms of this License. Such a notice grants a
2273 world-wide, royalty-free license, unlimited in duration, to use that
2274 work under the conditions stated herein. The &ldquo;Document&rdquo;, below,
2275 refers to any such manual or work. Any member of the public is a
2276 licensee, and is addressed as &ldquo;you&rdquo;. You accept the license if you
2277 copy, modify or distribute the work in a way requiring permission
2278 under copyright law.
2279 </p>
2280 <p>A &ldquo;Modified Version&rdquo; of the Document means any work containing the
2281 Document or a portion of it, either copied verbatim, or with
2282 modifications and/or translated into another language.
2283 </p>
2284 <p>A &ldquo;Secondary Section&rdquo; is a named appendix or a front-matter section
2285 of the Document that deals exclusively with the relationship of the
2286 publishers or authors of the Document to the Document&rsquo;s overall
2287 subject (or to related matters) and contains nothing that could fall
2288 directly within that overall subject. (Thus, if the Document is in
2289 part a textbook of mathematics, a Secondary Section may not explain
2290 any mathematics.) The relationship could be a matter of historical
2291 connection with the subject or with related matters, or of legal,
2292 commercial, philosophical, ethical or political position regarding
2293 them.
2294 </p>
2295 <p>The &ldquo;Invariant Sections&rdquo; are certain Secondary Sections whose titles
2296 are designated, as being those of Invariant Sections, in the notice
2297 that says that the Document is released under this License. If a
2298 section does not fit the above definition of Secondary then it is not
2299 allowed to be designated as Invariant. The Document may contain zero
2300 Invariant Sections. If the Document does not identify any Invariant
2301 Sections then there are none.
2302 </p>
2303 <p>The &ldquo;Cover Texts&rdquo; are certain short passages of text that are listed,
2304 as Front-Cover Texts or Back-Cover Texts, in the notice that says that
2305 the Document is released under this License. A Front-Cover Text may
2306 be at most 5 words, and a Back-Cover Text may be at most 25 words.
2307 </p>
2308 <p>A &ldquo;Transparent&rdquo; copy of the Document means a machine-readable copy,
2309 represented in a format whose specification is available to the
2310 general public, that is suitable for revising the document
2311 straightforwardly with generic text editors or (for images composed of
2312 pixels) generic paint programs or (for drawings) some widely available
2313 drawing editor, and that is suitable for input to text formatters or
2314 for automatic translation to a variety of formats suitable for input
2315 to text formatters. A copy made in an otherwise Transparent file
2316 format whose markup, or absence of markup, has been arranged to thwart
2317 or discourage subsequent modification by readers is not Transparent.
2318 An image format is not Transparent if used for any substantial amount
2319 of text. A copy that is not &ldquo;Transparent&rdquo; is called &ldquo;Opaque&rdquo;.
2320 </p>
2321 <p>Examples of suitable formats for Transparent copies include plain
2322 <small class="sc">ASCII</small> without markup, Texinfo input format, LaTeX input
2323 format, <abbr class="acronym">SGML</abbr> or <abbr class="acronym">XML</abbr> using a publicly available
2324 <abbr class="acronym">DTD</abbr>, and standard-conforming simple <abbr class="acronym">HTML</abbr>,
2325 PostScript or <abbr class="acronym">PDF</abbr> designed for human modification. Examples
2326 of transparent image formats include <abbr class="acronym">PNG</abbr>, <abbr class="acronym">XCF</abbr> and
2327 <abbr class="acronym">JPG</abbr>. Opaque formats include proprietary formats that can be
2328 read and edited only by proprietary word processors, <abbr class="acronym">SGML</abbr> or
2329 <abbr class="acronym">XML</abbr> for which the <abbr class="acronym">DTD</abbr> and/or processing tools are
2330 not generally available, and the machine-generated <abbr class="acronym">HTML</abbr>,
2331 PostScript or <abbr class="acronym">PDF</abbr> produced by some word processors for
2332 output purposes only.
2333 </p>
2334 <p>The &ldquo;Title Page&rdquo; means, for a printed book, the title page itself,
2335 plus such following pages as are needed to hold, legibly, the material
2336 this License requires to appear in the title page. For works in
2337 formats which do not have any title page as such, &ldquo;Title Page&rdquo; means
2338 the text near the most prominent appearance of the work&rsquo;s title,
2339 preceding the beginning of the body of the text.
2340 </p>
2341 <p>The &ldquo;publisher&rdquo; means any person or entity that distributes copies
2342 of the Document to the public.
2343 </p>
2344 <p>A section &ldquo;Entitled XYZ&rdquo; means a named subunit of the Document whose
2345 title either is precisely XYZ or contains XYZ in parentheses following
2346 text that translates XYZ in another language. (Here XYZ stands for a
2347 specific section name mentioned below, such as &ldquo;Acknowledgements&rdquo;,
2348 &ldquo;Dedications&rdquo;, &ldquo;Endorsements&rdquo;, or &ldquo;History&rdquo;.) To &ldquo;Preserve the Title&rdquo;
2349 of such a section when you modify the Document means that it remains a
2350 section &ldquo;Entitled XYZ&rdquo; according to this definition.
2351 </p>
2352 <p>The Document may include Warranty Disclaimers next to the notice which
2353 states that this License applies to the Document. These Warranty
2354 Disclaimers are considered to be included by reference in this
2355 License, but only as regards disclaiming warranties: any other
2356 implication that these Warranty Disclaimers may have is void and has
2357 no effect on the meaning of this License.
2358 </p>
2359 </li><li> VERBATIM COPYING
2360
2361 <p>You may copy and distribute the Document in any medium, either
2362 commercially or noncommercially, provided that this License, the
2363 copyright notices, and the license notice saying this License applies
2364 to the Document are reproduced in all copies, and that you add no other
2365 conditions whatsoever to those of this License. You may not use
2366 technical measures to obstruct or control the reading or further
2367 copying of the copies you make or distribute. However, you may accept
2368 compensation in exchange for copies. If you distribute a large enough
2369 number of copies you must also follow the conditions in section 3.
2370 </p>
2371 <p>You may also lend copies, under the same conditions stated above, and
2372 you may publicly display copies.
2373 </p>
2374 </li><li> COPYING IN QUANTITY
2375
2376 <p>If you publish printed copies (or copies in media that commonly have
2377 printed covers) of the Document, numbering more than 100, and the
2378 Document&rsquo;s license notice requires Cover Texts, you must enclose the
2379 copies in covers that carry, clearly and legibly, all these Cover
2380 Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
2381 the back cover. Both covers must also clearly and legibly identify
2382 you as the publisher of these copies. The front cover must present
2383 the full title with all words of the title equally prominent and
2384 visible. You may add other material on the covers in addition.
2385 Copying with changes limited to the covers, as long as they preserve
2386 the title of the Document and satisfy these conditions, can be treated
2387 as verbatim copying in other respects.
2388 </p>
2389 <p>If the required texts for either cover are too voluminous to fit
2390 legibly, you should put the first ones listed (as many as fit
2391 reasonably) on the actual cover, and continue the rest onto adjacent
2392 pages.
2393 </p>
2394 <p>If you publish or distribute Opaque copies of the Document numbering
2395 more than 100, you must either include a machine-readable Transparent
2396 copy along with each Opaque copy, or state in or with each Opaque copy
2397 a computer-network location from which the general network-using
2398 public has access to download using public-standard network protocols
2399 a complete Transparent copy of the Document, free of added material.
2400 If you use the latter option, you must take reasonably prudent steps,
2401 when you begin distribution of Opaque copies in quantity, to ensure
2402 that this Transparent copy will remain thus accessible at the stated
2403 location until at least one year after the last time you distribute an
2404 Opaque copy (directly or through your agents or retailers) of that
2405 edition to the public.
2406 </p>
2407 <p>It is requested, but not required, that you contact the authors of the
2408 Document well before redistributing any large number of copies, to give
2409 them a chance to provide you with an updated version of the Document.
2410 </p>
2411 </li><li> MODIFICATIONS
2412
2413 <p>You may copy and distribute a Modified Version of the Document under
2414 the conditions of sections 2 and 3 above, provided that you release
2415 the Modified Version under precisely this License, with the Modified
2416 Version filling the role of the Document, thus licensing distribution
2417 and modification of the Modified Version to whoever possesses a copy
2418 of it. In addition, you must do these things in the Modified Version:
2419 </p>
2420 <ol class="enumerate" type="A" start="1">
2421 <li> Use in the Title Page (and on the covers, if any) a title distinct
2422 from that of the Document, and from those of previous versions
2423 (which should, if there were any, be listed in the History section
2424 of the Document). You may use the same title as a previous version
2425 if the original publisher of that version gives permission.
2426
2427 </li><li> List on the Title Page, as authors, one or more persons or entities
2428 responsible for authorship of the modifications in the Modified
2429 Version, together with at least five of the principal authors of the
2430 Document (all of its principal authors, if it has fewer than five),
2431 unless they release you from this requirement.
2432
2433 </li><li> State on the Title page the name of the publisher of the
2434 Modified Version, as the publisher.
2435
2436 </li><li> Preserve all the copyright notices of the Document.
2437
2438 </li><li> Add an appropriate copyright notice for your modifications
2439 adjacent to the other copyright notices.
2440
2441 </li><li> Include, immediately after the copyright notices, a license notice
2442 giving the public permission to use the Modified Version under the
2443 terms of this License, in the form shown in the Addendum below.
2444
2445 </li><li> Preserve in that license notice the full lists of Invariant Sections
2446 and required Cover Texts given in the Document&rsquo;s license notice.
2447
2448 </li><li> Include an unaltered copy of this License.
2449
2450 </li><li> Preserve the section Entitled &ldquo;History&rdquo;, Preserve its Title, and add
2451 to it an item stating at least the title, year, new authors, and
2452 publisher of the Modified Version as given on the Title Page. If
2453 there is no section Entitled &ldquo;History&rdquo; in the Document, create one
2454 stating the title, year, authors, and publisher of the Document as
2455 given on its Title Page, then add an item describing the Modified
2456 Version as stated in the previous sentence.
2457
2458 </li><li> Preserve the network location, if any, given in the Document for
2459 public access to a Transparent copy of the Document, and likewise
2460 the network locations given in the Document for previous versions
2461 it was based on. These may be placed in the &ldquo;History&rdquo; section.
2462 You may omit a network location for a work that was published at
2463 least four years before the Document itself, or if the original
2464 publisher of the version it refers to gives permission.
2465
2466 </li><li> For any section Entitled &ldquo;Acknowledgements&rdquo; or &ldquo;Dedications&rdquo;, Preserve
2467 the Title of the section, and preserve in the section all the
2468 substance and tone of each of the contributor acknowledgements and/or
2469 dedications given therein.
2470
2471 </li><li> Preserve all the Invariant Sections of the Document,
2472 unaltered in their text and in their titles. Section numbers
2473 or the equivalent are not considered part of the section titles.
2474
2475 </li><li> Delete any section Entitled &ldquo;Endorsements&rdquo;. Such a section
2476 may not be included in the Modified Version.
2477
2478 </li><li> Do not retitle any existing section to be Entitled &ldquo;Endorsements&rdquo; or
2479 to conflict in title with any Invariant Section.
2480
2481 </li><li> Preserve any Warranty Disclaimers.
2482 </li></ol>
2483
2484 <p>If the Modified Version includes new front-matter sections or
2485 appendices that qualify as Secondary Sections and contain no material
2486 copied from the Document, you may at your option designate some or all
2487 of these sections as invariant. To do this, add their titles to the
2488 list of Invariant Sections in the Modified Version&rsquo;s license notice.
2489 These titles must be distinct from any other section titles.
2490 </p>
2491 <p>You may add a section Entitled &ldquo;Endorsements&rdquo;, provided it contains
2492 nothing but endorsements of your Modified Version by various
2493 parties&mdash;for example, statements of peer review or that the text has
2494 been approved by an organization as the authoritative definition of a
2495 standard.
2496 </p>
2497 <p>You may add a passage of up to five words as a Front-Cover Text, and a
2498 passage of up to 25 words as a Back-Cover Text, to the end of the list
2499 of Cover Texts in the Modified Version. Only one passage of
2500 Front-Cover Text and one of Back-Cover Text may be added by (or
2501 through arrangements made by) any one entity. If the Document already
2502 includes a cover text for the same cover, previously added by you or
2503 by arrangement made by the same entity you are acting on behalf of,
2504 you may not add another; but you may replace the old one, on explicit
2505 permission from the previous publisher that added the old one.
2506 </p>
2507 <p>The author(s) and publisher(s) of the Document do not by this License
2508 give permission to use their names for publicity for or to assert or
2509 imply endorsement of any Modified Version.
2510 </p>
2511 </li><li> COMBINING DOCUMENTS
2512
2513 <p>You may combine the Document with other documents released under this
2514 License, under the terms defined in section 4 above for modified
2515 versions, provided that you include in the combination all of the
2516 Invariant Sections of all of the original documents, unmodified, and
2517 list them all as Invariant Sections of your combined work in its
2518 license notice, and that you preserve all their Warranty Disclaimers.
2519 </p>
2520 <p>The combined work need only contain one copy of this License, and
2521 multiple identical Invariant Sections may be replaced with a single
2522 copy. If there are multiple Invariant Sections with the same name but
2523 different contents, make the title of each such section unique by
2524 adding at the end of it, in parentheses, the name of the original
2525 author or publisher of that section if known, or else a unique number.
2526 Make the same adjustment to the section titles in the list of
2527 Invariant Sections in the license notice of the combined work.
2528 </p>
2529 <p>In the combination, you must combine any sections Entitled &ldquo;History&rdquo;
2530 in the various original documents, forming one section Entitled
2531 &ldquo;History&rdquo;; likewise combine any sections Entitled &ldquo;Acknowledgements&rdquo;,
2532 and any sections Entitled &ldquo;Dedications&rdquo;. You must delete all
2533 sections Entitled &ldquo;Endorsements.&rdquo;
2534 </p>
2535 </li><li> COLLECTIONS OF DOCUMENTS
2536
2537 <p>You may make a collection consisting of the Document and other documents
2538 released under this License, and replace the individual copies of this
2539 License in the various documents with a single copy that is included in
2540 the collection, provided that you follow the rules of this License for
2541 verbatim copying of each of the documents in all other respects.
2542 </p>
2543 <p>You may extract a single document from such a collection, and distribute
2544 it individually under this License, provided you insert a copy of this
2545 License into the extracted document, and follow this License in all
2546 other respects regarding verbatim copying of that document.
2547 </p>
2548 </li><li> AGGREGATION WITH INDEPENDENT WORKS
2549
2550 <p>A compilation of the Document or its derivatives with other separate
2551 and independent documents or works, in or on a volume of a storage or
2552 distribution medium, is called an &ldquo;aggregate&rdquo; if the copyright
2553 resulting from the compilation is not used to limit the legal rights
2554 of the compilation&rsquo;s users beyond what the individual works permit.
2555 When the Document is included in an aggregate, this License does not
2556 apply to the other works in the aggregate which are not themselves
2557 derivative works of the Document.
2558 </p>
2559 <p>If the Cover Text requirement of section 3 is applicable to these
2560 copies of the Document, then if the Document is less than one half of
2561 the entire aggregate, the Document&rsquo;s Cover Texts may be placed on
2562 covers that bracket the Document within the aggregate, or the
2563 electronic equivalent of covers if the Document is in electronic form.
2564 Otherwise they must appear on printed covers that bracket the whole
2565 aggregate.
2566 </p>
2567 </li><li> TRANSLATION
2568
2569 <p>Translation is considered a kind of modification, so you may
2570 distribute translations of the Document under the terms of section 4.
2571 Replacing Invariant Sections with translations requires special
2572 permission from their copyright holders, but you may include
2573 translations of some or all Invariant Sections in addition to the
2574 original versions of these Invariant Sections. You may include a
2575 translation of this License, and all the license notices in the
2576 Document, and any Warranty Disclaimers, provided that you also include
2577 the original English version of this License and the original versions
2578 of those notices and disclaimers. In case of a disagreement between
2579 the translation and the original version of this License or a notice
2580 or disclaimer, the original version will prevail.
2581 </p>
2582 <p>If a section in the Document is Entitled &ldquo;Acknowledgements&rdquo;,
2583 &ldquo;Dedications&rdquo;, or &ldquo;History&rdquo;, the requirement (section 4) to Preserve
2584 its Title (section 1) will typically require changing the actual
2585 title.
2586 </p>
2587 </li><li> TERMINATION
2588
2589 <p>You may not copy, modify, sublicense, or distribute the Document
2590 except as expressly provided under this License. Any attempt
2591 otherwise to copy, modify, sublicense, or distribute it is void, and
2592 will automatically terminate your rights under this License.
2593 </p>
2594 <p>However, if you cease all violation of this License, then your license
2595 from a particular copyright holder is reinstated (a) provisionally,
2596 unless and until the copyright holder explicitly and finally
2597 terminates your license, and (b) permanently, if the copyright holder
2598 fails to notify you of the violation by some reasonable means prior to
2599 60 days after the cessation.
2600 </p>
2601 <p>Moreover, your license from a particular copyright holder is
2602 reinstated permanently if the copyright holder notifies you of the
2603 violation by some reasonable means, this is the first time you have
2604 received notice of violation of this License (for any work) from that
2605 copyright holder, and you cure the violation prior to 30 days after
2606 your receipt of the notice.
2607 </p>
2608 <p>Termination of your rights under this section does not terminate the
2609 licenses of parties who have received copies or rights from you under
2610 this License. If your rights have been terminated and not permanently
2611 reinstated, receipt of a copy of some or all of the same material does
2612 not give you any rights to use it.
2613 </p>
2614 </li><li> FUTURE REVISIONS OF THIS LICENSE
2615
2616 <p>The Free Software Foundation may publish new, revised versions
2617 of the GNU Free Documentation License from time to time. Such new
2618 versions will be similar in spirit to the present version, but may
2619 differ in detail to address new problems or concerns. See
2620 <a class="uref" href="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</a>.
2621 </p>
2622 <p>Each version of the License is given a distinguishing version number.
2623 If the Document specifies that a particular numbered version of this
2624 License &ldquo;or any later version&rdquo; applies to it, you have the option of
2625 following the terms and conditions either of that specified version or
2626 of any later version that has been published (not as a draft) by the
2627 Free Software Foundation. If the Document does not specify a version
2628 number of this License, you may choose any version ever published (not
2629 as a draft) by the Free Software Foundation. If the Document
2630 specifies that a proxy can decide which future versions of this
2631 License can be used, that proxy&rsquo;s public statement of acceptance of a
2632 version permanently authorizes you to choose that version for the
2633 Document.
2634 </p>
2635 </li><li> RELICENSING
2636
2637 <p>&ldquo;Massive Multiauthor Collaboration Site&rdquo; (or &ldquo;MMC Site&rdquo;) means any
2638 World Wide Web server that publishes copyrightable works and also
2639 provides prominent facilities for anybody to edit those works. A
2640 public wiki that anybody can edit is an example of such a server. A
2641 &ldquo;Massive Multiauthor Collaboration&rdquo; (or &ldquo;MMC&rdquo;) contained in the
2642 site means any set of copyrightable works thus published on the MMC
2643 site.
2644 </p>
2645 <p>&ldquo;CC-BY-SA&rdquo; means the Creative Commons Attribution-Share Alike 3.0
2646 license published by Creative Commons Corporation, a not-for-profit
2647 corporation with a principal place of business in San Francisco,
2648 California, as well as future copyleft versions of that license
2649 published by that same organization.
2650 </p>
2651 <p>&ldquo;Incorporate&rdquo; means to publish or republish a Document, in whole or
2652 in part, as part of another Document.
2653 </p>
2654 <p>An MMC is &ldquo;eligible for relicensing&rdquo; if it is licensed under this
2655 License, and if all works that were first published under this License
2656 somewhere other than this MMC, and subsequently incorporated in whole
2657 or in part into the MMC, (1) had no cover texts or invariant sections,
2658 and (2) were thus incorporated prior to November 1, 2008.
2659 </p>
2660 <p>The operator of an MMC Site may republish an MMC contained in the site
2661 under CC-BY-SA on the same site at any time before August 1, 2009,
2662 provided the MMC is eligible for relicensing.
2663 </p>
2664 </li></ol>
2665
2666 <h3 class="heading" id="ADDENDUM_003a-How-to-use-this-License-for-your-documents"><span>ADDENDUM: How to use this License for your documents<a class="copiable-link" href="#ADDENDUM_003a-How-to-use-this-License-for-your-documents"> &para;</a></span></h3>
2667
2668 <p>To use this License in a document you have written, include a copy of
2669 the License in the document and put the following copyright and
2670 license notices just after the title page:
2671 </p>
2672 <div class="example smallexample">
2673 <div class="group"><pre class="example-preformatted"> Copyright (C) <var class="var">year</var> <var class="var">your name</var>.
2674 Permission is granted to copy, distribute and/or modify this document
2675 under the terms of the GNU Free Documentation License, Version 1.3
2676 or any later version published by the Free Software Foundation;
2677 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
2678 Texts. A copy of the license is included in the section entitled ``GNU
2679 Free Documentation License''.
2680 </pre></div></div>
2681
2682 <p>If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
2683 replace the &ldquo;with&hellip;Texts.&rdquo; line with this:
2684 </p>
2685 <div class="example smallexample">
2686 <div class="group"><pre class="example-preformatted"> with the Invariant Sections being <var class="var">list their titles</var>, with
2687 the Front-Cover Texts being <var class="var">list</var>, and with the Back-Cover Texts
2688 being <var class="var">list</var>.
2689 </pre></div></div>
2690
2691 <p>If you have Invariant Sections without Cover Texts, or some other
2692 combination of the three, merge those two alternatives to suit the
2693 situation.
2694 </p>
2695 <p>If your document contains nontrivial examples of program code, we
2696 recommend releasing these examples in parallel under your choice of
2697 free software license, such as the GNU General Public License,
2698 to permit their use in free software.
2699 </p>
2700
2701
2702 </div>
2703 </div>
2704
2705
2706
2707 </body>
2708 </html>