| 1.\" $FreeBSD: head/contrib/libreadline/doc/readline.3 157188 2006-03-27 23:11:32Z ache $
|
1.\" 2.\" MAN PAGE COMMENTS to 3.\" 4.\" Chet Ramey 5.\" Information Network Services 6.\" Case Western Reserve University 7.\" chet@ins.CWRU.Edu 8.\"
| 2.\" 3.\" MAN PAGE COMMENTS to 4.\" 5.\" Chet Ramey 6.\" Information Network Services 7.\" Case Western Reserve University 8.\" chet@ins.CWRU.Edu 9.\"
|
9.\" Last Change: Wed Jan 28 15:43:53 EST 2004
| 10.\" Last Change: Tue Sep 13 12:07:26 EDT 2005
|
10.\"
| 11.\"
|
11.TH READLINE 3 "2004 January 28" "GNU Readline 5.0"
| 12.TH READLINE 3 "2005 Sep 13" "GNU Readline 5.1-beta1"
|
12.\" 13.\" File Name macro. This used to be `.PN', for Path Name, 14.\" but Sun doesn't seem to like that very much.
| 13.\" 14.\" File Name macro. This used to be `.PN', for Path Name, 15.\" but Sun doesn't seem to like that very much.
|
15.\" $FreeBSD: head/contrib/libreadline/doc/readline.3 136758 2004-10-21 20:02:02Z peter $
| |
16.\" 17.de FN 18\fI\|\\$1\|\fP 19.. 20.SH NAME 21readline \- get a line from a user with editing 22.SH SYNOPSIS 23.LP 24.nf 25.ft B 26#include <stdio.h> 27#include <readline/readline.h> 28#include <readline/history.h> 29.ft 30.fi 31.LP 32.nf 33\fIchar *\fP 34.br 35\fBreadline\fP (\fIconst char *prompt\fP); 36.fi 37.SH COPYRIGHT 38.if n Readline is Copyright (C) 1989\-2004 by the Free Software Foundation, Inc. 39.if t Readline is Copyright \(co 1989\-2004 by the Free Software Foundation, Inc. 40.SH DESCRIPTION 41.LP 42.B readline 43will read a line from the terminal 44and return it, using 45.B prompt 46as a prompt. If 47.B prompt 48is \fBNULL\fP or the empty string, no prompt is issued. 49The line returned is allocated with 50.IR malloc (3); 51the caller must free it when finished. The line returned 52has the final newline removed, so only the text of the line 53remains. 54.LP 55.B readline 56offers editing capabilities while the user is entering the 57line. 58By default, the line editing commands 59are similar to those of emacs. 60A vi\-style line editing interface is also available. 61.LP 62This manual page describes only the most basic use of \fBreadline\fP. 63Much more functionality is available; see 64\fIThe GNU Readline Library\fP and \fIThe GNU History Library\fP 65for additional information. 66.SH RETURN VALUE 67.LP 68.B readline 69returns the text of the line read. A blank line 70returns the empty string. If 71.B EOF 72is encountered while reading a line, and the line is empty, 73.B NULL 74is returned. If an 75.B EOF 76is read with a non\-empty line, it is 77treated as a newline. 78.SH NOTATION 79.LP 80An emacs-style notation is used to denote 81keystrokes. Control keys are denoted by C\-\fIkey\fR, e.g., C\-n 82means Control\-N. Similarly, 83.I meta 84keys are denoted by M\-\fIkey\fR, so M\-x means Meta\-X. (On keyboards 85without a 86.I meta 87key, M\-\fIx\fP means ESC \fIx\fP, i.e., press the Escape key 88then the 89.I x 90key. This makes ESC the \fImeta prefix\fP. 91The combination M\-C\-\fIx\fP means ESC\-Control\-\fIx\fP, 92or press the Escape key 93then hold the Control key while pressing the 94.I x 95key.) 96.PP 97Readline commands may be given numeric 98.IR arguments , 99which normally act as a repeat count. Sometimes, however, it is the 100sign of the argument that is significant. Passing a negative argument 101to a command that acts in the forward direction (e.g., \fBkill\-line\fP) 102causes that command to act in a backward direction. Commands whose 103behavior with arguments deviates from this are noted. 104.PP 105When a command is described as \fIkilling\fP text, the text 106deleted is saved for possible future retrieval 107(\fIyanking\fP). The killed text is saved in a 108\fIkill ring\fP. Consecutive kills cause the text to be 109accumulated into one unit, which can be yanked all at once. 110Commands which do not kill text separate the chunks of text 111on the kill ring. 112.SH INITIALIZATION FILE 113.LP 114Readline is customized by putting commands in an initialization 115file (the \fIinputrc\fP file). 116The name of this file is taken from the value of the 117.B INPUTRC 118environment variable. If that variable is unset, the default is 119.IR ~/.inputrc . 120When a program which uses the readline library starts up, the 121init file is read, and the key bindings and variables are set. 122There are only a few basic constructs allowed in the 123readline init file. Blank lines are ignored. 124Lines beginning with a \fB#\fP are comments. 125Lines beginning with a \fB$\fP indicate conditional constructs. 126Other lines denote key bindings and variable settings. 127Each program using this library may add its own commands 128and bindings. 129.PP 130For example, placing 131.RS 132.PP 133M\-Control\-u: universal\-argument 134.RE 135or 136.RS 137C\-Meta\-u: universal\-argument 138.RE 139.sp 140into the 141.I inputrc 142would make M\-C\-u execute the readline command 143.IR universal\-argument . 144.PP 145The following symbolic character names are recognized while 146processing key bindings: 147.IR DEL , 148.IR ESC , 149.IR ESCAPE , 150.IR LFD , 151.IR NEWLINE , 152.IR RET , 153.IR RETURN , 154.IR RUBOUT , 155.IR SPACE , 156.IR SPC , 157and 158.IR TAB . 159.PP 160In addition to command names, readline allows keys to be bound 161to a string that is inserted when the key is pressed (a \fImacro\fP). 162.PP 163.SS Key Bindings 164.PP 165The syntax for controlling key bindings in the 166.I inputrc 167file is simple. All that is required is the name of the 168command or the text of a macro and a key sequence to which 169it should be bound. The name may be specified in one of two ways: 170as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP 171prefixes, or as a key sequence. 172.PP 173When using the form \fBkeyname\fP:\^\fIfunction-name\fP or \fImacro\fP, 174.I keyname 175is the name of a key spelled out in English. For example: 176.sp 177.RS 178Control\-u: universal\-argument 179.br 180Meta\-Rubout: backward\-kill\-word 181.br 182Control\-o: "> output" 183.RE 184.LP 185In the above example, 186.I C\-u 187is bound to the function 188.BR universal\-argument , 189.I M-DEL 190is bound to the function 191.BR backward\-kill\-word , 192and 193.I C\-o 194is bound to run the macro 195expressed on the right hand side (that is, to insert the text 196.if t \f(CW> output\fP 197.if n ``> output'' 198into the line). 199.PP 200In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP, 201.B keyseq 202differs from 203.B keyname 204above in that strings denoting 205an entire key sequence may be specified by placing the sequence 206within double quotes. Some GNU Emacs style key escapes can be 207used, as in the following example, but the symbolic character names 208are not recognized. 209.sp 210.RS 211"\eC\-u": universal\-argument 212.br 213"\eC\-x\eC\-r": re\-read\-init\-file 214.br 215"\ee[11~": "Function Key 1" 216.RE 217.PP 218In this example, 219.I C-u 220is again bound to the function 221.BR universal\-argument . 222.I "C-x C-r" 223is bound to the function 224.BR re\-read\-init\-file , 225and 226.I "ESC [ 1 1 ~" 227is bound to insert the text 228.if t \f(CWFunction Key 1\fP. 229.if n ``Function Key 1''. 230.PP 231The full set of GNU Emacs style escape sequences available when specifying 232key sequences is 233.RS 234.PD 0 235.TP 236.B \eC\- 237control prefix 238.TP 239.B \eM\- 240meta prefix 241.TP 242.B \ee 243an escape character 244.TP 245.B \e\e 246backslash 247.TP 248.B \e" 249literal ", a double quote 250.TP 251.B \e' 252literal ', a single quote 253.RE 254.PD 255.PP 256In addition to the GNU Emacs style escape sequences, a second 257set of backslash escapes is available: 258.RS 259.PD 0 260.TP 261.B \ea 262alert (bell) 263.TP 264.B \eb 265backspace 266.TP 267.B \ed 268delete 269.TP 270.B \ef 271form feed 272.TP 273.B \en 274newline 275.TP 276.B \er 277carriage return 278.TP 279.B \et 280horizontal tab 281.TP 282.B \ev 283vertical tab 284.TP 285.B \e\fInnn\fP 286the eight-bit character whose value is the octal value \fInnn\fP 287(one to three digits) 288.TP 289.B \ex\fIHH\fP 290the eight-bit character whose value is the hexadecimal value \fIHH\fP 291(one or two hex digits) 292.RE 293.PD 294.PP 295When entering the text of a macro, single or double quotes should 296be used to indicate a macro definition. Unquoted text 297is assumed to be a function name. 298In the macro body, the backslash escapes described above are expanded. 299Backslash will quote any other character in the macro text, 300including " and '. 301.PP 302.B Bash 303allows the current readline key bindings to be displayed or modified 304with the 305.B bind 306builtin command. The editing mode may be switched during interactive 307use by using the 308.B \-o 309option to the 310.B set 311builtin command. Other programs using this library provide 312similar mechanisms. The 313.I inputrc 314file may be edited and re-read if a program does not provide 315any other means to incorporate new bindings. 316.SS Variables 317.PP 318Readline has variables that can be used to further customize its 319behavior. A variable may be set in the 320.I inputrc 321file with a statement of the form 322.RS 323.PP 324\fBset\fP \fIvariable\-name\fP \fIvalue\fP 325.RE 326.PP 327Except where noted, readline variables can take the values 328.B On 329or 330.B Off 331(without regard to case).
| 16.\" 17.de FN 18\fI\|\\$1\|\fP 19.. 20.SH NAME 21readline \- get a line from a user with editing 22.SH SYNOPSIS 23.LP 24.nf 25.ft B 26#include <stdio.h> 27#include <readline/readline.h> 28#include <readline/history.h> 29.ft 30.fi 31.LP 32.nf 33\fIchar *\fP 34.br 35\fBreadline\fP (\fIconst char *prompt\fP); 36.fi 37.SH COPYRIGHT 38.if n Readline is Copyright (C) 1989\-2004 by the Free Software Foundation, Inc. 39.if t Readline is Copyright \(co 1989\-2004 by the Free Software Foundation, Inc. 40.SH DESCRIPTION 41.LP 42.B readline 43will read a line from the terminal 44and return it, using 45.B prompt 46as a prompt. If 47.B prompt 48is \fBNULL\fP or the empty string, no prompt is issued. 49The line returned is allocated with 50.IR malloc (3); 51the caller must free it when finished. The line returned 52has the final newline removed, so only the text of the line 53remains. 54.LP 55.B readline 56offers editing capabilities while the user is entering the 57line. 58By default, the line editing commands 59are similar to those of emacs. 60A vi\-style line editing interface is also available. 61.LP 62This manual page describes only the most basic use of \fBreadline\fP. 63Much more functionality is available; see 64\fIThe GNU Readline Library\fP and \fIThe GNU History Library\fP 65for additional information. 66.SH RETURN VALUE 67.LP 68.B readline 69returns the text of the line read. A blank line 70returns the empty string. If 71.B EOF 72is encountered while reading a line, and the line is empty, 73.B NULL 74is returned. If an 75.B EOF 76is read with a non\-empty line, it is 77treated as a newline. 78.SH NOTATION 79.LP 80An emacs-style notation is used to denote 81keystrokes. Control keys are denoted by C\-\fIkey\fR, e.g., C\-n 82means Control\-N. Similarly, 83.I meta 84keys are denoted by M\-\fIkey\fR, so M\-x means Meta\-X. (On keyboards 85without a 86.I meta 87key, M\-\fIx\fP means ESC \fIx\fP, i.e., press the Escape key 88then the 89.I x 90key. This makes ESC the \fImeta prefix\fP. 91The combination M\-C\-\fIx\fP means ESC\-Control\-\fIx\fP, 92or press the Escape key 93then hold the Control key while pressing the 94.I x 95key.) 96.PP 97Readline commands may be given numeric 98.IR arguments , 99which normally act as a repeat count. Sometimes, however, it is the 100sign of the argument that is significant. Passing a negative argument 101to a command that acts in the forward direction (e.g., \fBkill\-line\fP) 102causes that command to act in a backward direction. Commands whose 103behavior with arguments deviates from this are noted. 104.PP 105When a command is described as \fIkilling\fP text, the text 106deleted is saved for possible future retrieval 107(\fIyanking\fP). The killed text is saved in a 108\fIkill ring\fP. Consecutive kills cause the text to be 109accumulated into one unit, which can be yanked all at once. 110Commands which do not kill text separate the chunks of text 111on the kill ring. 112.SH INITIALIZATION FILE 113.LP 114Readline is customized by putting commands in an initialization 115file (the \fIinputrc\fP file). 116The name of this file is taken from the value of the 117.B INPUTRC 118environment variable. If that variable is unset, the default is 119.IR ~/.inputrc . 120When a program which uses the readline library starts up, the 121init file is read, and the key bindings and variables are set. 122There are only a few basic constructs allowed in the 123readline init file. Blank lines are ignored. 124Lines beginning with a \fB#\fP are comments. 125Lines beginning with a \fB$\fP indicate conditional constructs. 126Other lines denote key bindings and variable settings. 127Each program using this library may add its own commands 128and bindings. 129.PP 130For example, placing 131.RS 132.PP 133M\-Control\-u: universal\-argument 134.RE 135or 136.RS 137C\-Meta\-u: universal\-argument 138.RE 139.sp 140into the 141.I inputrc 142would make M\-C\-u execute the readline command 143.IR universal\-argument . 144.PP 145The following symbolic character names are recognized while 146processing key bindings: 147.IR DEL , 148.IR ESC , 149.IR ESCAPE , 150.IR LFD , 151.IR NEWLINE , 152.IR RET , 153.IR RETURN , 154.IR RUBOUT , 155.IR SPACE , 156.IR SPC , 157and 158.IR TAB . 159.PP 160In addition to command names, readline allows keys to be bound 161to a string that is inserted when the key is pressed (a \fImacro\fP). 162.PP 163.SS Key Bindings 164.PP 165The syntax for controlling key bindings in the 166.I inputrc 167file is simple. All that is required is the name of the 168command or the text of a macro and a key sequence to which 169it should be bound. The name may be specified in one of two ways: 170as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP 171prefixes, or as a key sequence. 172.PP 173When using the form \fBkeyname\fP:\^\fIfunction-name\fP or \fImacro\fP, 174.I keyname 175is the name of a key spelled out in English. For example: 176.sp 177.RS 178Control\-u: universal\-argument 179.br 180Meta\-Rubout: backward\-kill\-word 181.br 182Control\-o: "> output" 183.RE 184.LP 185In the above example, 186.I C\-u 187is bound to the function 188.BR universal\-argument , 189.I M-DEL 190is bound to the function 191.BR backward\-kill\-word , 192and 193.I C\-o 194is bound to run the macro 195expressed on the right hand side (that is, to insert the text 196.if t \f(CW> output\fP 197.if n ``> output'' 198into the line). 199.PP 200In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP, 201.B keyseq 202differs from 203.B keyname 204above in that strings denoting 205an entire key sequence may be specified by placing the sequence 206within double quotes. Some GNU Emacs style key escapes can be 207used, as in the following example, but the symbolic character names 208are not recognized. 209.sp 210.RS 211"\eC\-u": universal\-argument 212.br 213"\eC\-x\eC\-r": re\-read\-init\-file 214.br 215"\ee[11~": "Function Key 1" 216.RE 217.PP 218In this example, 219.I C-u 220is again bound to the function 221.BR universal\-argument . 222.I "C-x C-r" 223is bound to the function 224.BR re\-read\-init\-file , 225and 226.I "ESC [ 1 1 ~" 227is bound to insert the text 228.if t \f(CWFunction Key 1\fP. 229.if n ``Function Key 1''. 230.PP 231The full set of GNU Emacs style escape sequences available when specifying 232key sequences is 233.RS 234.PD 0 235.TP 236.B \eC\- 237control prefix 238.TP 239.B \eM\- 240meta prefix 241.TP 242.B \ee 243an escape character 244.TP 245.B \e\e 246backslash 247.TP 248.B \e" 249literal ", a double quote 250.TP 251.B \e' 252literal ', a single quote 253.RE 254.PD 255.PP 256In addition to the GNU Emacs style escape sequences, a second 257set of backslash escapes is available: 258.RS 259.PD 0 260.TP 261.B \ea 262alert (bell) 263.TP 264.B \eb 265backspace 266.TP 267.B \ed 268delete 269.TP 270.B \ef 271form feed 272.TP 273.B \en 274newline 275.TP 276.B \er 277carriage return 278.TP 279.B \et 280horizontal tab 281.TP 282.B \ev 283vertical tab 284.TP 285.B \e\fInnn\fP 286the eight-bit character whose value is the octal value \fInnn\fP 287(one to three digits) 288.TP 289.B \ex\fIHH\fP 290the eight-bit character whose value is the hexadecimal value \fIHH\fP 291(one or two hex digits) 292.RE 293.PD 294.PP 295When entering the text of a macro, single or double quotes should 296be used to indicate a macro definition. Unquoted text 297is assumed to be a function name. 298In the macro body, the backslash escapes described above are expanded. 299Backslash will quote any other character in the macro text, 300including " and '. 301.PP 302.B Bash 303allows the current readline key bindings to be displayed or modified 304with the 305.B bind 306builtin command. The editing mode may be switched during interactive 307use by using the 308.B \-o 309option to the 310.B set 311builtin command. Other programs using this library provide 312similar mechanisms. The 313.I inputrc 314file may be edited and re-read if a program does not provide 315any other means to incorporate new bindings. 316.SS Variables 317.PP 318Readline has variables that can be used to further customize its 319behavior. A variable may be set in the 320.I inputrc 321file with a statement of the form 322.RS 323.PP 324\fBset\fP \fIvariable\-name\fP \fIvalue\fP 325.RE 326.PP 327Except where noted, readline variables can take the values 328.B On 329or 330.B Off 331(without regard to case).
|
| 332Unrecognized variable names are ignored. 333When a variable value is read, empty or null values, "on" (case-insensitive), 334and "1" are equivalent to \fBOn\fP. All other values are equivalent to 335\fBOff\fP.
|
332The variables and their default values are: 333.PP 334.PD 0 335.TP 336.B bell\-style (audible) 337Controls what happens when readline wants to ring the terminal bell. 338If set to \fBnone\fP, readline never rings the bell. If set to 339\fBvisible\fP, readline uses a visible bell if one is available. 340If set to \fBaudible\fP, readline attempts to ring the terminal's bell. 341.TP
| 336The variables and their default values are: 337.PP 338.PD 0 339.TP 340.B bell\-style (audible) 341Controls what happens when readline wants to ring the terminal bell. 342If set to \fBnone\fP, readline never rings the bell. If set to 343\fBvisible\fP, readline uses a visible bell if one is available. 344If set to \fBaudible\fP, readline attempts to ring the terminal's bell. 345.TP
|
| 346.B bind\-tty\-special\-chars (On) 347If set to \fBOn\fP, readline attempts to bind the control characters 348treated specially by the kernel's terminal driver to their readline 349equivalents. 350.TP
|
342.B comment\-begin (``#'') 343The string that is inserted in \fBvi\fP mode when the 344.B insert\-comment 345command is executed. 346This command is bound to 347.B M\-# 348in emacs mode and to 349.B # 350in vi command mode. 351.TP 352.B completion\-ignore\-case (Off) 353If set to \fBOn\fP, readline performs filename matching and completion 354in a case\-insensitive fashion. 355.TP 356.B completion\-query\-items (100) 357This determines when the user is queried about viewing 358the number of possible completions 359generated by the \fBpossible\-completions\fP command. 360It may be set to any integer value greater than or equal to 361zero. If the number of possible completions is greater than 362or equal to the value of this variable, the user is asked whether 363or not he wishes to view them; otherwise they are simply listed
| 351.B comment\-begin (``#'') 352The string that is inserted in \fBvi\fP mode when the 353.B insert\-comment 354command is executed. 355This command is bound to 356.B M\-# 357in emacs mode and to 358.B # 359in vi command mode. 360.TP 361.B completion\-ignore\-case (Off) 362If set to \fBOn\fP, readline performs filename matching and completion 363in a case\-insensitive fashion. 364.TP 365.B completion\-query\-items (100) 366This determines when the user is queried about viewing 367the number of possible completions 368generated by the \fBpossible\-completions\fP command. 369It may be set to any integer value greater than or equal to 370zero. If the number of possible completions is greater than 371or equal to the value of this variable, the user is asked whether 372or not he wishes to view them; otherwise they are simply listed
|
364on the terminal.
| 373on the terminal. A negative value causes readline to never ask.
|
365.TP 366.B convert\-meta (On) 367If set to \fBOn\fP, readline will convert characters with the 368eighth bit set to an ASCII key sequence 369by stripping the eighth bit and prefixing it with an 370escape character (in effect, using escape as the \fImeta prefix\fP). 371.TP 372.B disable\-completion (Off) 373If set to \fBOn\fP, readline will inhibit word completion. Completion 374characters will be inserted into the line as if they had been 375mapped to \fBself-insert\fP. 376.TP 377.B editing\-mode (emacs) 378Controls whether readline begins with a set of key bindings similar 379to emacs or vi. 380.B editing\-mode 381can be set to either 382.B emacs 383or 384.BR vi . 385.TP 386.B enable\-keypad (Off) 387When set to \fBOn\fP, readline will try to enable the application 388keypad when it is called. Some systems need this to enable the 389arrow keys. 390.TP 391.B expand\-tilde (Off) 392If set to \fBon\fP, tilde expansion is performed when readline 393attempts word completion. 394.TP
| 374.TP 375.B convert\-meta (On) 376If set to \fBOn\fP, readline will convert characters with the 377eighth bit set to an ASCII key sequence 378by stripping the eighth bit and prefixing it with an 379escape character (in effect, using escape as the \fImeta prefix\fP). 380.TP 381.B disable\-completion (Off) 382If set to \fBOn\fP, readline will inhibit word completion. Completion 383characters will be inserted into the line as if they had been 384mapped to \fBself-insert\fP. 385.TP 386.B editing\-mode (emacs) 387Controls whether readline begins with a set of key bindings similar 388to emacs or vi. 389.B editing\-mode 390can be set to either 391.B emacs 392or 393.BR vi . 394.TP 395.B enable\-keypad (Off) 396When set to \fBOn\fP, readline will try to enable the application 397keypad when it is called. Some systems need this to enable the 398arrow keys. 399.TP 400.B expand\-tilde (Off) 401If set to \fBon\fP, tilde expansion is performed when readline 402attempts word completion. 403.TP
|
395.B history-preserve-point
| 404.B history\-preserve\-point (Off)
|
396If set to \fBon\fP, the history code attempts to place point at the
| 405If set to \fBon\fP, the history code attempts to place point at the
|
397same location on each history line retrived with \fBprevious-history\fP
| 406same location on each history line retrieved with \fBprevious-history\fP
|
398or \fBnext-history\fP. 399.TP 400.B horizontal\-scroll\-mode (Off) 401When set to \fBOn\fP, makes readline use a single line for display, 402scrolling the input horizontally on a single screen line when it 403becomes longer than the screen width rather than wrapping to a new line. 404.TP 405.B input\-meta (Off) 406If set to \fBOn\fP, readline will enable eight-bit input (that is, 407it will not clear the eighth bit in the characters it reads), 408regardless of what the terminal claims it can support. The name 409.B meta\-flag 410is a synonym for this variable. 411.TP 412.B isearch\-terminators (``C\-[ C\-J'') 413The string of characters that should terminate an incremental 414search without subsequently executing the character as a command. 415If this variable has not been given a value, the characters 416\fIESC\fP and \fIC\-J\fP will terminate an incremental search. 417.TP 418.B keymap (emacs) 419Set the current readline keymap. The set of legal keymap names is 420\fIemacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move, 421vi-command\fP, and 422.IR vi-insert . 423\fIvi\fP is equivalent to \fIvi-command\fP; \fIemacs\fP is 424equivalent to \fIemacs-standard\fP. The default value is 425.IR emacs . 426The value of 427.B editing\-mode 428also affects the default keymap. 429.TP 430.B mark\-directories (On) 431If set to \fBOn\fP, completed directory names have a slash 432appended. 433.TP 434.B mark\-modified\-lines (Off) 435If set to \fBOn\fP, history lines that have been modified are displayed 436with a preceding asterisk (\fB*\fP). 437.TP 438.B mark\-symlinked\-directories (Off) 439If set to \fBOn\fP, completed names which are symbolic links to directories 440have a slash appended (subject to the value of 441\fBmark\-directories\fP). 442.TP 443.B match\-hidden\-files (On) 444This variable, when set to \fBOn\fP, causes readline to match files whose 445names begin with a `.' (hidden files) when performing filename 446completion, unless the leading `.' is 447supplied by the user in the filename to be completed. 448.TP 449.B output\-meta (Off) 450If set to \fBOn\fP, readline will display characters with the 451eighth bit set directly rather than as a meta-prefixed escape 452sequence. 453.TP 454.B page\-completions (On) 455If set to \fBOn\fP, readline uses an internal \fImore\fP-like pager 456to display a screenful of possible completions at a time. 457.TP 458.B print\-completions\-horizontally (Off) 459If set to \fBOn\fP, readline will display completions with matches 460sorted horizontally in alphabetical order, rather than down the screen. 461.TP 462.B show\-all\-if\-ambiguous (Off) 463This alters the default behavior of the completion functions. If 464set to 465.BR on , 466words which have more than one possible completion cause the 467matches to be listed immediately instead of ringing the bell. 468.TP 469.B show\-all\-if\-unmodified (Off) 470This alters the default behavior of the completion functions in 471a fashion similar to \fBshow\-all\-if\-ambiguous\fP. 472If set to 473.BR on , 474words which have more than one possible completion without any 475possible partial completion (the possible completions don't share 476a common prefix) cause the matches to be listed immediately instead 477of ringing the bell. 478.TP 479.B visible\-stats (Off) 480If set to \fBOn\fP, a character denoting a file's type as reported 481by \fIstat\fP(2) is appended to the filename when listing possible 482completions. 483.PD 484.SS Conditional Constructs 485.PP 486Readline implements a facility similar in spirit to the conditional 487compilation features of the C preprocessor which allows key 488bindings and variable settings to be performed as the result 489of tests. There are four parser directives used. 490.IP \fB$if\fP 491The 492.B $if 493construct allows bindings to be made based on the 494editing mode, the terminal being used, or the application using 495readline. The text of the test extends to the end of the line; 496no characters are required to isolate it. 497.RS 498.IP \fBmode\fP 499The \fBmode=\fP form of the \fB$if\fP directive is used to test 500whether readline is in emacs or vi mode. 501This may be used in conjunction 502with the \fBset keymap\fP command, for instance, to set bindings in 503the \fIemacs-standard\fP and \fIemacs-ctlx\fP keymaps only if 504readline is starting out in emacs mode. 505.IP \fBterm\fP 506The \fBterm=\fP form may be used to include terminal-specific 507key bindings, perhaps to bind the key sequences output by the 508terminal's function keys. The word on the right side of the 509.B = 510is tested against the full name of the terminal and the portion 511of the terminal name before the first \fB\-\fP. This allows 512.I sun 513to match both 514.I sun 515and 516.IR sun\-cmd , 517for instance. 518.IP \fBapplication\fP 519The \fBapplication\fP construct is used to include 520application-specific settings. Each program using the readline 521library sets the \fIapplication name\fP, and an initialization 522file can test for a particular value. 523This could be used to bind key sequences to functions useful for 524a specific program. For instance, the following command adds a 525key sequence that quotes the current or previous word in Bash: 526.sp 1 527.RS 528.nf 529\fB$if\fP Bash 530# Quote the current or previous word 531"\eC-xq": "\eeb\e"\eef\e"" 532\fB$endif\fP 533.fi 534.RE 535.RE 536.IP \fB$endif\fP 537This command, as seen in the previous example, terminates an 538\fB$if\fP command. 539.IP \fB$else\fP 540Commands in this branch of the \fB$if\fP directive are executed if 541the test fails. 542.IP \fB$include\fP 543This directive takes a single filename as an argument and reads commands 544and bindings from that file. For example, the following directive 545would read \fI/etc/inputrc\fP: 546.sp 1 547.RS 548.nf 549\fB$include\fP \^ \fI/etc/inputrc\fP 550.fi 551.RE 552.SH SEARCHING 553.PP 554Readline provides commands for searching through the command history 555for lines containing a specified string. 556There are two search modes: 557.I incremental 558and 559.IR non-incremental . 560.PP 561Incremental searches begin before the user has finished typing the 562search string. 563As each character of the search string is typed, readline displays 564the next entry from the history matching the string typed so far. 565An incremental search requires only as many characters as needed to 566find the desired history entry. 567To search backward in the history for a particular string, type 568\fBC\-r\fP. Typing \fBC\-s\fP searches forward through the history. 569The characters present in the value of the \fBisearch-terminators\fP 570variable are used to terminate an incremental search. 571If that variable has not been assigned a value the \fIEscape\fP and 572\fBC\-J\fP characters will terminate an incremental search. 573\fBC\-G\fP will abort an incremental search and restore the original 574line. 575When the search is terminated, the history entry containing the 576search string becomes the current line. 577.PP 578To find other matching entries in the history list, type \fBC\-s\fP or 579\fBC\-r\fP as appropriate. 580This will search backward or forward in the history for the next 581line matching the search string typed so far. 582Any other key sequence bound to a readline command will terminate 583the search and execute that command. 584For instance, a newline will terminate the search and accept 585the line, thereby executing the command from the history list. 586A movement command will terminate the search, make the last line found 587the current line, and begin editing. 588.PP 589Non-incremental searches read the entire search string before starting 590to search for matching history lines. The search string may be 591typed by the user or be part of the contents of the current line. 592.SH EDITING COMMANDS 593.PP 594The following is a list of the names of the commands and the default 595key sequences to which they are bound. 596Command names without an accompanying key sequence are unbound by default. 597.PP 598In the following descriptions, \fIpoint\fP refers to the current cursor 599position, and \fImark\fP refers to a cursor position saved by the 600\fBset\-mark\fP command. 601The text between the point and mark is referred to as the \fIregion\fP. 602.SS Commands for Moving 603.PP 604.PD 0 605.TP 606.B beginning\-of\-line (C\-a) 607Move to the start of the current line. 608.TP 609.B end\-of\-line (C\-e) 610Move to the end of the line. 611.TP 612.B forward\-char (C\-f) 613Move forward a character. 614.TP 615.B backward\-char (C\-b) 616Move back a character. 617.TP 618.B forward\-word (M\-f) 619Move forward to the end of the next word. Words are composed of 620alphanumeric characters (letters and digits). 621.TP 622.B backward\-word (M\-b) 623Move back to the start of the current or previous word. Words are 624composed of alphanumeric characters (letters and digits). 625.TP 626.B clear\-screen (C\-l) 627Clear the screen leaving the current line at the top of the screen. 628With an argument, refresh the current line without clearing the 629screen. 630.TP 631.B redraw\-current\-line 632Refresh the current line. 633.PD 634.SS Commands for Manipulating the History 635.PP 636.PD 0 637.TP 638.B accept\-line (Newline, Return) 639Accept the line regardless of where the cursor is. 640If this line is 641non-empty, it may be added to the history list for future recall with 642\fBadd_history()\fP. 643If the line is a modified history line, the history line is restored to its original state. 644.TP 645.B previous\-history (C\-p) 646Fetch the previous command from the history list, moving back in 647the list. 648.TP 649.B next\-history (C\-n) 650Fetch the next command from the history list, moving forward in the 651list. 652.TP 653.B beginning\-of\-history (M\-<) 654Move to the first line in the history. 655.TP 656.B end\-of\-history (M\->) 657Move to the end of the input history, i.e., the line currently being 658entered. 659.TP 660.B reverse\-search\-history (C\-r) 661Search backward starting at the current line and moving `up' through 662the history as necessary. This is an incremental search. 663.TP 664.B forward\-search\-history (C\-s) 665Search forward starting at the current line and moving `down' through 666the history as necessary. This is an incremental search. 667.TP 668.B non\-incremental\-reverse\-search\-history (M\-p) 669Search backward through the history starting at the current line 670using a non-incremental search for a string supplied by the user. 671.TP 672.B non\-incremental\-forward\-search\-history (M\-n) 673Search forward through the history using a non-incremental search 674for a string supplied by the user. 675.TP 676.B history\-search\-forward 677Search forward through the history for the string of characters 678between the start of the current line and the current cursor 679position (the \fIpoint\fP). 680This is a non-incremental search. 681.TP 682.B history\-search\-backward 683Search backward through the history for the string of characters 684between the start of the current line and the point. 685This is a non-incremental search. 686.TP 687.B yank\-nth\-arg (M\-C\-y) 688Insert the first argument to the previous command (usually 689the second word on the previous line) at point. 690With an argument 691.IR n , 692insert the \fIn\fPth word from the previous command (the words 693in the previous command begin with word 0). A negative argument 694inserts the \fIn\fPth word from the end of the previous command.
| 407or \fBnext-history\fP. 408.TP 409.B horizontal\-scroll\-mode (Off) 410When set to \fBOn\fP, makes readline use a single line for display, 411scrolling the input horizontally on a single screen line when it 412becomes longer than the screen width rather than wrapping to a new line. 413.TP 414.B input\-meta (Off) 415If set to \fBOn\fP, readline will enable eight-bit input (that is, 416it will not clear the eighth bit in the characters it reads), 417regardless of what the terminal claims it can support. The name 418.B meta\-flag 419is a synonym for this variable. 420.TP 421.B isearch\-terminators (``C\-[ C\-J'') 422The string of characters that should terminate an incremental 423search without subsequently executing the character as a command. 424If this variable has not been given a value, the characters 425\fIESC\fP and \fIC\-J\fP will terminate an incremental search. 426.TP 427.B keymap (emacs) 428Set the current readline keymap. The set of legal keymap names is 429\fIemacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move, 430vi-command\fP, and 431.IR vi-insert . 432\fIvi\fP is equivalent to \fIvi-command\fP; \fIemacs\fP is 433equivalent to \fIemacs-standard\fP. The default value is 434.IR emacs . 435The value of 436.B editing\-mode 437also affects the default keymap. 438.TP 439.B mark\-directories (On) 440If set to \fBOn\fP, completed directory names have a slash 441appended. 442.TP 443.B mark\-modified\-lines (Off) 444If set to \fBOn\fP, history lines that have been modified are displayed 445with a preceding asterisk (\fB*\fP). 446.TP 447.B mark\-symlinked\-directories (Off) 448If set to \fBOn\fP, completed names which are symbolic links to directories 449have a slash appended (subject to the value of 450\fBmark\-directories\fP). 451.TP 452.B match\-hidden\-files (On) 453This variable, when set to \fBOn\fP, causes readline to match files whose 454names begin with a `.' (hidden files) when performing filename 455completion, unless the leading `.' is 456supplied by the user in the filename to be completed. 457.TP 458.B output\-meta (Off) 459If set to \fBOn\fP, readline will display characters with the 460eighth bit set directly rather than as a meta-prefixed escape 461sequence. 462.TP 463.B page\-completions (On) 464If set to \fBOn\fP, readline uses an internal \fImore\fP-like pager 465to display a screenful of possible completions at a time. 466.TP 467.B print\-completions\-horizontally (Off) 468If set to \fBOn\fP, readline will display completions with matches 469sorted horizontally in alphabetical order, rather than down the screen. 470.TP 471.B show\-all\-if\-ambiguous (Off) 472This alters the default behavior of the completion functions. If 473set to 474.BR on , 475words which have more than one possible completion cause the 476matches to be listed immediately instead of ringing the bell. 477.TP 478.B show\-all\-if\-unmodified (Off) 479This alters the default behavior of the completion functions in 480a fashion similar to \fBshow\-all\-if\-ambiguous\fP. 481If set to 482.BR on , 483words which have more than one possible completion without any 484possible partial completion (the possible completions don't share 485a common prefix) cause the matches to be listed immediately instead 486of ringing the bell. 487.TP 488.B visible\-stats (Off) 489If set to \fBOn\fP, a character denoting a file's type as reported 490by \fIstat\fP(2) is appended to the filename when listing possible 491completions. 492.PD 493.SS Conditional Constructs 494.PP 495Readline implements a facility similar in spirit to the conditional 496compilation features of the C preprocessor which allows key 497bindings and variable settings to be performed as the result 498of tests. There are four parser directives used. 499.IP \fB$if\fP 500The 501.B $if 502construct allows bindings to be made based on the 503editing mode, the terminal being used, or the application using 504readline. The text of the test extends to the end of the line; 505no characters are required to isolate it. 506.RS 507.IP \fBmode\fP 508The \fBmode=\fP form of the \fB$if\fP directive is used to test 509whether readline is in emacs or vi mode. 510This may be used in conjunction 511with the \fBset keymap\fP command, for instance, to set bindings in 512the \fIemacs-standard\fP and \fIemacs-ctlx\fP keymaps only if 513readline is starting out in emacs mode. 514.IP \fBterm\fP 515The \fBterm=\fP form may be used to include terminal-specific 516key bindings, perhaps to bind the key sequences output by the 517terminal's function keys. The word on the right side of the 518.B = 519is tested against the full name of the terminal and the portion 520of the terminal name before the first \fB\-\fP. This allows 521.I sun 522to match both 523.I sun 524and 525.IR sun\-cmd , 526for instance. 527.IP \fBapplication\fP 528The \fBapplication\fP construct is used to include 529application-specific settings. Each program using the readline 530library sets the \fIapplication name\fP, and an initialization 531file can test for a particular value. 532This could be used to bind key sequences to functions useful for 533a specific program. For instance, the following command adds a 534key sequence that quotes the current or previous word in Bash: 535.sp 1 536.RS 537.nf 538\fB$if\fP Bash 539# Quote the current or previous word 540"\eC-xq": "\eeb\e"\eef\e"" 541\fB$endif\fP 542.fi 543.RE 544.RE 545.IP \fB$endif\fP 546This command, as seen in the previous example, terminates an 547\fB$if\fP command. 548.IP \fB$else\fP 549Commands in this branch of the \fB$if\fP directive are executed if 550the test fails. 551.IP \fB$include\fP 552This directive takes a single filename as an argument and reads commands 553and bindings from that file. For example, the following directive 554would read \fI/etc/inputrc\fP: 555.sp 1 556.RS 557.nf 558\fB$include\fP \^ \fI/etc/inputrc\fP 559.fi 560.RE 561.SH SEARCHING 562.PP 563Readline provides commands for searching through the command history 564for lines containing a specified string. 565There are two search modes: 566.I incremental 567and 568.IR non-incremental . 569.PP 570Incremental searches begin before the user has finished typing the 571search string. 572As each character of the search string is typed, readline displays 573the next entry from the history matching the string typed so far. 574An incremental search requires only as many characters as needed to 575find the desired history entry. 576To search backward in the history for a particular string, type 577\fBC\-r\fP. Typing \fBC\-s\fP searches forward through the history. 578The characters present in the value of the \fBisearch-terminators\fP 579variable are used to terminate an incremental search. 580If that variable has not been assigned a value the \fIEscape\fP and 581\fBC\-J\fP characters will terminate an incremental search. 582\fBC\-G\fP will abort an incremental search and restore the original 583line. 584When the search is terminated, the history entry containing the 585search string becomes the current line. 586.PP 587To find other matching entries in the history list, type \fBC\-s\fP or 588\fBC\-r\fP as appropriate. 589This will search backward or forward in the history for the next 590line matching the search string typed so far. 591Any other key sequence bound to a readline command will terminate 592the search and execute that command. 593For instance, a newline will terminate the search and accept 594the line, thereby executing the command from the history list. 595A movement command will terminate the search, make the last line found 596the current line, and begin editing. 597.PP 598Non-incremental searches read the entire search string before starting 599to search for matching history lines. The search string may be 600typed by the user or be part of the contents of the current line. 601.SH EDITING COMMANDS 602.PP 603The following is a list of the names of the commands and the default 604key sequences to which they are bound. 605Command names without an accompanying key sequence are unbound by default. 606.PP 607In the following descriptions, \fIpoint\fP refers to the current cursor 608position, and \fImark\fP refers to a cursor position saved by the 609\fBset\-mark\fP command. 610The text between the point and mark is referred to as the \fIregion\fP. 611.SS Commands for Moving 612.PP 613.PD 0 614.TP 615.B beginning\-of\-line (C\-a) 616Move to the start of the current line. 617.TP 618.B end\-of\-line (C\-e) 619Move to the end of the line. 620.TP 621.B forward\-char (C\-f) 622Move forward a character. 623.TP 624.B backward\-char (C\-b) 625Move back a character. 626.TP 627.B forward\-word (M\-f) 628Move forward to the end of the next word. Words are composed of 629alphanumeric characters (letters and digits). 630.TP 631.B backward\-word (M\-b) 632Move back to the start of the current or previous word. Words are 633composed of alphanumeric characters (letters and digits). 634.TP 635.B clear\-screen (C\-l) 636Clear the screen leaving the current line at the top of the screen. 637With an argument, refresh the current line without clearing the 638screen. 639.TP 640.B redraw\-current\-line 641Refresh the current line. 642.PD 643.SS Commands for Manipulating the History 644.PP 645.PD 0 646.TP 647.B accept\-line (Newline, Return) 648Accept the line regardless of where the cursor is. 649If this line is 650non-empty, it may be added to the history list for future recall with 651\fBadd_history()\fP. 652If the line is a modified history line, the history line is restored to its original state. 653.TP 654.B previous\-history (C\-p) 655Fetch the previous command from the history list, moving back in 656the list. 657.TP 658.B next\-history (C\-n) 659Fetch the next command from the history list, moving forward in the 660list. 661.TP 662.B beginning\-of\-history (M\-<) 663Move to the first line in the history. 664.TP 665.B end\-of\-history (M\->) 666Move to the end of the input history, i.e., the line currently being 667entered. 668.TP 669.B reverse\-search\-history (C\-r) 670Search backward starting at the current line and moving `up' through 671the history as necessary. This is an incremental search. 672.TP 673.B forward\-search\-history (C\-s) 674Search forward starting at the current line and moving `down' through 675the history as necessary. This is an incremental search. 676.TP 677.B non\-incremental\-reverse\-search\-history (M\-p) 678Search backward through the history starting at the current line 679using a non-incremental search for a string supplied by the user. 680.TP 681.B non\-incremental\-forward\-search\-history (M\-n) 682Search forward through the history using a non-incremental search 683for a string supplied by the user. 684.TP 685.B history\-search\-forward 686Search forward through the history for the string of characters 687between the start of the current line and the current cursor 688position (the \fIpoint\fP). 689This is a non-incremental search. 690.TP 691.B history\-search\-backward 692Search backward through the history for the string of characters 693between the start of the current line and the point. 694This is a non-incremental search. 695.TP 696.B yank\-nth\-arg (M\-C\-y) 697Insert the first argument to the previous command (usually 698the second word on the previous line) at point. 699With an argument 700.IR n , 701insert the \fIn\fPth word from the previous command (the words 702in the previous command begin with word 0). A negative argument 703inserts the \fIn\fPth word from the end of the previous command.
|
| 704Once the argument \fIn\fP is computed, the argument is extracted 705as if the "!\fIn\fP" history expansion had been specified.
|
695.TP 696.B 697yank\-last\-arg (M\-.\^, M\-_\^) 698Insert the last argument to the previous command (the last word of 699the previous history entry). With an argument, 700behave exactly like \fByank\-nth\-arg\fP. 701Successive calls to \fByank\-last\-arg\fP move back through the history 702list, inserting the last argument of each line in turn.
| 706.TP 707.B 708yank\-last\-arg (M\-.\^, M\-_\^) 709Insert the last argument to the previous command (the last word of 710the previous history entry). With an argument, 711behave exactly like \fByank\-nth\-arg\fP. 712Successive calls to \fByank\-last\-arg\fP move back through the history 713list, inserting the last argument of each line in turn.
|
| 714The history expansion facilities are used to extract the last argument, 715as if the "!$" history expansion had been specified.
|
703.PD 704.SS Commands for Changing Text 705.PP 706.PD 0 707.TP 708.B delete\-char (C\-d) 709Delete the character at point. If point is at the 710beginning of the line, there are no characters in the line, and 711the last character typed was not bound to \fBdelete\-char\fP, then return 712.SM 713.BR EOF . 714.TP 715.B backward\-delete\-char (Rubout) 716Delete the character behind the cursor. When given a numeric argument, 717save the deleted text on the kill ring. 718.TP 719.B forward\-backward\-delete\-char 720Delete the character under the cursor, unless the cursor is at the 721end of the line, in which case the character behind the cursor is 722deleted. 723.TP 724.B quoted\-insert (C\-q, C\-v) 725Add the next character that you type to the line verbatim. This is 726how to insert characters like \fBC\-q\fP, for example. 727.TP 728.B tab\-insert (M-TAB) 729Insert a tab character. 730.TP 731.B self\-insert (a,\ b,\ A,\ 1,\ !,\ ...) 732Insert the character typed. 733.TP 734.B transpose\-chars (C\-t) 735Drag the character before point forward over the character at point, 736moving point forward as well. 737If point is at the end of the line, then this transposes 738the two characters before point. 739Negative arguments have no effect. 740.TP 741.B transpose\-words (M\-t) 742Drag the word before point past the word after point, 743moving point over that word as well. 744If point is at the end of the line, this transposes 745the last two words on the line. 746.TP 747.B upcase\-word (M\-u) 748Uppercase the current (or following) word. With a negative argument, 749uppercase the previous word, but do not move point. 750.TP 751.B downcase\-word (M\-l) 752Lowercase the current (or following) word. With a negative argument, 753lowercase the previous word, but do not move point. 754.TP 755.B capitalize\-word (M\-c) 756Capitalize the current (or following) word. With a negative argument, 757capitalize the previous word, but do not move point. 758.TP 759.B overwrite\-mode 760Toggle overwrite mode. With an explicit positive numeric argument, 761switches to overwrite mode. With an explicit non-positive numeric 762argument, switches to insert mode. This command affects only 763\fBemacs\fP mode; \fBvi\fP mode does overwrite differently. 764Each call to \fIreadline()\fP starts in insert mode. 765In overwrite mode, characters bound to \fBself\-insert\fP replace 766the text at point rather than pushing the text to the right. 767Characters bound to \fBbackward\-delete\-char\fP replace the character 768before point with a space. By default, this command is unbound. 769.PD 770.SS Killing and Yanking 771.PP 772.PD 0 773.TP 774.B kill\-line (C\-k) 775Kill the text from point to the end of the line. 776.TP 777.B backward\-kill\-line (C\-x Rubout) 778Kill backward to the beginning of the line. 779.TP 780.B unix\-line\-discard (C\-u) 781Kill backward from point to the beginning of the line. 782The killed text is saved on the kill-ring. 783.\" There is no real difference between this and backward-kill-line 784.TP 785.B kill\-whole\-line 786Kill all characters on the current line, no matter where point is. 787.TP 788.B kill\-word (M\-d) 789Kill from point the end of the current word, or if between 790words, to the end of the next word. Word boundaries are the same as 791those used by \fBforward\-word\fP. 792.TP 793.B backward\-kill\-word (M\-Rubout) 794Kill the word behind point. 795Word boundaries are the same as those used by \fBbackward\-word\fP. 796.TP 797.B unix\-word\-rubout (C\-w) 798Kill the word behind point, using white space as a word boundary. 799The killed text is saved on the kill-ring. 800.TP 801.B unix\-filename\-rubout 802Kill the word behind point, using white space and the slash character 803as the word boundaries. 804The killed text is saved on the kill-ring. 805.TP 806.B delete\-horizontal\-space (M\-\e) 807Delete all spaces and tabs around point. 808.TP 809.B kill\-region 810Kill the text between the point and \fImark\fP (saved cursor position). 811This text is referred to as the \fIregion\fP. 812.TP 813.B copy\-region\-as\-kill 814Copy the text in the region to the kill buffer. 815.TP 816.B copy\-backward\-word 817Copy the word before point to the kill buffer. 818The word boundaries are the same as \fBbackward\-word\fP. 819.TP 820.B copy\-forward\-word 821Copy the word following point to the kill buffer. 822The word boundaries are the same as \fBforward\-word\fP. 823.TP 824.B yank (C\-y) 825Yank the top of the kill ring into the buffer at point. 826.TP 827.B yank\-pop (M\-y) 828Rotate the kill ring, and yank the new top. Only works following 829.B yank 830or 831.BR yank\-pop . 832.PD 833.SS Numeric Arguments 834.PP 835.PD 0 836.TP 837.B digit\-argument (M\-0, M\-1, ..., M\-\-) 838Add this digit to the argument already accumulating, or start a new 839argument. M\-\- starts a negative argument. 840.TP 841.B universal\-argument 842This is another way to specify an argument. 843If this command is followed by one or more digits, optionally with a 844leading minus sign, those digits define the argument. 845If the command is followed by digits, executing 846.B universal\-argument 847again ends the numeric argument, but is otherwise ignored. 848As a special case, if this command is immediately followed by a 849character that is neither a digit or minus sign, the argument count 850for the next command is multiplied by four. 851The argument count is initially one, so executing this function the 852first time makes the argument count four, a second time makes the 853argument count sixteen, and so on. 854.PD 855.SS Completing 856.PP 857.PD 0 858.TP 859.B complete (TAB) 860Attempt to perform completion on the text before point. 861The actual completion performed is application-specific. 862.BR Bash , 863for instance, attempts completion treating the text as a variable 864(if the text begins with \fB$\fP), username (if the text begins with 865\fB~\fP), hostname (if the text begins with \fB@\fP), or 866command (including aliases and functions) in turn. If none 867of these produces a match, filename completion is attempted. 868.BR Gdb , 869on the other hand, 870allows completion of program functions and variables, and 871only attempts filename completion under certain circumstances. 872.TP 873.B possible\-completions (M\-?) 874List the possible completions of the text before point. 875.TP 876.B insert\-completions (M\-*) 877Insert all completions of the text before point 878that would have been generated by 879\fBpossible\-completions\fP. 880.TP 881.B menu\-complete 882Similar to \fBcomplete\fP, but replaces the word to be completed 883with a single match from the list of possible completions. 884Repeated execution of \fBmenu\-complete\fP steps through the list 885of possible completions, inserting each match in turn. 886At the end of the list of completions, the bell is rung 887(subject to the setting of \fBbell\-style\fP) 888and the original text is restored. 889An argument of \fIn\fP moves \fIn\fP positions forward in the list 890of matches; a negative argument may be used to move backward 891through the list. 892This command is intended to be bound to \fBTAB\fP, but is unbound 893by default. 894.TP 895.B delete\-char\-or\-list 896Deletes the character under the cursor if not at the beginning or 897end of the line (like \fBdelete-char\fP). 898If at the end of the line, behaves identically to 899\fBpossible-completions\fP. 900.PD 901.SS Keyboard Macros 902.PP 903.PD 0 904.TP 905.B start\-kbd\-macro (C\-x (\^) 906Begin saving the characters typed into the current keyboard macro. 907.TP 908.B end\-kbd\-macro (C\-x )\^) 909Stop saving the characters typed into the current keyboard macro 910and store the definition. 911.TP 912.B call\-last\-kbd\-macro (C\-x e) 913Re-execute the last keyboard macro defined, by making the characters 914in the macro appear as if typed at the keyboard. 915.PD 916.SS Miscellaneous 917.PP 918.PD 0 919.TP 920.B re\-read\-init\-file (C\-x C\-r) 921Read in the contents of the \fIinputrc\fP file, and incorporate 922any bindings or variable assignments found there. 923.TP 924.B abort (C\-g) 925Abort the current editing command and 926ring the terminal's bell (subject to the setting of 927.BR bell\-style ). 928.TP 929.B do\-uppercase\-version (M\-a, M\-b, M\-\fIx\fP, ...) 930If the metafied character \fIx\fP is lowercase, run the command 931that is bound to the corresponding uppercase character. 932.TP 933.B prefix\-meta (ESC) 934Metafy the next character typed. 935.SM 936.B ESC 937.B f 938is equivalent to 939.BR Meta\-f . 940.TP 941.B undo (C\-_, C\-x C\-u) 942Incremental undo, separately remembered for each line. 943.TP 944.B revert\-line (M\-r) 945Undo all changes made to this line. This is like executing the 946.B undo 947command enough times to return the line to its initial state. 948.TP 949.B tilde\-expand (M\-&) 950Perform tilde expansion on the current word. 951.TP 952.B set\-mark (C\-@, M\-<space>) 953Set the mark to the point. If a 954numeric argument is supplied, the mark is set to that position. 955.TP 956.B exchange\-point\-and\-mark (C\-x C\-x) 957Swap the point with the mark. The current cursor position is set to 958the saved position, and the old cursor position is saved as the mark. 959.TP 960.B character\-search (C\-]) 961A character is read and point is moved to the next occurrence of that 962character. A negative count searches for previous occurrences. 963.TP 964.B character\-search\-backward (M\-C\-]) 965A character is read and point is moved to the previous occurrence of that 966character. A negative count searches for subsequent occurrences. 967.TP 968.B insert\-comment (M\-#) 969Without a numeric argument, the value of the readline 970.B comment\-begin 971variable is inserted at the beginning of the current line. 972If a numeric argument is supplied, this command acts as a toggle: if 973the characters at the beginning of the line do not match the value 974of \fBcomment\-begin\fP, the value is inserted, otherwise 975the characters in \fBcomment-begin\fP are deleted from the beginning of 976the line. 977In either case, the line is accepted as if a newline had been typed. 978The default value of 979.B comment\-begin 980makes the current line a shell comment. 981If a numeric argument causes the comment character to be removed, the line 982will be executed by the shell. 983.TP 984.B dump\-functions 985Print all of the functions and their key bindings to the 986readline output stream. If a numeric argument is supplied, 987the output is formatted in such a way that it can be made part 988of an \fIinputrc\fP file. 989.TP 990.B dump\-variables 991Print all of the settable variables and their values to the 992readline output stream. If a numeric argument is supplied, 993the output is formatted in such a way that it can be made part 994of an \fIinputrc\fP file. 995.TP 996.B dump\-macros 997Print all of the readline key sequences bound to macros and the 998strings they output. If a numeric argument is supplied, 999the output is formatted in such a way that it can be made part 1000of an \fIinputrc\fP file. 1001.TP 1002.B emacs\-editing\-mode (C\-e) 1003When in 1004.B vi 1005command mode, this causes a switch to 1006.B emacs 1007editing mode. 1008.TP 1009.B vi\-editing\-mode (M\-C\-j) 1010When in 1011.B emacs 1012editing mode, this causes a switch to 1013.B vi 1014editing mode. 1015.PD 1016.SH DEFAULT KEY BINDINGS 1017.LP 1018The following is a list of the default emacs and vi bindings. 1019Characters with the eighth bit set are written as M\-<character>, and 1020are referred to as 1021.I metafied 1022characters. 1023The printable ASCII characters not mentioned in the list of emacs 1024standard bindings are bound to the 1025.B self\-insert 1026function, which just inserts the given character into the input line. 1027In vi insertion mode, all characters not specifically mentioned are 1028bound to 1029.BR self\-insert . 1030Characters assigned to signal generation by 1031.IR stty (1) 1032or the terminal driver, such as C-Z or C-C, 1033retain that function. 1034Upper and lower case metafied characters are bound to the same function in 1035the emacs mode meta keymap. 1036The remaining characters are unbound, which causes readline 1037to ring the bell (subject to the setting of the 1038.B bell\-style 1039variable). 1040.SS Emacs Mode 1041.RS +.6i 1042.nf 1043.ta 2.5i 1044.sp 1045Emacs Standard bindings 1046.sp 1047"C-@" set-mark 1048"C-A" beginning-of-line 1049"C-B" backward-char 1050"C-D" delete-char 1051"C-E" end-of-line 1052"C-F" forward-char 1053"C-G" abort 1054"C-H" backward-delete-char 1055"C-I" complete 1056"C-J" accept-line 1057"C-K" kill-line 1058"C-L" clear-screen 1059"C-M" accept-line 1060"C-N" next-history 1061"C-P" previous-history 1062"C-Q" quoted-insert 1063"C-R" reverse-search-history 1064"C-S" forward-search-history 1065"C-T" transpose-chars 1066"C-U" unix-line-discard 1067"C-V" quoted-insert 1068"C-W" unix-word-rubout 1069"C-Y" yank 1070"C-]" character-search 1071"C-_" undo 1072"\^ " to "/" self-insert 1073"0" to "9" self-insert 1074":" to "~" self-insert 1075"C-?" backward-delete-char 1076.PP 1077Emacs Meta bindings 1078.sp 1079"M-C-G" abort 1080"M-C-H" backward-kill-word 1081"M-C-I" tab-insert 1082"M-C-J" vi-editing-mode 1083"M-C-M" vi-editing-mode 1084"M-C-R" revert-line 1085"M-C-Y" yank-nth-arg 1086"M-C-[" complete 1087"M-C-]" character-search-backward 1088"M-space" set-mark 1089"M-#" insert-comment 1090"M-&" tilde-expand 1091"M-*" insert-completions 1092"M--" digit-argument 1093"M-." yank-last-arg 1094"M-0" digit-argument 1095"M-1" digit-argument 1096"M-2" digit-argument 1097"M-3" digit-argument 1098"M-4" digit-argument 1099"M-5" digit-argument 1100"M-6" digit-argument 1101"M-7" digit-argument 1102"M-8" digit-argument 1103"M-9" digit-argument 1104"M-<" beginning-of-history 1105"M-=" possible-completions 1106"M->" end-of-history 1107"M-?" possible-completions 1108"M-B" backward-word 1109"M-C" capitalize-word 1110"M-D" kill-word 1111"M-F" forward-word 1112"M-L" downcase-word 1113"M-N" non-incremental-forward-search-history 1114"M-P" non-incremental-reverse-search-history 1115"M-R" revert-line 1116"M-T" transpose-words 1117"M-U" upcase-word 1118"M-Y" yank-pop 1119"M-\e" delete-horizontal-space 1120"M-~" tilde-expand 1121"M-C-?" backward-kill-word 1122"M-_" yank-last-arg 1123.PP 1124Emacs Control-X bindings 1125.sp 1126"C-XC-G" abort 1127"C-XC-R" re-read-init-file 1128"C-XC-U" undo 1129"C-XC-X" exchange-point-and-mark 1130"C-X(" start-kbd-macro 1131"C-X)" end-kbd-macro 1132"C-XE" call-last-kbd-macro 1133"C-XC-?" backward-kill-line 1134.sp 1135.RE 1136.SS VI Mode bindings 1137.RS +.6i 1138.nf 1139.ta 2.5i 1140.sp 1141.PP 1142VI Insert Mode functions 1143.sp 1144"C-D" vi-eof-maybe 1145"C-H" backward-delete-char 1146"C-I" complete 1147"C-J" accept-line 1148"C-M" accept-line 1149"C-R" reverse-search-history 1150"C-S" forward-search-history 1151"C-T" transpose-chars 1152"C-U" unix-line-discard 1153"C-V" quoted-insert 1154"C-W" unix-word-rubout 1155"C-Y" yank 1156"C-[" vi-movement-mode 1157"C-_" undo 1158"\^ " to "~" self-insert 1159"C-?" backward-delete-char 1160.PP 1161VI Command Mode functions 1162.sp 1163"C-D" vi-eof-maybe 1164"C-E" emacs-editing-mode 1165"C-G" abort 1166"C-H" backward-char 1167"C-J" accept-line 1168"C-K" kill-line 1169"C-L" clear-screen 1170"C-M" accept-line 1171"C-N" next-history 1172"C-P" previous-history 1173"C-Q" quoted-insert 1174"C-R" reverse-search-history 1175"C-S" forward-search-history 1176"C-T" transpose-chars 1177"C-U" unix-line-discard 1178"C-V" quoted-insert 1179"C-W" unix-word-rubout 1180"C-Y" yank 1181"C-_" vi-undo 1182"\^ " forward-char 1183"#" insert-comment 1184"$" end-of-line 1185"%" vi-match 1186"&" vi-tilde-expand 1187"*" vi-complete 1188"+" next-history 1189"," vi-char-search 1190"-" previous-history 1191"." vi-redo 1192"/" vi-search 1193"0" beginning-of-line 1194"1" to "9" vi-arg-digit 1195";" vi-char-search 1196"=" vi-complete 1197"?" vi-search 1198"A" vi-append-eol 1199"B" vi-prev-word 1200"C" vi-change-to 1201"D" vi-delete-to 1202"E" vi-end-word 1203"F" vi-char-search 1204"G" vi-fetch-history 1205"I" vi-insert-beg 1206"N" vi-search-again 1207"P" vi-put 1208"R" vi-replace 1209"S" vi-subst 1210"T" vi-char-search 1211"U" revert-line 1212"W" vi-next-word 1213"X" backward-delete-char 1214"Y" vi-yank-to 1215"\e" vi-complete 1216"^" vi-first-print 1217"_" vi-yank-arg 1218"`" vi-goto-mark 1219"a" vi-append-mode 1220"b" vi-prev-word 1221"c" vi-change-to 1222"d" vi-delete-to 1223"e" vi-end-word 1224"f" vi-char-search 1225"h" backward-char 1226"i" vi-insertion-mode 1227"j" next-history 1228"k" prev-history 1229"l" forward-char 1230"m" vi-set-mark 1231"n" vi-search-again 1232"p" vi-put 1233"r" vi-change-char 1234"s" vi-subst 1235"t" vi-char-search 1236"u" vi-undo 1237"w" vi-next-word 1238"x" vi-delete 1239"y" vi-yank-to 1240"|" vi-column 1241"~" vi-change-case 1242.RE 1243.SH "SEE ALSO" 1244.PD 0 1245.TP 1246\fIThe Gnu Readline Library\fP, Brian Fox and Chet Ramey 1247.TP 1248\fIThe Gnu History Library\fP, Brian Fox and Chet Ramey 1249.TP 1250\fIbash\fP(1) 1251.PD 1252.SH FILES 1253.PD 0 1254.TP 1255.FN ~/.inputrc 1256Individual \fBreadline\fP initialization file 1257.PD 1258.SH AUTHORS 1259Brian Fox, Free Software Foundation 1260.br 1261bfox@gnu.org 1262.PP 1263Chet Ramey, Case Western Reserve University 1264.br 1265chet@ins.CWRU.Edu 1266.SH BUG REPORTS 1267If you find a bug in 1268.B readline, 1269you should report it. But first, you should 1270make sure that it really is a bug, and that it appears in the latest 1271version of the 1272.B readline 1273library that you have. 1274.PP 1275Once you have determined that a bug actually exists, mail a 1276bug report to \fIbug\-readline\fP@\fIgnu.org\fP. 1277If you have a fix, you are welcome to mail that 1278as well! Suggestions and `philosophical' bug reports may be mailed 1279to \fPbug-readline\fP@\fIgnu.org\fP or posted to the Usenet 1280newsgroup 1281.BR gnu.bash.bug . 1282.PP 1283Comments and bug reports concerning 1284this manual page should be directed to 1285.IR chet@ins.CWRU.Edu . 1286.SH BUGS 1287.PP 1288It's too big and too slow.
| 716.PD 717.SS Commands for Changing Text 718.PP 719.PD 0 720.TP 721.B delete\-char (C\-d) 722Delete the character at point. If point is at the 723beginning of the line, there are no characters in the line, and 724the last character typed was not bound to \fBdelete\-char\fP, then return 725.SM 726.BR EOF . 727.TP 728.B backward\-delete\-char (Rubout) 729Delete the character behind the cursor. When given a numeric argument, 730save the deleted text on the kill ring. 731.TP 732.B forward\-backward\-delete\-char 733Delete the character under the cursor, unless the cursor is at the 734end of the line, in which case the character behind the cursor is 735deleted. 736.TP 737.B quoted\-insert (C\-q, C\-v) 738Add the next character that you type to the line verbatim. This is 739how to insert characters like \fBC\-q\fP, for example. 740.TP 741.B tab\-insert (M-TAB) 742Insert a tab character. 743.TP 744.B self\-insert (a,\ b,\ A,\ 1,\ !,\ ...) 745Insert the character typed. 746.TP 747.B transpose\-chars (C\-t) 748Drag the character before point forward over the character at point, 749moving point forward as well. 750If point is at the end of the line, then this transposes 751the two characters before point. 752Negative arguments have no effect. 753.TP 754.B transpose\-words (M\-t) 755Drag the word before point past the word after point, 756moving point over that word as well. 757If point is at the end of the line, this transposes 758the last two words on the line. 759.TP 760.B upcase\-word (M\-u) 761Uppercase the current (or following) word. With a negative argument, 762uppercase the previous word, but do not move point. 763.TP 764.B downcase\-word (M\-l) 765Lowercase the current (or following) word. With a negative argument, 766lowercase the previous word, but do not move point. 767.TP 768.B capitalize\-word (M\-c) 769Capitalize the current (or following) word. With a negative argument, 770capitalize the previous word, but do not move point. 771.TP 772.B overwrite\-mode 773Toggle overwrite mode. With an explicit positive numeric argument, 774switches to overwrite mode. With an explicit non-positive numeric 775argument, switches to insert mode. This command affects only 776\fBemacs\fP mode; \fBvi\fP mode does overwrite differently. 777Each call to \fIreadline()\fP starts in insert mode. 778In overwrite mode, characters bound to \fBself\-insert\fP replace 779the text at point rather than pushing the text to the right. 780Characters bound to \fBbackward\-delete\-char\fP replace the character 781before point with a space. By default, this command is unbound. 782.PD 783.SS Killing and Yanking 784.PP 785.PD 0 786.TP 787.B kill\-line (C\-k) 788Kill the text from point to the end of the line. 789.TP 790.B backward\-kill\-line (C\-x Rubout) 791Kill backward to the beginning of the line. 792.TP 793.B unix\-line\-discard (C\-u) 794Kill backward from point to the beginning of the line. 795The killed text is saved on the kill-ring. 796.\" There is no real difference between this and backward-kill-line 797.TP 798.B kill\-whole\-line 799Kill all characters on the current line, no matter where point is. 800.TP 801.B kill\-word (M\-d) 802Kill from point the end of the current word, or if between 803words, to the end of the next word. Word boundaries are the same as 804those used by \fBforward\-word\fP. 805.TP 806.B backward\-kill\-word (M\-Rubout) 807Kill the word behind point. 808Word boundaries are the same as those used by \fBbackward\-word\fP. 809.TP 810.B unix\-word\-rubout (C\-w) 811Kill the word behind point, using white space as a word boundary. 812The killed text is saved on the kill-ring. 813.TP 814.B unix\-filename\-rubout 815Kill the word behind point, using white space and the slash character 816as the word boundaries. 817The killed text is saved on the kill-ring. 818.TP 819.B delete\-horizontal\-space (M\-\e) 820Delete all spaces and tabs around point. 821.TP 822.B kill\-region 823Kill the text between the point and \fImark\fP (saved cursor position). 824This text is referred to as the \fIregion\fP. 825.TP 826.B copy\-region\-as\-kill 827Copy the text in the region to the kill buffer. 828.TP 829.B copy\-backward\-word 830Copy the word before point to the kill buffer. 831The word boundaries are the same as \fBbackward\-word\fP. 832.TP 833.B copy\-forward\-word 834Copy the word following point to the kill buffer. 835The word boundaries are the same as \fBforward\-word\fP. 836.TP 837.B yank (C\-y) 838Yank the top of the kill ring into the buffer at point. 839.TP 840.B yank\-pop (M\-y) 841Rotate the kill ring, and yank the new top. Only works following 842.B yank 843or 844.BR yank\-pop . 845.PD 846.SS Numeric Arguments 847.PP 848.PD 0 849.TP 850.B digit\-argument (M\-0, M\-1, ..., M\-\-) 851Add this digit to the argument already accumulating, or start a new 852argument. M\-\- starts a negative argument. 853.TP 854.B universal\-argument 855This is another way to specify an argument. 856If this command is followed by one or more digits, optionally with a 857leading minus sign, those digits define the argument. 858If the command is followed by digits, executing 859.B universal\-argument 860again ends the numeric argument, but is otherwise ignored. 861As a special case, if this command is immediately followed by a 862character that is neither a digit or minus sign, the argument count 863for the next command is multiplied by four. 864The argument count is initially one, so executing this function the 865first time makes the argument count four, a second time makes the 866argument count sixteen, and so on. 867.PD 868.SS Completing 869.PP 870.PD 0 871.TP 872.B complete (TAB) 873Attempt to perform completion on the text before point. 874The actual completion performed is application-specific. 875.BR Bash , 876for instance, attempts completion treating the text as a variable 877(if the text begins with \fB$\fP), username (if the text begins with 878\fB~\fP), hostname (if the text begins with \fB@\fP), or 879command (including aliases and functions) in turn. If none 880of these produces a match, filename completion is attempted. 881.BR Gdb , 882on the other hand, 883allows completion of program functions and variables, and 884only attempts filename completion under certain circumstances. 885.TP 886.B possible\-completions (M\-?) 887List the possible completions of the text before point. 888.TP 889.B insert\-completions (M\-*) 890Insert all completions of the text before point 891that would have been generated by 892\fBpossible\-completions\fP. 893.TP 894.B menu\-complete 895Similar to \fBcomplete\fP, but replaces the word to be completed 896with a single match from the list of possible completions. 897Repeated execution of \fBmenu\-complete\fP steps through the list 898of possible completions, inserting each match in turn. 899At the end of the list of completions, the bell is rung 900(subject to the setting of \fBbell\-style\fP) 901and the original text is restored. 902An argument of \fIn\fP moves \fIn\fP positions forward in the list 903of matches; a negative argument may be used to move backward 904through the list. 905This command is intended to be bound to \fBTAB\fP, but is unbound 906by default. 907.TP 908.B delete\-char\-or\-list 909Deletes the character under the cursor if not at the beginning or 910end of the line (like \fBdelete-char\fP). 911If at the end of the line, behaves identically to 912\fBpossible-completions\fP. 913.PD 914.SS Keyboard Macros 915.PP 916.PD 0 917.TP 918.B start\-kbd\-macro (C\-x (\^) 919Begin saving the characters typed into the current keyboard macro. 920.TP 921.B end\-kbd\-macro (C\-x )\^) 922Stop saving the characters typed into the current keyboard macro 923and store the definition. 924.TP 925.B call\-last\-kbd\-macro (C\-x e) 926Re-execute the last keyboard macro defined, by making the characters 927in the macro appear as if typed at the keyboard. 928.PD 929.SS Miscellaneous 930.PP 931.PD 0 932.TP 933.B re\-read\-init\-file (C\-x C\-r) 934Read in the contents of the \fIinputrc\fP file, and incorporate 935any bindings or variable assignments found there. 936.TP 937.B abort (C\-g) 938Abort the current editing command and 939ring the terminal's bell (subject to the setting of 940.BR bell\-style ). 941.TP 942.B do\-uppercase\-version (M\-a, M\-b, M\-\fIx\fP, ...) 943If the metafied character \fIx\fP is lowercase, run the command 944that is bound to the corresponding uppercase character. 945.TP 946.B prefix\-meta (ESC) 947Metafy the next character typed. 948.SM 949.B ESC 950.B f 951is equivalent to 952.BR Meta\-f . 953.TP 954.B undo (C\-_, C\-x C\-u) 955Incremental undo, separately remembered for each line. 956.TP 957.B revert\-line (M\-r) 958Undo all changes made to this line. This is like executing the 959.B undo 960command enough times to return the line to its initial state. 961.TP 962.B tilde\-expand (M\-&) 963Perform tilde expansion on the current word. 964.TP 965.B set\-mark (C\-@, M\-<space>) 966Set the mark to the point. If a 967numeric argument is supplied, the mark is set to that position. 968.TP 969.B exchange\-point\-and\-mark (C\-x C\-x) 970Swap the point with the mark. The current cursor position is set to 971the saved position, and the old cursor position is saved as the mark. 972.TP 973.B character\-search (C\-]) 974A character is read and point is moved to the next occurrence of that 975character. A negative count searches for previous occurrences. 976.TP 977.B character\-search\-backward (M\-C\-]) 978A character is read and point is moved to the previous occurrence of that 979character. A negative count searches for subsequent occurrences. 980.TP 981.B insert\-comment (M\-#) 982Without a numeric argument, the value of the readline 983.B comment\-begin 984variable is inserted at the beginning of the current line. 985If a numeric argument is supplied, this command acts as a toggle: if 986the characters at the beginning of the line do not match the value 987of \fBcomment\-begin\fP, the value is inserted, otherwise 988the characters in \fBcomment-begin\fP are deleted from the beginning of 989the line. 990In either case, the line is accepted as if a newline had been typed. 991The default value of 992.B comment\-begin 993makes the current line a shell comment. 994If a numeric argument causes the comment character to be removed, the line 995will be executed by the shell. 996.TP 997.B dump\-functions 998Print all of the functions and their key bindings to the 999readline output stream. If a numeric argument is supplied, 1000the output is formatted in such a way that it can be made part 1001of an \fIinputrc\fP file. 1002.TP 1003.B dump\-variables 1004Print all of the settable variables and their values to the 1005readline output stream. If a numeric argument is supplied, 1006the output is formatted in such a way that it can be made part 1007of an \fIinputrc\fP file. 1008.TP 1009.B dump\-macros 1010Print all of the readline key sequences bound to macros and the 1011strings they output. If a numeric argument is supplied, 1012the output is formatted in such a way that it can be made part 1013of an \fIinputrc\fP file. 1014.TP 1015.B emacs\-editing\-mode (C\-e) 1016When in 1017.B vi 1018command mode, this causes a switch to 1019.B emacs 1020editing mode. 1021.TP 1022.B vi\-editing\-mode (M\-C\-j) 1023When in 1024.B emacs 1025editing mode, this causes a switch to 1026.B vi 1027editing mode. 1028.PD 1029.SH DEFAULT KEY BINDINGS 1030.LP 1031The following is a list of the default emacs and vi bindings. 1032Characters with the eighth bit set are written as M\-<character>, and 1033are referred to as 1034.I metafied 1035characters. 1036The printable ASCII characters not mentioned in the list of emacs 1037standard bindings are bound to the 1038.B self\-insert 1039function, which just inserts the given character into the input line. 1040In vi insertion mode, all characters not specifically mentioned are 1041bound to 1042.BR self\-insert . 1043Characters assigned to signal generation by 1044.IR stty (1) 1045or the terminal driver, such as C-Z or C-C, 1046retain that function. 1047Upper and lower case metafied characters are bound to the same function in 1048the emacs mode meta keymap. 1049The remaining characters are unbound, which causes readline 1050to ring the bell (subject to the setting of the 1051.B bell\-style 1052variable). 1053.SS Emacs Mode 1054.RS +.6i 1055.nf 1056.ta 2.5i 1057.sp 1058Emacs Standard bindings 1059.sp 1060"C-@" set-mark 1061"C-A" beginning-of-line 1062"C-B" backward-char 1063"C-D" delete-char 1064"C-E" end-of-line 1065"C-F" forward-char 1066"C-G" abort 1067"C-H" backward-delete-char 1068"C-I" complete 1069"C-J" accept-line 1070"C-K" kill-line 1071"C-L" clear-screen 1072"C-M" accept-line 1073"C-N" next-history 1074"C-P" previous-history 1075"C-Q" quoted-insert 1076"C-R" reverse-search-history 1077"C-S" forward-search-history 1078"C-T" transpose-chars 1079"C-U" unix-line-discard 1080"C-V" quoted-insert 1081"C-W" unix-word-rubout 1082"C-Y" yank 1083"C-]" character-search 1084"C-_" undo 1085"\^ " to "/" self-insert 1086"0" to "9" self-insert 1087":" to "~" self-insert 1088"C-?" backward-delete-char 1089.PP 1090Emacs Meta bindings 1091.sp 1092"M-C-G" abort 1093"M-C-H" backward-kill-word 1094"M-C-I" tab-insert 1095"M-C-J" vi-editing-mode 1096"M-C-M" vi-editing-mode 1097"M-C-R" revert-line 1098"M-C-Y" yank-nth-arg 1099"M-C-[" complete 1100"M-C-]" character-search-backward 1101"M-space" set-mark 1102"M-#" insert-comment 1103"M-&" tilde-expand 1104"M-*" insert-completions 1105"M--" digit-argument 1106"M-." yank-last-arg 1107"M-0" digit-argument 1108"M-1" digit-argument 1109"M-2" digit-argument 1110"M-3" digit-argument 1111"M-4" digit-argument 1112"M-5" digit-argument 1113"M-6" digit-argument 1114"M-7" digit-argument 1115"M-8" digit-argument 1116"M-9" digit-argument 1117"M-<" beginning-of-history 1118"M-=" possible-completions 1119"M->" end-of-history 1120"M-?" possible-completions 1121"M-B" backward-word 1122"M-C" capitalize-word 1123"M-D" kill-word 1124"M-F" forward-word 1125"M-L" downcase-word 1126"M-N" non-incremental-forward-search-history 1127"M-P" non-incremental-reverse-search-history 1128"M-R" revert-line 1129"M-T" transpose-words 1130"M-U" upcase-word 1131"M-Y" yank-pop 1132"M-\e" delete-horizontal-space 1133"M-~" tilde-expand 1134"M-C-?" backward-kill-word 1135"M-_" yank-last-arg 1136.PP 1137Emacs Control-X bindings 1138.sp 1139"C-XC-G" abort 1140"C-XC-R" re-read-init-file 1141"C-XC-U" undo 1142"C-XC-X" exchange-point-and-mark 1143"C-X(" start-kbd-macro 1144"C-X)" end-kbd-macro 1145"C-XE" call-last-kbd-macro 1146"C-XC-?" backward-kill-line 1147.sp 1148.RE 1149.SS VI Mode bindings 1150.RS +.6i 1151.nf 1152.ta 2.5i 1153.sp 1154.PP 1155VI Insert Mode functions 1156.sp 1157"C-D" vi-eof-maybe 1158"C-H" backward-delete-char 1159"C-I" complete 1160"C-J" accept-line 1161"C-M" accept-line 1162"C-R" reverse-search-history 1163"C-S" forward-search-history 1164"C-T" transpose-chars 1165"C-U" unix-line-discard 1166"C-V" quoted-insert 1167"C-W" unix-word-rubout 1168"C-Y" yank 1169"C-[" vi-movement-mode 1170"C-_" undo 1171"\^ " to "~" self-insert 1172"C-?" backward-delete-char 1173.PP 1174VI Command Mode functions 1175.sp 1176"C-D" vi-eof-maybe 1177"C-E" emacs-editing-mode 1178"C-G" abort 1179"C-H" backward-char 1180"C-J" accept-line 1181"C-K" kill-line 1182"C-L" clear-screen 1183"C-M" accept-line 1184"C-N" next-history 1185"C-P" previous-history 1186"C-Q" quoted-insert 1187"C-R" reverse-search-history 1188"C-S" forward-search-history 1189"C-T" transpose-chars 1190"C-U" unix-line-discard 1191"C-V" quoted-insert 1192"C-W" unix-word-rubout 1193"C-Y" yank 1194"C-_" vi-undo 1195"\^ " forward-char 1196"#" insert-comment 1197"$" end-of-line 1198"%" vi-match 1199"&" vi-tilde-expand 1200"*" vi-complete 1201"+" next-history 1202"," vi-char-search 1203"-" previous-history 1204"." vi-redo 1205"/" vi-search 1206"0" beginning-of-line 1207"1" to "9" vi-arg-digit 1208";" vi-char-search 1209"=" vi-complete 1210"?" vi-search 1211"A" vi-append-eol 1212"B" vi-prev-word 1213"C" vi-change-to 1214"D" vi-delete-to 1215"E" vi-end-word 1216"F" vi-char-search 1217"G" vi-fetch-history 1218"I" vi-insert-beg 1219"N" vi-search-again 1220"P" vi-put 1221"R" vi-replace 1222"S" vi-subst 1223"T" vi-char-search 1224"U" revert-line 1225"W" vi-next-word 1226"X" backward-delete-char 1227"Y" vi-yank-to 1228"\e" vi-complete 1229"^" vi-first-print 1230"_" vi-yank-arg 1231"`" vi-goto-mark 1232"a" vi-append-mode 1233"b" vi-prev-word 1234"c" vi-change-to 1235"d" vi-delete-to 1236"e" vi-end-word 1237"f" vi-char-search 1238"h" backward-char 1239"i" vi-insertion-mode 1240"j" next-history 1241"k" prev-history 1242"l" forward-char 1243"m" vi-set-mark 1244"n" vi-search-again 1245"p" vi-put 1246"r" vi-change-char 1247"s" vi-subst 1248"t" vi-char-search 1249"u" vi-undo 1250"w" vi-next-word 1251"x" vi-delete 1252"y" vi-yank-to 1253"|" vi-column 1254"~" vi-change-case 1255.RE 1256.SH "SEE ALSO" 1257.PD 0 1258.TP 1259\fIThe Gnu Readline Library\fP, Brian Fox and Chet Ramey 1260.TP 1261\fIThe Gnu History Library\fP, Brian Fox and Chet Ramey 1262.TP 1263\fIbash\fP(1) 1264.PD 1265.SH FILES 1266.PD 0 1267.TP 1268.FN ~/.inputrc 1269Individual \fBreadline\fP initialization file 1270.PD 1271.SH AUTHORS 1272Brian Fox, Free Software Foundation 1273.br 1274bfox@gnu.org 1275.PP 1276Chet Ramey, Case Western Reserve University 1277.br 1278chet@ins.CWRU.Edu 1279.SH BUG REPORTS 1280If you find a bug in 1281.B readline, 1282you should report it. But first, you should 1283make sure that it really is a bug, and that it appears in the latest 1284version of the 1285.B readline 1286library that you have. 1287.PP 1288Once you have determined that a bug actually exists, mail a 1289bug report to \fIbug\-readline\fP@\fIgnu.org\fP. 1290If you have a fix, you are welcome to mail that 1291as well! Suggestions and `philosophical' bug reports may be mailed 1292to \fPbug-readline\fP@\fIgnu.org\fP or posted to the Usenet 1293newsgroup 1294.BR gnu.bash.bug . 1295.PP 1296Comments and bug reports concerning 1297this manual page should be directed to 1298.IR chet@ins.CWRU.Edu . 1299.SH BUGS 1300.PP 1301It's too big and too slow.
|