Initial bulk commit for "Git on MSys"
[msysgit/historical-msysgit.git] / mingw / info / gdb / Readline-Init-File-Syntax.html
blobde12df81f0bd9a49de6152f34c83108bb3ee511a
1 <html lang="en">
2 <head>
3 <title>Debugging with GDB</title>
4 <meta http-equiv="Content-Type" content="text/html">
5 <meta name="description" content="Debugging with GDB">
6 <meta name="generator" content="makeinfo 4.3">
7 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home">
8 </head>
9 <body>
10 <div class="node">
11 <p>
12 Node:<a name="Readline%20Init%20File%20Syntax">Readline Init File Syntax</a>,
13 Next:<a rel="next" accesskey="n" href="Conditional-Init-Constructs.html#Conditional%20Init%20Constructs">Conditional Init Constructs</a>,
14 Up:<a rel="up" accesskey="u" href="Readline-Init-File.html#Readline%20Init%20File">Readline Init File</a>
15 <hr><br>
16 </div>
18 <h4 class="subsection">Readline Init File Syntax</h4>
20 <p>There are only a few basic constructs allowed in the
21 Readline init file. Blank lines are ignored.
22 Lines beginning with a <code>#</code> are comments.
23 Lines beginning with a <code>$</code> indicate conditional
24 constructs (see <a href="Conditional-Init-Constructs.html#Conditional%20Init%20Constructs">Conditional Init Constructs</a>). Other lines
25 denote variable settings and key bindings.
27 <dl>
28 <dt>Variable Settings
29 <dd>You can modify the run-time behavior of Readline by
30 altering the values of variables in Readline
31 using the <code>set</code> command within the init file.
32 The syntax is simple:
34 <pre class="example"> set <var>variable</var> <var>value</var>
35 </pre>
37 <p>Here, for example, is how to
38 change from the default Emacs-like key binding to use
39 <code>vi</code> line editing commands:
41 <pre class="example"> set editing-mode vi
42 </pre>
44 <p>Variable names and values, where appropriate, are recognized without regard
45 to case.
47 <p>A great deal of run-time behavior is changeable with the following
48 variables.
50 <dl>
52 <br><dt><code>bell-style</code>
53 <dd>Controls what happens when Readline wants to ring the terminal bell.
54 If set to <code>none</code>, Readline never rings the bell. If set to
55 <code>visible</code>, Readline uses a visible bell if one is available.
56 If set to <code>audible</code> (the default), Readline attempts to ring
57 the terminal's bell.
59 <br><dt><code>comment-begin</code>
60 <dd>The string to insert at the beginning of the line when the
61 <code>insert-comment</code> command is executed. The default value
62 is <code>"#"</code>.
64 <br><dt><code>completion-ignore-case</code>
65 <dd>If set to <code>on</code>, Readline performs filename matching and completion
66 in a case-insensitive fashion.
67 The default value is <code>off</code>.
69 <br><dt><code>completion-query-items</code>
70 <dd>The number of possible completions that determines when the user is
71 asked whether he wants to see the list of possibilities. If the
72 number of possible completions is greater than this value,
73 Readline will ask the user whether or not he wishes to view
74 them; otherwise, they are simply listed.
75 This variable must be set to an integer value greater than or equal to 0.
76 The default limit is <code>100</code>.
78 <br><dt><code>convert-meta</code>
79 <dd>If set to <code>on</code>, Readline will convert characters with the
80 eighth bit set to an <small>ASCII</small> key sequence by stripping the eighth
81 bit and prefixing an &lt;ESC&gt; character, converting them to a
82 meta-prefixed key sequence. The default value is <code>on</code>.
84 <br><dt><code>disable-completion</code>
85 <dd>If set to <code>On</code>, Readline will inhibit word completion.
86 Completion characters will be inserted into the line as if they had
87 been mapped to <code>self-insert</code>. The default is <code>off</code>.
89 <br><dt><code>editing-mode</code>
90 <dd>The <code>editing-mode</code> variable controls which default set of
91 key bindings is used. By default, Readline starts up in Emacs editing
92 mode, where the keystrokes are most similar to Emacs. This variable can be
93 set to either <code>emacs</code> or <code>vi</code>.
95 <br><dt><code>enable-keypad</code>
96 <dd>When set to <code>on</code>, Readline will try to enable the application
97 keypad when it is called. Some systems need this to enable the
98 arrow keys. The default is <code>off</code>.
100 <br><dt><code>expand-tilde</code>
101 <dd>If set to <code>on</code>, tilde expansion is performed when Readline
102 attempts word completion. The default is <code>off</code>.
104 <br><dt><code>horizontal-scroll-mode</code>
105 <dd>This variable can be set to either <code>on</code> or <code>off</code>. Setting it
106 to <code>on</code> means that the text of the lines being edited will scroll
107 horizontally on a single screen line when they are longer than the width
108 of the screen, instead of wrapping onto a new screen line. By default,
109 this variable is set to <code>off</code>.
111 <br><dt><code>input-meta</code>
112 <dd>If set to <code>on</code>, Readline will enable eight-bit input (it
113 will not clear the eighth bit in the characters it reads),
114 regardless of what the terminal claims it can support. The
115 default value is <code>off</code>. The name <code>meta-flag</code> is a
116 synonym for this variable.
118 <br><dt><code>isearch-terminators</code>
119 <dd>The string of characters that should terminate an incremental search without
120 subsequently executing the character as a command (see <a href="Searching.html#Searching">Searching</a>).
121 If this variable has not been given a value, the characters &lt;ESC&gt; and
122 <kbd>C-J</kbd> will terminate an incremental search.
124 <br><dt><code>keymap</code>
125 <dd>Sets Readline's idea of the current keymap for key binding commands.
126 Acceptable <code>keymap</code> names are
127 <code>emacs</code>,
128 <code>emacs-standard</code>,
129 <code>emacs-meta</code>,
130 <code>emacs-ctlx</code>,
131 <code>vi</code>,
132 <code>vi-move</code>,
133 <code>vi-command</code>, and
134 <code>vi-insert</code>.
135 <code>vi</code> is equivalent to <code>vi-command</code>; <code>emacs</code> is
136 equivalent to <code>emacs-standard</code>. The default value is <code>emacs</code>.
137 The value of the <code>editing-mode</code> variable also affects the
138 default keymap.
140 <br><dt><code>mark-directories</code>
141 <dd>If set to <code>on</code>, completed directory names have a slash
142 appended. The default is <code>on</code>.
144 <br><dt><code>mark-modified-lines</code>
145 <dd>This variable, when set to <code>on</code>, causes Readline to display an
146 asterisk (<code>*</code>) at the start of history lines which have been modified.
147 This variable is <code>off</code> by default.
149 <br><dt><code>output-meta</code>
150 <dd>If set to <code>on</code>, Readline will display characters with the
151 eighth bit set directly rather than as a meta-prefixed escape
152 sequence. The default is <code>off</code>.
154 <br><dt><code>print-completions-horizontally</code>
155 <dd>If set to <code>on</code>, Readline will display completions with matches
156 sorted horizontally in alphabetical order, rather than down the screen.
157 The default is <code>off</code>.
159 <br><dt><code>show-all-if-ambiguous</code>
160 <dd>This alters the default behavior of the completion functions. If
161 set to <code>on</code>,
162 words which have more than one possible completion cause the
163 matches to be listed immediately instead of ringing the bell.
164 The default value is <code>off</code>.
166 <br><dt><code>visible-stats</code>
167 <dd>If set to <code>on</code>, a character denoting a file's type
168 is appended to the filename when listing possible
169 completions. The default is <code>off</code>.
171 </dl>
173 <br><dt>Key Bindings
174 <dd>The syntax for controlling key bindings in the init file is
175 simple. First you need to find the name of the command that you
176 want to change. The following sections contain tables of the command
177 name, the default keybinding, if any, and a short description of what
178 the command does.
180 <p>Once you know the name of the command, simply place on a line
181 in the init file the name of the key
182 you wish to bind the command to, a colon, and then the name of the
183 command. The name of the key
184 can be expressed in different ways, depending on what you find most
185 comfortable.
187 <p>In addition to command names, readline allows keys to be bound
188 to a string that is inserted when the key is pressed (a <var>macro</var>).
190 <dl>
191 <dt><var>keyname</var>:&nbsp;<var>function-name</var>&nbsp;or&nbsp;<var>macro</var>
192 <dd><var>keyname</var> is the name of a key spelled out in English. For example:
193 <pre class="example"> Control-u: universal-argument
194 Meta-Rubout: backward-kill-word
195 Control-o: "&gt; output"
196 </pre>
198 <p>In the above example, <kbd>C-u</kbd> is bound to the function
199 <code>universal-argument</code>,
200 <kbd>M-DEL</kbd> is bound to the function <code>backward-kill-word</code>, and
201 <kbd>C-o</kbd> is bound to run the macro
202 expressed on the right hand side (that is, to insert the text
203 <code>&gt; output</code> into the line).
205 <p>A number of symbolic character names are recognized while
206 processing this key binding syntax:
207 <var>DEL</var>,
208 <var>ESC</var>,
209 <var>ESCAPE</var>,
210 <var>LFD</var>,
211 <var>NEWLINE</var>,
212 <var>RET</var>,
213 <var>RETURN</var>,
214 <var>RUBOUT</var>,
215 <var>SPACE</var>,
216 <var>SPC</var>,
218 <var>TAB</var>.
220 <br><dt>"<var>keyseq</var>":&nbsp;<var>function-name</var>&nbsp;or&nbsp;<var>macro</var>
221 <dd><var>keyseq</var> differs from <var>keyname</var> above in that strings
222 denoting an entire key sequence can be specified, by placing
223 the key sequence in double quotes. Some <small>GNU</small> Emacs style key
224 escapes can be used, as in the following example, but the
225 special character names are not recognized.
227 <pre class="example"> "\C-u": universal-argument
228 "\C-x\C-r": re-read-init-file
229 "\e[11~": "Function Key 1"
230 </pre>
232 <p>In the above example, <kbd>C-u</kbd> is again bound to the function
233 <code>universal-argument</code> (just as it was in the first example),
234 <code></code><kbd>C-x</kbd><code> </code><kbd>C-r</kbd><code></code> is bound to the function <code>re-read-init-file</code>,
235 and <code>&lt;ESC&gt; &lt;[&gt; &lt;1&gt; &lt;1&gt; &lt;~&gt;</code> is bound to insert
236 the text <code>Function Key 1</code>.
238 </dl>
240 <p>The following <small>GNU</small> Emacs style escape sequences are available when
241 specifying key sequences:
243 <dl>
244 <dt><code></code><kbd>\C-</kbd><code></code>
245 <dd>control prefix
246 <br><dt><code></code><kbd>\M-</kbd><code></code>
247 <dd>meta prefix
248 <br><dt><code></code><kbd>\e</kbd><code></code>
249 <dd>an escape character
250 <br><dt><code></code><kbd>\\</kbd><code></code>
251 <dd>backslash
252 <br><dt><code></code><kbd>\"</kbd><code></code>
253 <dd>&lt;"&gt;, a double quotation mark
254 <br><dt><code></code><kbd>\'</kbd><code></code>
255 <dd>&lt;'&gt;, a single quote or apostrophe
256 </dl>
258 <p>In addition to the <small>GNU</small> Emacs style escape sequences, a second
259 set of backslash escapes is available:
261 <dl>
262 <dt><code>\a</code>
263 <dd>alert (bell)
264 <br><dt><code>\b</code>
265 <dd>backspace
266 <br><dt><code>\d</code>
267 <dd>delete
268 <br><dt><code>\f</code>
269 <dd>form feed
270 <br><dt><code>\n</code>
271 <dd>newline
272 <br><dt><code>\r</code>
273 <dd>carriage return
274 <br><dt><code>\t</code>
275 <dd>horizontal tab
276 <br><dt><code>\v</code>
277 <dd>vertical tab
278 <br><dt><code>\</code><var>nnn</var><code></code>
279 <dd>the character whose <small>ASCII</small> code is the octal value <var>nnn</var>
280 (one to three digits)
281 <br><dt><code>\x</code><var>nnn</var><code></code>
282 <dd>the character whose <small>ASCII</small> code is the hexadecimal value <var>nnn</var>
283 (one to three digits)
284 </dl>
286 <p>When entering the text of a macro, single or double quotes must
287 be used to indicate a macro definition.
288 Unquoted text is assumed to be a function name.
289 In the macro body, the backslash escapes described above are expanded.
290 Backslash will quote any other character in the macro text,
291 including <code>"</code> and <code>'</code>.
292 For example, the following binding will make <code></code><kbd>C-x</kbd><code> \</code>
293 insert a single <code>\</code> into the line:
294 <pre class="example"> "\C-x\\": "\\"
295 </pre>
297 </dl>
299 </body></html>