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