You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Readline-Init-File-Syntax.html 29KB

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