Readline-Init-File-Syntax.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Free Software" and "Free Software Needs
  8. Free Documentation", with the Front-Cover Texts being "A GNU Manual,"
  9. and with the Back-Cover Texts as in (a) below.
  10. (a) The FSF's Back-Cover Text is: "You are free to copy and modify
  11. this GNU Manual. Buying copies from GNU Press supports the FSF in
  12. developing GNU and promoting software freedom." -->
  13. <!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <title>Debugging with GDB: Readline Init File Syntax</title>
  16. <meta name="description" content="Debugging with GDB: Readline Init File Syntax">
  17. <meta name="keywords" content="Debugging with GDB: Readline Init File Syntax">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  21. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  22. <link href="index.html#Top" rel="start" title="Top">
  23. <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
  24. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  25. <link href="Readline-Init-File.html#Readline-Init-File" rel="up" title="Readline Init File">
  26. <link href="Conditional-Init-Constructs.html#Conditional-Init-Constructs" rel="next" title="Conditional Init Constructs">
  27. <link href="Readline-Init-File.html#Readline-Init-File" rel="previous" title="Readline Init File">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.smallquotation {font-size: smaller}
  32. div.display {margin-left: 3.2em}
  33. div.example {margin-left: 3.2em}
  34. div.indentedblock {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  38. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  39. div.smalllisp {margin-left: 3.2em}
  40. kbd {font-style:oblique}
  41. pre.display {font-family: inherit}
  42. pre.format {font-family: inherit}
  43. pre.menu-comment {font-family: serif}
  44. pre.menu-preformatted {font-family: serif}
  45. pre.smalldisplay {font-family: inherit; font-size: smaller}
  46. pre.smallexample {font-size: smaller}
  47. pre.smallformat {font-family: inherit; font-size: smaller}
  48. pre.smalllisp {font-size: smaller}
  49. span.nocodebreak {white-space:nowrap}
  50. span.nolinebreak {white-space:nowrap}
  51. span.roman {font-family:serif; font-weight:normal}
  52. span.sansserif {font-family:sans-serif; font-weight:normal}
  53. ul.no-bullet {list-style: none}
  54. -->
  55. </style>
  56. </head>
  57. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  58. <a name="Readline-Init-File-Syntax"></a>
  59. <div class="header">
  60. <p>
  61. Next: <a href="Conditional-Init-Constructs.html#Conditional-Init-Constructs" accesskey="n" rel="next">Conditional Init Constructs</a>, Up: <a href="Readline-Init-File.html#Readline-Init-File" accesskey="u" rel="up">Readline Init File</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
  62. </div>
  63. <hr>
  64. <a name="Readline-Init-File-Syntax-1"></a>
  65. <h4 class="subsection">32.3.1 Readline Init File Syntax</h4>
  66. <p>There are only a few basic constructs allowed in the
  67. Readline init file. Blank lines are ignored.
  68. Lines beginning with a &lsquo;<samp>#</samp>&rsquo; are comments.
  69. Lines beginning with a &lsquo;<samp>$</samp>&rsquo; indicate conditional
  70. constructs (see <a href="Conditional-Init-Constructs.html#Conditional-Init-Constructs">Conditional Init Constructs</a>). Other lines
  71. denote variable settings and key bindings.
  72. </p>
  73. <dl compact="compact">
  74. <dt>Variable Settings</dt>
  75. <dd><p>You can modify the run-time behavior of Readline by
  76. altering the values of variables in Readline
  77. using the <code>set</code> command within the init file.
  78. The syntax is simple:
  79. </p>
  80. <div class="example">
  81. <pre class="example">set <var>variable</var> <var>value</var>
  82. </pre></div>
  83. <p>Here, for example, is how to
  84. change from the default Emacs-like key binding to use
  85. <code>vi</code> line editing commands:
  86. </p>
  87. <div class="example">
  88. <pre class="example">set editing-mode vi
  89. </pre></div>
  90. <p>Variable names and values, where appropriate, are recognized without regard
  91. to case. Unrecognized variable names are ignored.
  92. </p>
  93. <p>Boolean variables (those that can be set to on or off) are set to on if
  94. the value is null or empty, <var>on</var> (case-insensitive), or 1. Any other
  95. value results in the variable being set to off.
  96. </p>
  97. <p>A great deal of run-time behavior is changeable with the following
  98. variables.
  99. </p>
  100. <a name="index-variables_002c-readline"></a>
  101. <dl compact="compact">
  102. <dt><code>bell-style</code></dt>
  103. <dd><a name="index-bell_002dstyle"></a>
  104. <p>Controls what happens when Readline wants to ring the terminal bell.
  105. If set to &lsquo;<samp>none</samp>&rsquo;, Readline never rings the bell. If set to
  106. &lsquo;<samp>visible</samp>&rsquo;, Readline uses a visible bell if one is available.
  107. If set to &lsquo;<samp>audible</samp>&rsquo; (the default), Readline attempts to ring
  108. the terminal&rsquo;s bell.
  109. </p>
  110. </dd>
  111. <dt><code>bind-tty-special-chars</code></dt>
  112. <dd><a name="index-bind_002dtty_002dspecial_002dchars"></a>
  113. <p>If set to &lsquo;<samp>on</samp>&rsquo; (the default), Readline attempts to bind the control
  114. characters treated specially by the kernel&rsquo;s terminal driver to their
  115. Readline equivalents.
  116. </p>
  117. </dd>
  118. <dt><code>blink-matching-paren</code></dt>
  119. <dd><a name="index-blink_002dmatching_002dparen"></a>
  120. <p>If set to &lsquo;<samp>on</samp>&rsquo;, Readline attempts to briefly move the cursor to an
  121. opening parenthesis when a closing parenthesis is inserted. The default
  122. is &lsquo;<samp>off</samp>&rsquo;.
  123. </p>
  124. </dd>
  125. <dt><code>colored-completion-prefix</code></dt>
  126. <dd><a name="index-colored_002dcompletion_002dprefix"></a>
  127. <p>If set to &lsquo;<samp>on</samp>&rsquo;, when listing completions, Readline displays the
  128. common prefix of the set of possible completions using a different color.
  129. The color definitions are taken from the value of the <code>LS_COLORS</code>
  130. environment variable.
  131. The default is &lsquo;<samp>off</samp>&rsquo;.
  132. </p>
  133. </dd>
  134. <dt><code>colored-stats</code></dt>
  135. <dd><a name="index-colored_002dstats"></a>
  136. <p>If set to &lsquo;<samp>on</samp>&rsquo;, Readline displays possible completions using different
  137. colors to indicate their file type.
  138. The color definitions are taken from the value of the <code>LS_COLORS</code>
  139. environment variable.
  140. The default is &lsquo;<samp>off</samp>&rsquo;.
  141. </p>
  142. </dd>
  143. <dt><code>comment-begin</code></dt>
  144. <dd><a name="index-comment_002dbegin"></a>
  145. <p>The string to insert at the beginning of the line when the
  146. <code>insert-comment</code> command is executed. The default value
  147. is <code>&quot;#&quot;</code>.
  148. </p>
  149. </dd>
  150. <dt><code>completion-display-width</code></dt>
  151. <dd><a name="index-completion_002ddisplay_002dwidth"></a>
  152. <p>The number of screen columns used to display possible matches
  153. when performing completion.
  154. The value is ignored if it is less than 0 or greater than the terminal
  155. screen width.
  156. A value of 0 will cause matches to be displayed one per line.
  157. The default value is -1.
  158. </p>
  159. </dd>
  160. <dt><code>completion-ignore-case</code></dt>
  161. <dd><a name="index-completion_002dignore_002dcase"></a>
  162. <p>If set to &lsquo;<samp>on</samp>&rsquo;, Readline performs filename matching and completion
  163. in a case-insensitive fashion.
  164. The default value is &lsquo;<samp>off</samp>&rsquo;.
  165. </p>
  166. </dd>
  167. <dt><code>completion-map-case</code></dt>
  168. <dd><a name="index-completion_002dmap_002dcase"></a>
  169. <p>If set to &lsquo;<samp>on</samp>&rsquo;, and <var>completion-ignore-case</var> is enabled, Readline
  170. treats hyphens (&lsquo;<samp>-</samp>&rsquo;) and underscores (&lsquo;<samp>_</samp>&rsquo;) as equivalent when
  171. performing case-insensitive filename matching and completion.
  172. The default value is &lsquo;<samp>off</samp>&rsquo;.
  173. </p>
  174. </dd>
  175. <dt><code>completion-prefix-display-length</code></dt>
  176. <dd><a name="index-completion_002dprefix_002ddisplay_002dlength"></a>
  177. <p>The length in characters of the common prefix of a list of possible
  178. completions that is displayed without modification. When set to a
  179. value greater than zero, common prefixes longer than this value are
  180. replaced with an ellipsis when displaying possible completions.
  181. </p>
  182. </dd>
  183. <dt><code>completion-query-items</code></dt>
  184. <dd><a name="index-completion_002dquery_002ditems"></a>
  185. <p>The number of possible completions that determines when the user is
  186. asked whether the list of possibilities should be displayed.
  187. If the number of possible completions is greater than this value,
  188. Readline will ask the user whether or not he wishes to view
  189. them; otherwise, they are simply listed.
  190. This variable must be set to an integer value greater than or equal to 0.
  191. A negative value means Readline should never ask.
  192. The default limit is <code>100</code>.
  193. </p>
  194. </dd>
  195. <dt><code>convert-meta</code></dt>
  196. <dd><a name="index-convert_002dmeta"></a>
  197. <p>If set to &lsquo;<samp>on</samp>&rsquo;, Readline will convert characters with the
  198. eighth bit set to an <small>ASCII</small> key sequence by stripping the eighth
  199. bit and prefixing an <tt class="key">ESC</tt> character, converting them to a
  200. meta-prefixed key sequence. The default value is &lsquo;<samp>on</samp>&rsquo;, but
  201. will be set to &lsquo;<samp>off</samp>&rsquo; if the locale is one that contains
  202. eight-bit characters.
  203. </p>
  204. </dd>
  205. <dt><code>disable-completion</code></dt>
  206. <dd><a name="index-disable_002dcompletion"></a>
  207. <p>If set to &lsquo;<samp>On</samp>&rsquo;, Readline will inhibit word completion.
  208. Completion characters will be inserted into the line as if they had
  209. been mapped to <code>self-insert</code>. The default is &lsquo;<samp>off</samp>&rsquo;.
  210. </p>
  211. </dd>
  212. <dt><code>echo-control-characters</code></dt>
  213. <dd><a name="index-echo_002dcontrol_002dcharacters"></a>
  214. <p>When set to &lsquo;<samp>on</samp>&rsquo;, on operating systems that indicate they support it,
  215. readline echoes a character corresponding to a signal generated from the
  216. keyboard. The default is &lsquo;<samp>on</samp>&rsquo;.
  217. </p>
  218. </dd>
  219. <dt><code>editing-mode</code></dt>
  220. <dd><a name="index-editing_002dmode"></a>
  221. <p>The <code>editing-mode</code> variable controls which default set of
  222. key bindings is used. By default, Readline starts up in Emacs editing
  223. mode, where the keystrokes are most similar to Emacs. This variable can be
  224. set to either &lsquo;<samp>emacs</samp>&rsquo; or &lsquo;<samp>vi</samp>&rsquo;.
  225. </p>
  226. </dd>
  227. <dt><code>emacs-mode-string</code></dt>
  228. <dd><a name="index-emacs_002dmode_002dstring"></a>
  229. <p>If the <var>show-mode-in-prompt</var> variable is enabled,
  230. this string is displayed immediately before the last line of the primary
  231. prompt when emacs editing mode is active. The value is expanded like a
  232. key binding, so the standard set of meta- and control prefixes and
  233. backslash escape sequences is available.
  234. Use the &lsquo;<samp>\1</samp>&rsquo; and &lsquo;<samp>\2</samp>&rsquo; escapes to begin and end sequences of
  235. non-printing characters, which can be used to embed a terminal control
  236. sequence into the mode string.
  237. The default is &lsquo;<samp>@</samp>&rsquo;.
  238. </p>
  239. </dd>
  240. <dt><code>enable-bracketed-paste</code></dt>
  241. <dd><a name="index-enable_002dbracketed_002dpaste"></a>
  242. <p>When set to &lsquo;<samp>On</samp>&rsquo;, Readline will configure the terminal in a way
  243. that will enable it to insert each paste into the editing buffer as a
  244. single string of characters, instead of treating each character as if
  245. it had been read from the keyboard. This can prevent pasted characters
  246. from being interpreted as editing commands. The default is &lsquo;<samp>off</samp>&rsquo;.
  247. </p>
  248. </dd>
  249. <dt><code>enable-keypad</code></dt>
  250. <dd><a name="index-enable_002dkeypad"></a>
  251. <p>When set to &lsquo;<samp>on</samp>&rsquo;, Readline will try to enable the application
  252. keypad when it is called. Some systems need this to enable the
  253. arrow keys. The default is &lsquo;<samp>off</samp>&rsquo;.
  254. </p>
  255. </dd>
  256. <dt><code>enable-meta-key</code></dt>
  257. <dd><p>When set to &lsquo;<samp>on</samp>&rsquo;, Readline will try to enable any meta modifier
  258. key the terminal claims to support when it is called. On many terminals,
  259. the meta key is used to send eight-bit characters.
  260. The default is &lsquo;<samp>on</samp>&rsquo;.
  261. </p>
  262. </dd>
  263. <dt><code>expand-tilde</code></dt>
  264. <dd><a name="index-expand_002dtilde"></a>
  265. <p>If set to &lsquo;<samp>on</samp>&rsquo;, tilde expansion is performed when Readline
  266. attempts word completion. The default is &lsquo;<samp>off</samp>&rsquo;.
  267. </p>
  268. </dd>
  269. <dt><code>history-preserve-point</code></dt>
  270. <dd><a name="index-history_002dpreserve_002dpoint"></a>
  271. <p>If set to &lsquo;<samp>on</samp>&rsquo;, the history code attempts to place the point (the
  272. current cursor position) at the
  273. same location on each history line retrieved with <code>previous-history</code>
  274. or <code>next-history</code>. The default is &lsquo;<samp>off</samp>&rsquo;.
  275. </p>
  276. </dd>
  277. <dt><code>history-size</code></dt>
  278. <dd><a name="index-history_002dsize"></a>
  279. <p>Set the maximum number of history entries saved in the history list.
  280. If set to zero, any existing history entries are deleted and no new entries
  281. are saved.
  282. If set to a value less than zero, the number of history entries is not
  283. limited.
  284. By default, the number of history entries is not limited.
  285. If an attempt is made to set <var>history-size</var> to a non-numeric value,
  286. the maximum number of history entries will be set to 500.
  287. </p>
  288. </dd>
  289. <dt><code>horizontal-scroll-mode</code></dt>
  290. <dd><a name="index-horizontal_002dscroll_002dmode"></a>
  291. <p>This variable can be set to either &lsquo;<samp>on</samp>&rsquo; or &lsquo;<samp>off</samp>&rsquo;. Setting it
  292. to &lsquo;<samp>on</samp>&rsquo; means that the text of the lines being edited will scroll
  293. horizontally on a single screen line when they are longer than the width
  294. of the screen, instead of wrapping onto a new screen line. By default,
  295. this variable is set to &lsquo;<samp>off</samp>&rsquo;.
  296. </p>
  297. </dd>
  298. <dt><code>input-meta</code></dt>
  299. <dd><a name="index-input_002dmeta"></a>
  300. <a name="index-meta_002dflag"></a>
  301. <p>If set to &lsquo;<samp>on</samp>&rsquo;, Readline will enable eight-bit input (it
  302. will not clear the eighth bit in the characters it reads),
  303. regardless of what the terminal claims it can support. The
  304. default value is &lsquo;<samp>off</samp>&rsquo;, but Readline will set it to &lsquo;<samp>on</samp>&rsquo; if the
  305. locale contains eight-bit characters.
  306. The name <code>meta-flag</code> is a synonym for this variable.
  307. </p>
  308. </dd>
  309. <dt><code>isearch-terminators</code></dt>
  310. <dd><a name="index-isearch_002dterminators"></a>
  311. <p>The string of characters that should terminate an incremental search without
  312. subsequently executing the character as a command (see <a href="Searching.html#Searching">Searching</a>).
  313. If this variable has not been given a value, the characters <tt class="key">ESC</tt> and
  314. <kbd>C-J</kbd> will terminate an incremental search.
  315. </p>
  316. </dd>
  317. <dt><code>keymap</code></dt>
  318. <dd><a name="index-keymap"></a>
  319. <p>Sets Readline&rsquo;s idea of the current keymap for key binding commands.
  320. Built-in <code>keymap</code> names are
  321. <code>emacs</code>,
  322. <code>emacs-standard</code>,
  323. <code>emacs-meta</code>,
  324. <code>emacs-ctlx</code>,
  325. <code>vi</code>,
  326. <code>vi-move</code>,
  327. <code>vi-command</code>, and
  328. <code>vi-insert</code>.
  329. <code>vi</code> is equivalent to <code>vi-command</code> (<code>vi-move</code> is also a
  330. synonym); <code>emacs</code> is equivalent to <code>emacs-standard</code>.
  331. Applications may add additional names.
  332. The default value is <code>emacs</code>.
  333. The value of the <code>editing-mode</code> variable also affects the
  334. default keymap.
  335. </p>
  336. </dd>
  337. <dt><code>keyseq-timeout</code></dt>
  338. <dd><p>Specifies the duration Readline will wait for a character when reading an
  339. ambiguous key sequence (one that can form a complete key sequence using
  340. the input read so far, or can take additional input to complete a longer
  341. key sequence).
  342. If no input is received within the timeout, Readline will use the shorter
  343. but complete key sequence.
  344. Readline uses this value to determine whether or not input is
  345. available on the current input source (<code>rl_instream</code> by default).
  346. The value is specified in milliseconds, so a value of 1000 means that
  347. Readline will wait one second for additional input.
  348. If this variable is set to a value less than or equal to zero, or to a
  349. non-numeric value, Readline will wait until another key is pressed to
  350. decide which key sequence to complete.
  351. The default value is <code>500</code>.
  352. </p>
  353. </dd>
  354. <dt><code>mark-directories</code></dt>
  355. <dd><p>If set to &lsquo;<samp>on</samp>&rsquo;, completed directory names have a slash
  356. appended. The default is &lsquo;<samp>on</samp>&rsquo;.
  357. </p>
  358. </dd>
  359. <dt><code>mark-modified-lines</code></dt>
  360. <dd><a name="index-mark_002dmodified_002dlines"></a>
  361. <p>This variable, when set to &lsquo;<samp>on</samp>&rsquo;, causes Readline to display an
  362. asterisk (&lsquo;<samp>*</samp>&rsquo;) at the start of history lines which have been modified.
  363. This variable is &lsquo;<samp>off</samp>&rsquo; by default.
  364. </p>
  365. </dd>
  366. <dt><code>mark-symlinked-directories</code></dt>
  367. <dd><a name="index-mark_002dsymlinked_002ddirectories"></a>
  368. <p>If set to &lsquo;<samp>on</samp>&rsquo;, completed names which are symbolic links
  369. to directories have a slash appended (subject to the value of
  370. <code>mark-directories</code>).
  371. The default is &lsquo;<samp>off</samp>&rsquo;.
  372. </p>
  373. </dd>
  374. <dt><code>match-hidden-files</code></dt>
  375. <dd><a name="index-match_002dhidden_002dfiles"></a>
  376. <p>This variable, when set to &lsquo;<samp>on</samp>&rsquo;, causes Readline to match files whose
  377. names begin with a &lsquo;<samp>.</samp>&rsquo; (hidden files) when performing filename
  378. completion.
  379. If set to &lsquo;<samp>off</samp>&rsquo;, the leading &lsquo;<samp>.</samp>&rsquo; must be
  380. supplied by the user in the filename to be completed.
  381. This variable is &lsquo;<samp>on</samp>&rsquo; by default.
  382. </p>
  383. </dd>
  384. <dt><code>menu-complete-display-prefix</code></dt>
  385. <dd><a name="index-menu_002dcomplete_002ddisplay_002dprefix"></a>
  386. <p>If set to &lsquo;<samp>on</samp>&rsquo;, menu completion displays the common prefix of the
  387. list of possible completions (which may be empty) before cycling through
  388. the list. The default is &lsquo;<samp>off</samp>&rsquo;.
  389. </p>
  390. </dd>
  391. <dt><code>output-meta</code></dt>
  392. <dd><a name="index-output_002dmeta"></a>
  393. <p>If set to &lsquo;<samp>on</samp>&rsquo;, Readline will display characters with the
  394. eighth bit set directly rather than as a meta-prefixed escape
  395. sequence.
  396. The default is &lsquo;<samp>off</samp>&rsquo;, but Readline will set it to &lsquo;<samp>on</samp>&rsquo; if the
  397. locale contains eight-bit characters.
  398. </p>
  399. </dd>
  400. <dt><code>page-completions</code></dt>
  401. <dd><a name="index-page_002dcompletions"></a>
  402. <p>If set to &lsquo;<samp>on</samp>&rsquo;, Readline uses an internal <code>more</code>-like pager
  403. to display a screenful of possible completions at a time.
  404. This variable is &lsquo;<samp>on</samp>&rsquo; by default.
  405. </p>
  406. </dd>
  407. <dt><code>print-completions-horizontally</code></dt>
  408. <dd><p>If set to &lsquo;<samp>on</samp>&rsquo;, Readline will display completions with matches
  409. sorted horizontally in alphabetical order, rather than down the screen.
  410. The default is &lsquo;<samp>off</samp>&rsquo;.
  411. </p>
  412. </dd>
  413. <dt><code>revert-all-at-newline</code></dt>
  414. <dd><a name="index-revert_002dall_002dat_002dnewline"></a>
  415. <p>If set to &lsquo;<samp>on</samp>&rsquo;, Readline will undo all changes to history lines
  416. before returning when <code>accept-line</code> is executed. By default,
  417. history lines may be modified and retain individual undo lists across
  418. calls to <code>readline</code>. The default is &lsquo;<samp>off</samp>&rsquo;.
  419. </p>
  420. </dd>
  421. <dt><code>show-all-if-ambiguous</code></dt>
  422. <dd><a name="index-show_002dall_002dif_002dambiguous"></a>
  423. <p>This alters the default behavior of the completion functions. If
  424. set to &lsquo;<samp>on</samp>&rsquo;,
  425. words which have more than one possible completion cause the
  426. matches to be listed immediately instead of ringing the bell.
  427. The default value is &lsquo;<samp>off</samp>&rsquo;.
  428. </p>
  429. </dd>
  430. <dt><code>show-all-if-unmodified</code></dt>
  431. <dd><a name="index-show_002dall_002dif_002dunmodified"></a>
  432. <p>This alters the default behavior of the completion functions in
  433. a fashion similar to <var>show-all-if-ambiguous</var>.
  434. If set to &lsquo;<samp>on</samp>&rsquo;,
  435. words which have more than one possible completion without any
  436. possible partial completion (the possible completions don&rsquo;t share
  437. a common prefix) cause the matches to be listed immediately instead
  438. of ringing the bell.
  439. The default value is &lsquo;<samp>off</samp>&rsquo;.
  440. </p>
  441. </dd>
  442. <dt><code>show-mode-in-prompt</code></dt>
  443. <dd><a name="index-show_002dmode_002din_002dprompt"></a>
  444. <p>If set to &lsquo;<samp>on</samp>&rsquo;, add a string to the beginning of the prompt
  445. indicating the editing mode: emacs, vi command, or vi insertion.
  446. The mode strings are user-settable (e.g., <var>emacs-mode-string</var>).
  447. The default value is &lsquo;<samp>off</samp>&rsquo;.
  448. </p>
  449. </dd>
  450. <dt><code>skip-completed-text</code></dt>
  451. <dd><a name="index-skip_002dcompleted_002dtext"></a>
  452. <p>If set to &lsquo;<samp>on</samp>&rsquo;, this alters the default completion behavior when
  453. inserting a single match into the line. It&rsquo;s only active when
  454. performing completion in the middle of a word. If enabled, readline
  455. does not insert characters from the completion that match characters
  456. after point in the word being completed, so portions of the word
  457. following the cursor are not duplicated.
  458. For instance, if this is enabled, attempting completion when the cursor
  459. is after the &lsquo;<samp>e</samp>&rsquo; in &lsquo;<samp>Makefile</samp>&rsquo; will result in &lsquo;<samp>Makefile</samp>&rsquo;
  460. rather than &lsquo;<samp>Makefilefile</samp>&rsquo;, assuming there is a single possible
  461. completion.
  462. The default value is &lsquo;<samp>off</samp>&rsquo;.
  463. </p>
  464. </dd>
  465. <dt><code>vi-cmd-mode-string</code></dt>
  466. <dd><a name="index-vi_002dcmd_002dmode_002dstring"></a>
  467. <p>If the <var>show-mode-in-prompt</var> variable is enabled,
  468. this string is displayed immediately before the last line of the primary
  469. prompt when vi editing mode is active and in command mode.
  470. The value is expanded like a
  471. key binding, so the standard set of meta- and control prefixes and
  472. backslash escape sequences is available.
  473. Use the &lsquo;<samp>\1</samp>&rsquo; and &lsquo;<samp>\2</samp>&rsquo; escapes to begin and end sequences of
  474. non-printing characters, which can be used to embed a terminal control
  475. sequence into the mode string.
  476. The default is &lsquo;<samp>(cmd)</samp>&rsquo;.
  477. </p>
  478. </dd>
  479. <dt><code>vi-ins-mode-string</code></dt>
  480. <dd><a name="index-vi_002dins_002dmode_002dstring"></a>
  481. <p>If the <var>show-mode-in-prompt</var> variable is enabled,
  482. this string is displayed immediately before the last line of the primary
  483. prompt when vi editing mode is active and in insertion mode.
  484. The value is expanded like a
  485. key binding, so the standard set of meta- and control prefixes and
  486. backslash escape sequences is available.
  487. Use the &lsquo;<samp>\1</samp>&rsquo; and &lsquo;<samp>\2</samp>&rsquo; escapes to begin and end sequences of
  488. non-printing characters, which can be used to embed a terminal control
  489. sequence into the mode string.
  490. The default is &lsquo;<samp>(ins)</samp>&rsquo;.
  491. </p>
  492. </dd>
  493. <dt><code>visible-stats</code></dt>
  494. <dd><a name="index-visible_002dstats"></a>
  495. <p>If set to &lsquo;<samp>on</samp>&rsquo;, a character denoting a file&rsquo;s type
  496. is appended to the filename when listing possible
  497. completions. The default is &lsquo;<samp>off</samp>&rsquo;.
  498. </p>
  499. </dd>
  500. </dl>
  501. </dd>
  502. <dt>Key Bindings</dt>
  503. <dd><p>The syntax for controlling key bindings in the init file is
  504. simple. First you need to find the name of the command that you
  505. want to change. The following sections contain tables of the command
  506. name, the default keybinding, if any, and a short description of what
  507. the command does.
  508. </p>
  509. <p>Once you know the name of the command, simply place on a line
  510. in the init file the name of the key
  511. you wish to bind the command to, a colon, and then the name of the
  512. command.
  513. There can be no space between the key name and the colon &ndash; that will be
  514. interpreted as part of the key name.
  515. The name of the key can be expressed in different ways, depending on
  516. what you find most comfortable.
  517. </p>
  518. <p>In addition to command names, readline allows keys to be bound
  519. to a string that is inserted when the key is pressed (a <var>macro</var>).
  520. </p>
  521. <dl compact="compact">
  522. <dt><var>keyname</var>:&nbsp;<var><span class="nolinebreak">function-name</span></var>&nbsp;or&nbsp;<var>macro</var><!-- /@w --></dt>
  523. <dd><p><var>keyname</var> is the name of a key spelled out in English. For example:
  524. </p><div class="example">
  525. <pre class="example">Control-u: universal-argument
  526. Meta-Rubout: backward-kill-word
  527. Control-o: &quot;&gt; output&quot;
  528. </pre></div>
  529. <p>In the example above, <kbd>C-u</kbd> is bound to the function
  530. <code>universal-argument</code>,
  531. <kbd>M-DEL</kbd> is bound to the function <code>backward-kill-word</code>, and
  532. <kbd>C-o</kbd> is bound to run the macro
  533. expressed on the right hand side (that is, to insert the text
  534. &lsquo;<samp>&gt; output</samp>&rsquo; into the line).
  535. </p>
  536. <p>A number of symbolic character names are recognized while
  537. processing this key binding syntax:
  538. <var>DEL</var>,
  539. <var>ESC</var>,
  540. <var>ESCAPE</var>,
  541. <var>LFD</var>,
  542. <var>NEWLINE</var>,
  543. <var>RET</var>,
  544. <var>RETURN</var>,
  545. <var>RUBOUT</var>,
  546. <var>SPACE</var>,
  547. <var>SPC</var>,
  548. and
  549. <var>TAB</var>.
  550. </p>
  551. </dd>
  552. <dt>&quot;<var>keyseq</var>&quot;:&nbsp;<var><span class="nolinebreak">function-name</span></var>&nbsp;or&nbsp;<var>macro</var><!-- /@w --></dt>
  553. <dd><p><var>keyseq</var> differs from <var>keyname</var> above in that strings
  554. denoting an entire key sequence can be specified, by placing
  555. the key sequence in double quotes. Some <small>GNU</small> Emacs style key
  556. escapes can be used, as in the following example, but the
  557. special character names are not recognized.
  558. </p>
  559. <div class="example">
  560. <pre class="example">&quot;\C-u&quot;: universal-argument
  561. &quot;\C-x\C-r&quot;: re-read-init-file
  562. &quot;\e[11~&quot;: &quot;Function Key 1&quot;
  563. </pre></div>
  564. <p>In the above example, <kbd>C-u</kbd> is again bound to the function
  565. <code>universal-argument</code> (just as it was in the first example),
  566. &lsquo;<samp><kbd>C-x</kbd> <kbd>C-r</kbd></samp>&rsquo; is bound to the function <code>re-read-init-file</code>,
  567. and &lsquo;<samp><span class="key">ESC</span> <span class="key">[</span> <span class="key">1</span> <span class="key">1</span> <span class="key">~</span></samp>&rsquo; is bound to insert
  568. the text &lsquo;<samp>Function Key 1</samp>&rsquo;.
  569. </p>
  570. </dd>
  571. </dl>
  572. <p>The following <small>GNU</small> Emacs style escape sequences are available when
  573. specifying key sequences:
  574. </p>
  575. <dl compact="compact">
  576. <dt><code><kbd>\C-</kbd></code></dt>
  577. <dd><p>control prefix
  578. </p></dd>
  579. <dt><code><kbd>\M-</kbd></code></dt>
  580. <dd><p>meta prefix
  581. </p></dd>
  582. <dt><code><kbd>\e</kbd></code></dt>
  583. <dd><p>an escape character
  584. </p></dd>
  585. <dt><code><kbd>\\</kbd></code></dt>
  586. <dd><p>backslash
  587. </p></dd>
  588. <dt><code><kbd>\&quot;</kbd></code></dt>
  589. <dd><p><tt class="key">&quot;</tt>, a double quotation mark
  590. </p></dd>
  591. <dt><code><kbd>\'</kbd></code></dt>
  592. <dd><p><tt class="key">'</tt>, a single quote or apostrophe
  593. </p></dd>
  594. </dl>
  595. <p>In addition to the <small>GNU</small> Emacs style escape sequences, a second
  596. set of backslash escapes is available:
  597. </p>
  598. <dl compact="compact">
  599. <dt><code>\a</code></dt>
  600. <dd><p>alert (bell)
  601. </p></dd>
  602. <dt><code>\b</code></dt>
  603. <dd><p>backspace
  604. </p></dd>
  605. <dt><code>\d</code></dt>
  606. <dd><p>delete
  607. </p></dd>
  608. <dt><code>\f</code></dt>
  609. <dd><p>form feed
  610. </p></dd>
  611. <dt><code>\n</code></dt>
  612. <dd><p>newline
  613. </p></dd>
  614. <dt><code>\r</code></dt>
  615. <dd><p>carriage return
  616. </p></dd>
  617. <dt><code>\t</code></dt>
  618. <dd><p>horizontal tab
  619. </p></dd>
  620. <dt><code>\v</code></dt>
  621. <dd><p>vertical tab
  622. </p></dd>
  623. <dt><code>\<var>nnn</var></code></dt>
  624. <dd><p>the eight-bit character whose value is the octal value <var>nnn</var>
  625. (one to three digits)
  626. </p></dd>
  627. <dt><code>\x<var>HH</var></code></dt>
  628. <dd><p>the eight-bit character whose value is the hexadecimal value <var>HH</var>
  629. (one or two hex digits)
  630. </p></dd>
  631. </dl>
  632. <p>When entering the text of a macro, single or double quotes must
  633. be used to indicate a macro definition.
  634. Unquoted text is assumed to be a function name.
  635. In the macro body, the backslash escapes described above are expanded.
  636. Backslash will quote any other character in the macro text,
  637. including &lsquo;<samp>&quot;</samp>&rsquo; and &lsquo;<samp>'</samp>&rsquo;.
  638. For example, the following binding will make &lsquo;<samp><kbd>C-x</kbd> \</samp>&rsquo;
  639. insert a single &lsquo;<samp>\</samp>&rsquo; into the line:
  640. </p><div class="example">
  641. <pre class="example">&quot;\C-x\\&quot;: &quot;\\&quot;
  642. </pre></div>
  643. </dd>
  644. </dl>
  645. <hr>
  646. <div class="header">
  647. <p>
  648. Next: <a href="Conditional-Init-Constructs.html#Conditional-Init-Constructs" accesskey="n" rel="next">Conditional Init Constructs</a>, Up: <a href="Readline-Init-File.html#Readline-Init-File" accesskey="u" rel="up">Readline Init File</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
  649. </div>
  650. </body>
  651. </html>