comparison readline/doc/readline.0 @ 2996:9d4e3a9de17e

[project @ 1997-05-22 20:58:07 by jwe]
author jwe
date Thu, 22 May 1997 20:59:27 +0000
parents
children
comparison
equal deleted inserted replaced
2995:953ce4558485 2996:9d4e3a9de17e
1
2
3
4 READLINE(3) READLINE(3)
5
6
7 NNAAMMEE
8 readline - get a line from a user with editing
9
10 SSYYNNOOPPSSIISS
11 ##iinncclluuddee <<rreeaaddlliinnee..hh>>
12 ##iinncclluuddee <<hhiissttoorryy..hh>>
13
14 cchhaarr **rreeaaddlliinnee ((pprroommpptt))
15 cchhaarr **pprroommpptt;;
16
17 CCOOPPYYRRIIGGHHTT
18 Readline is Copyright (C) 1989, 1991, 1993, 1995, 1996 by
19 the Free Software Foundation, Inc.
20
21 DDEESSCCRRIIPPTTIIOONN
22 rreeaaddlliinnee will read a line from the terminal and return it,
23 using pprroommpptt as a prompt. If pprroommpptt is null, no prompt is
24 issued. The line returned is allocated with _m_a_l_l_o_c(3), so
25 the caller must free it when finished. The line returned
26 has the final newline removed, so only the text of the
27 line remains.
28
29 rreeaaddlliinnee offers editing capabilities while the user is
30 entering the line. By default, the line editing commands
31 are similar to those of emacs. A vi-style line editing
32 interface is also available.
33
34 RREETTUURRNN VVAALLUUEE
35 rreeaaddlliinnee returns the text of the line read. A blank line
36 returns the empty string. If EEOOFF is encountered while
37 reading a line, and the line is empty, NNUULLLL is returned.
38 If an EEOOFF is read with a non-empty line, it is treated as
39 a newline.
40
41 NNOOTTAATTIIOONN
42 An emacs-style notation is used to denote keystrokes.
43 Control keys are denoted by C-_k_e_y, e.g., C-n means Con-
44 trol-N. Similarly, _m_e_t_a keys are denoted by M-_k_e_y, so M-x
45 means Meta-X. (On keyboards without a _m_e_t_a key, M-_x means
46 ESC _x, i.e., press the Escape key then the _x key. This
47 makes ESC the _m_e_t_a _p_r_e_f_i_x. The combination M-C-_x means
48 ESC-Control-_x, or press the Escape key then hold the Con-
49 trol key while pressing the _x key.)
50
51 Readline commands may be given numeric _a_r_g_u_m_e_n_t_s, which
52 normally act as a repeat count. Sometimes, however, it is
53 the sign of the argument that is significant. Passing a
54 negative argument to a command that acts in the forward
55 direction (e.g., kkiillll--lliinnee) causes that command to act in
56 a backward direction. Commands whose behavior with argu-
57 ments deviates from this are noted.
58
59 When a command is described as _k_i_l_l_i_n_g text, the text
60 deleted is saved for possible future retrieval (_y_a_n_k_i_n_g).
61
62
63
64 GNU 1997 Feb 5 1
65
66
67
68
69
70 READLINE(3) READLINE(3)
71
72
73 The killed text is saved in a _k_i_l_l _r_i_n_g. Consecutive
74 kills cause the text to be accumulated into one unit,
75 which can be yanked all at once. Commands which do not
76 kill text separate the chunks of text on the kill ring.
77
78 IINNIITTIIAALLIIZZAATTIIOONN FFIILLEE
79 Readline is customized by putting commands in an initial-
80 ization file (the _i_n_p_u_t_r_c file). The name of this file is
81 taken from the value of the IINNPPUUTTRRCC environment variable.
82 If that variable is unset, the default is _~_/_._i_n_p_u_t_r_c.
83 When a program which uses the readline library starts up,
84 the init file is read, and the key bindings and variables
85 are set. There are only a few basic constructs allowed in
86 the readline init file. Blank lines are ignored. Lines
87 beginning with a ## are comments. Lines beginning with a $$
88 indicate conditional constructs. Other lines denote key
89 bindings and variable settings. Each program using this
90 library may add its own commands and bindings.
91
92 For example, placing
93
94 M-Control-u: universal-argument
95 or
96 C-Meta-u: universal-argument
97 into the _i_n_p_u_t_r_c would make M-C-u execute the readline
98 command _u_n_i_v_e_r_s_a_l_-_a_r_g_u_m_e_n_t.
99
100 The following symbolic character names are recognized
101 while processing key bindings: _R_U_B_O_U_T, _D_E_L, _E_S_C, _L_F_D, _N_E_W_-
102 _L_I_N_E, _R_E_T, _R_E_T_U_R_N, _S_P_C, _S_P_A_C_E, and _T_A_B. In addition to
103 command names, readline allows keys to be bound to a
104 string that is inserted when the key is pressed (a _m_a_c_r_o).
105
106
107 KKeeyy BBiinnddiinnggss
108 The syntax for controlling key bindings in the _i_n_p_u_t_r_c
109 file is simple. All that is required is the name of the
110 command or the text of a macro and a key sequence to which
111 it should be bound. The name may be specified in one of
112 two ways: as a symbolic key name, possibly with _M_e_t_a_- or
113 _C_o_n_t_r_o_l_- prefixes, or as a key sequence. When using the
114 form kkeeyynnaammee:_f_u_n_c_t_i_o_n_-_n_a_m_e or _m_a_c_r_o, _k_e_y_n_a_m_e is the name
115 of a key spelled out in English. For example:
116
117 Control-u: universal-argument
118 Meta-Rubout: backward-kill-word
119 Control-o: ">&output"
120
121 In the above example, _C_-_u is bound to the function uunniivveerr--
122 ssaall--aarrgguummeenntt, _M_-_D_E_L is bound to the function bbaacckk--
123 wwaarrdd--kkiillll--wwoorrdd, and _C_-_o is bound to run the macro
124 expressed on the right hand side (that is, to insert the
125 text _>_&_o_u_t_p_u_t into the line).
126
127
128
129
130 GNU 1997 Feb 5 2
131
132
133
134
135
136 READLINE(3) READLINE(3)
137
138
139 In the second form, ""kkeeyysseeqq"":_f_u_n_c_t_i_o_n_-_n_a_m_e or _m_a_c_r_o, kkeeyy--
140 sseeqq differs from kkeeyynnaammee above in that strings denoting an
141 entire key sequence may be specified by placing the
142 sequence within double quotes. Some GNU Emacs style key
143 escapes can be used, as in the following example.
144
145 "\C-u": universal-argument
146 "\C-x\C-r": re-read-init-file
147 "\e[11~": "Function Key 1"
148
149 In this example, _C_-_u is again bound to the function uunnii--
150 vveerrssaall--aarrgguummeenntt. _C_-_x _C_-_r is bound to the function
151 rree--rreeaadd--iinniitt--ffiillee, and _E_S_C _[ _1 _1 _~ is bound to insert the
152 text FFuunnccttiioonn KKeeyy 11. The full set of escape sequences is
153
154 \\CC-- control prefix
155
156 \\MM-- meta prefix
157
158 \\ee an escape character
159
160 \\\\ backslash
161
162 \\"" literal "
163
164 \\'' literal '
165
166 When entering the text of a macro, single or double quotes
167 should be used to indicate a macro definition. Unquoted
168 text is assumed to be a function name. Backslash will
169 quote any character in the macro text, including " and '.
170
171 BBaasshh allows the current readline key bindings to be dis-
172 played or modified with the bbiinndd builtin command. The
173 editing mode may be switched during interactive use by
174 using the --oo option to the sseett builtin command. Other
175 programs using this library provide similar mechanisms.
176 The _i_n_p_u_t_r_c file may be edited and re-read if a program
177 does not provide any other means to incorporate new bind-
178 ings.
179
180 VVaarriiaabblleess
181 Readline has variables that can be used to further cus-
182 tomize its behavior. A variable may be set in the _i_n_p_u_t_r_c
183 file with a statement of the form
184
185 sseett _v_a_r_i_a_b_l_e_-_n_a_m_e _v_a_l_u_e
186
187 Except where noted, readline variables can take the values
188 OOnn or OOffff. The variables and their default values are:
189
190 bbeellll--ssttyyllee ((aauuddiibbllee))
191 Controls what happens when readline wants to ring
192 the terminal bell. If set to nnoonnee, readline never
193
194
195
196 GNU 1997 Feb 5 3
197
198
199
200
201
202 READLINE(3) READLINE(3)
203
204
205 rings the bell. If set to vviissiibbllee, readline uses a
206 visible bell if one is available. If set to aauuddii--
207 bbllee, readline attempts to ring the terminal's bell.
208 ccoommmmeenntt--bbeeggiinn ((````##''''))
209 The string that is inserted in vvii mode when the
210 iinnsseerrtt--ccoommmmeenntt command is executed. This command
211 is bound to MM--## in emacs mode and to ## in vi com-
212 mand mode.
213 ccoommpplleettiioonn--qquueerryy--iitteemmss ((110000))
214 This determines when the user is queried about
215 viewing the number of possible completions gener-
216 ated by the ppoossssiibbllee--ccoommpplleettiioonnss command. It may
217 be set to any integer value greater than or equal
218 to zero. If the number of possible completions is
219 greater than or equal to the value of this vari-
220 able, the user is asked whether or not he wishes to
221 view them; otherwise they are simply listed on the
222 terminal.
223 ccoonnvveerrtt--mmeettaa ((OOnn))
224 If set to OOnn, readline will convert characters with
225 the eighth bit set to an ASCII key sequence by
226 stripping the eighth bit and prepending an escape
227 character (in effect, using escape as the _m_e_t_a _p_r_e_-
228 _f_i_x).
229 ddiissaabbllee--ccoommpplleettiioonn ((OOffff))
230 If set to OOnn, readline will inhibit word comple-
231 tion. Completion characters will be inserted into
232 the line as if they had been mapped to sseellff--iinnsseerrtt.
233 eeddiittiinngg--mmooddee ((eemmaaccss))
234 Controls whether readline begins with a set of key
235 bindings similar to _e_m_a_c_s or _v_i. eeddiittiinngg--mmooddee can
236 be set to either eemmaaccss or vvii.
237 eennaabbllee--kkeeyyppaadd ((OOffff))
238 When set to OOnn, readline will try to enable the
239 application keypad when it is called. Some systems
240 need this to enable the arrow keys.
241 eexxppaanndd--ttiillddee ((OOffff))
242 If set to oonn, tilde expansion is performed when
243 readline attempts word completion.
244 hhoorriizzoonnttaall--ssccrroollll--mmooddee ((OOffff))
245 When set to OOnn, makes readline use a single line
246 for display, scrolling the input horizontally on a
247 single screen line when it becomes longer than the
248 screen width rather than wrapping to a new line.
249 kkeeyymmaapp ((eemmaaccss))
250 Set the current readline keymap. The set of legal
251 keymap names is _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_,
252 _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_m_o_v_e_, _v_i_-_c_o_m_m_a_n_d, and _v_i_-_i_n_s_e_r_t.
253 _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d; _e_m_a_c_s is equivalent
254 to _e_m_a_c_s_-_s_t_a_n_d_a_r_d. The default value is _e_m_a_c_s; the
255 value of eeddiittiinngg--mmooddee also affects the default
256 keymap.
257 mmaarrkk--ddiirreeccttoorriieess ((OOnn))
258 If set to OOnn, completed directory names have a
259
260
261
262 GNU 1997 Feb 5 4
263
264
265
266
267
268 READLINE(3) READLINE(3)
269
270
271 slash appended.
272 mmaarrkk--mmooddiiffiieedd--lliinneess ((OOffff))
273 If set to OOnn, history lines that have been modified
274 are displayed with a preceding asterisk (**).
275 mmeettaa--ffllaagg ((OOffff))
276 If set to OOnn, readline will enable eight-bit input
277 (that is, it will not strip the high bit from the
278 characters it reads), regardless of what the termi-
279 nal claims it can support.
280 oouuttppuutt--mmeettaa ((OOffff))
281 If set to OOnn, readline will display characters with
282 the eighth bit set directly rather than as a meta-
283 prefixed escape sequence.
284 sshhooww--aallll--iiff--aammbbiigguuoouuss ((OOffff))
285 This alters the default behavior of the completion
286 functions. If set to oonn, words which have more
287 than one possible completion cause the matches to
288 be listed immediately instead of ringing the bell.
289 vviissiibbllee--ssttaattss ((OOffff))
290 If set to OOnn, a character denoting a file's type as
291 reported by ssttaatt(2) is appended to the filename
292 when listing possible completions.
293
294 CCoonnddiittiioonnaall CCoonnssttrruuccttss
295 Readline implements a facility similar in spirit to the
296 conditional compilation features of the C preprocessor
297 which allows key bindings and variable settings to be per-
298 formed as the result of tests. There are three parser
299 directives used.
300
301 $$iiff The $$iiff construct allows bindings to be made based
302 on the editing mode, the terminal being used, or
303 the application using readline. The text of the
304 test extends to the end of the line; no characters
305 are required to isolate it.
306
307 mmooddee The mmooddee== form of the $$iiff directive is used
308 to test whether readline is in emacs or vi
309 mode. This may be used in conjunction with
310 the sseett kkeeyymmaapp command, for instance, to set
311 bindings in the _e_m_a_c_s_-_s_t_a_n_d_a_r_d and _e_m_a_c_s_-
312 _c_t_l_x keymaps only if readline is starting
313 out in emacs mode.
314
315 tteerrmm The tteerrmm== form may be used to include termi-
316 nal-specific key bindings, perhaps to bind
317 the key sequences output by the terminal's
318 function keys. The word on the right side
319 of the == is tested against the full name of
320 the terminal and the portion of the terminal
321 name before the first --. This allows _s_u_n to
322 match both _s_u_n and _s_u_n_-_c_m_d, for instance.
323
324
325
326
327
328 GNU 1997 Feb 5 5
329
330
331
332
333
334 READLINE(3) READLINE(3)
335
336
337 aapppplliiccaattiioonn
338 The aapppplliiccaattiioonn construct is used to include
339 application-specific settings. Each program
340 using the readline library sets the _a_p_p_l_i_c_a_-
341 _t_i_o_n _n_a_m_e, and an initialization file can
342 test for a particular value. This could be
343 used to bind key sequences to functions use-
344 ful for a specific program. For instance,
345 the following command adds a key sequence
346 that quotes the current or previous word in
347 Bash:
348 $$iiff bash
349 # Quote the current or previous word
350 "\C-xq": "\eb\"\ef\""
351 $$eennddiiff
352
353 $$eennddiiff This command, as you saw in the previous example,
354 terminates an $$iiff command.
355
356 $$eellssee Commands in this branch of the $$iiff directive are
357 executed if the test fails.
358
359 SSEEAARRCCHHIINNGG
360 Readline provides commands for searching through the com-
361 mand history for lines containing a specified string.
362 There are two search modes: _i_n_c_r_e_m_e_n_t_a_l and _n_o_n_-
363 _i_n_c_r_e_m_e_n_t_a_l.
364
365 Incremental searches begin before the user has finished
366 typing the search string. As each character of the search
367 string is typed, readline displays the next entry from the
368 history matching the string typed so far. An incremental
369 search requires only as many characters as needed to find
370 the desired history entry. The Escape character is used
371 to terminate an incremental search. Control-J will also
372 terminate the search. Control-G will abort an incremental
373 search and restore the original line. When the search is
374 terminated, the history entry containing the search string
375 becomes the current line. To find other matching entries
376 in the history list, type Control-S or Control-R as appro-
377 priate. This will search backward or forward in the his-
378 tory for the next line matching the search string typed so
379 far. Any other key sequence bound to a readline command
380 will terminate the search and execute that command. For
381 instance, a _n_e_w_l_i_n_e will terminate the search and accept
382 the line, thereby executing the command from the history
383 list.
384
385 Non-incremental searches read the entire search string
386 before starting to search for matching history lines. The
387 search string may be typed by the user or part of the con-
388 tents of the current line.
389
390
391
392
393
394 GNU 1997 Feb 5 6
395
396
397
398
399
400 READLINE(3) READLINE(3)
401
402
403 EEDDIITTIINNGG CCOOMMMMAANNDDSS
404 The following is a list of the names of the commands and
405 the default key sequences to which they are bound. Com-
406 mand names without an accompanying key sequence are
407 unbound by default.
408
409 CCoommmmaannddss ffoorr MMoovviinngg
410 bbeeggiinnnniinngg--ooff--lliinnee ((CC--aa))
411 Move to the start of the current line.
412 eenndd--ooff--lliinnee ((CC--ee))
413 Move to the end of the line.
414 ffoorrwwaarrdd--cchhaarr ((CC--ff))
415 Move forward a character.
416 bbaacckkwwaarrdd--cchhaarr ((CC--bb))
417 Move back a character.
418 ffoorrwwaarrdd--wwoorrdd ((MM--ff))
419 Move forward to the end of the next word. Words
420 are composed of alphanumeric characters (letters
421 and digits).
422 bbaacckkwwaarrdd--wwoorrdd ((MM--bb))
423 Move back to the start of this, or the previous,
424 word. Words are composed of alphanumeric charac-
425 ters (letters and digits).
426 cclleeaarr--ssccrreeeenn ((CC--ll))
427 Clear the screen leaving the current line at the
428 top of the screen. With an argument, refresh the
429 current line without clearing the screen.
430 rreeddrraaww--ccuurrrreenntt--lliinnee
431 Refresh the current line.
432
433 CCoommmmaannddss ffoorr MMaanniippuullaattiinngg tthhee HHiissttoorryy
434 aacccceepptt--lliinnee ((NNeewwlliinnee,, RReettuurrnn))
435 Accept the line regardless of where the cursor is.
436 If this line is non-empty, add it to the history
437 list. If the line is a modified history line, then
438 restore the history line to its original state.
439 pprreevviioouuss--hhiissttoorryy ((CC--pp))
440 Fetch the previous command from the history list,
441 moving back in the list.
442 nneexxtt--hhiissttoorryy ((CC--nn))
443 Fetch the next command from the history list, mov-
444 ing forward in the list.
445 bbeeggiinnnniinngg--ooff--hhiissttoorryy ((MM--<<))
446 Move to the first line in the history.
447 eenndd--ooff--hhiissttoorryy ((MM-->>))
448 Move to the end of the input history, i.e., the
449 line currently being entered.
450 rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((CC--rr))
451 Search backward starting at the current line and
452 moving `up' through the history as necessary. This
453 is an incremental search.
454 ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((CC--ss))
455 Search forward starting at the current line and
456 moving `down' through the history as necessary.
457
458
459
460 GNU 1997 Feb 5 7
461
462
463
464
465
466 READLINE(3) READLINE(3)
467
468
469 This is an incremental search.
470 nnoonn--iinnccrreemmeennttaall--rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((MM--pp))
471 Search backward through the history starting at the
472 current line using a non-incremental search for a
473 string supplied by the user.
474 nnoonn--iinnccrreemmeennttaall--ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((MM--nn))
475 Search forward through the history using a non-
476 incremental search for a string supplied by the
477 user.
478 hhiissttoorryy--sseeaarrcchh--ffoorrwwaarrdd
479 Search forward through the history for the string
480 of characters between the start of the current line
481 and the current cursor position (the _p_o_i_n_t). This
482 is a non-incremental search.
483 hhiissttoorryy--sseeaarrcchh--bbaacckkwwaarrdd
484 Search backward through the history for the string
485 of characters between the start of the current line
486 and the point. This is a non-incremental search.
487 yyaannkk--nntthh--aarrgg ((MM--CC--yy))
488 Insert the first argument to the previous command
489 (usually the second word on the previous line) at
490 point (the current cursor position). With an argu-
491 ment _n, insert the _nth word from the previous com-
492 mand (the words in the previous command begin with
493 word 0). A negative argument inserts the _nth word
494 from the end of the previous command.
495 yyaannkk--llaasstt--aarrgg ((MM--..,, MM--__))
496 Insert the last argument to the previous command
497 (the last word of the previous history entry).
498 With an argument, behave exactly like yyaannkk--nntthh--aarrgg.
499
500 CCoommmmaannddss ffoorr CChhaannggiinngg TTeexxtt
501 ddeelleettee--cchhaarr ((CC--dd))
502 Delete the character under the cursor. If point is
503 at the beginning of the line, there are no charac-
504 ters in the line, and the last character typed was
505 not CC--dd, then return EEOOFF.
506 bbaacckkwwaarrdd--ddeelleettee--cchhaarr ((RRuubboouutt))
507 Delete the character behind the cursor. When given
508 a numeric argument, save the deleted text on the
509 kill ring.
510 qquuootteedd--iinnsseerrtt ((CC--qq,, CC--vv))
511 Add the next character that you type to the line
512 verbatim. This is how to insert characters like
513 CC--qq, for example.
514 ttaabb--iinnsseerrtt ((MM--TTAABB))
515 Insert a tab character.
516 sseellff--iinnsseerrtt ((aa,, bb,, AA,, 11,, !!,, ......))
517 Insert the character typed.
518 ttrraannssppoossee--cchhaarrss ((CC--tt))
519 Drag the character before point forward over the
520 character at point. Point moves forward as well.
521 If point is at the end of the line, then transpose
522 the two characters before point. Negative
523
524
525
526 GNU 1997 Feb 5 8
527
528
529
530
531
532 READLINE(3) READLINE(3)
533
534
535 arguments don't work.
536 ttrraannssppoossee--wwoorrddss ((MM--tt))
537 Drag the word behind the cursor past the word in
538 front of the cursor moving the cursor over that
539 word as well.
540 uuppccaassee--wwoorrdd ((MM--uu))
541 Uppercase the current (or following) word. With a
542 negative argument, do the previous word, but do not
543 move point.
544 ddoowwnnccaassee--wwoorrdd ((MM--ll))
545 Lowercase the current (or following) word. With a
546 negative argument, do the previous word, but do not
547 move point.
548 ccaappiittaalliizzee--wwoorrdd ((MM--cc))
549 Capitalize the current (or following) word. With a
550 negative argument, do the previous word, but do not
551 move point.
552
553 KKiilllliinngg aanndd YYaannkkiinngg
554 kkiillll--lliinnee ((CC--kk))
555 Kill the text from the current cursor position to
556 the end of the line.
557 bbaacckkwwaarrdd--kkiillll--lliinnee ((CC--xx RRuubboouutt))
558 Kill backward to the beginning of the line.
559 uunniixx--lliinnee--ddiissccaarrdd ((CC--uu))
560 Kill backward from point to the beginning of the
561 line.
562 kkiillll--wwhhoollee--lliinnee
563 Kill all characters on the current line, no matter
564 where the cursor is.
565 kkiillll--wwoorrdd ((MM--dd))
566 Kill from the cursor to the end of the current
567 word, or if between words, to the end of the next
568 word. Word boundaries are the same as those used
569 by ffoorrwwaarrdd--wwoorrdd.
570 bbaacckkwwaarrdd--kkiillll--wwoorrdd ((MM--RRuubboouutt))
571 Kill the word behind the cursor. Word boundaries
572 are the same as those used by bbaacckkwwaarrdd--wwoorrdd.
573 uunniixx--wwoorrdd--rruubboouutt ((CC--ww))
574 Kill the word behind the cursor, using white space
575 as a word boundary. The word boundaries are dif-
576 ferent from bbaacckkwwaarrdd--kkiillll--wwoorrdd.
577 ddeelleettee--hhoorriizzoonnttaall--ssppaaccee ((MM--\\))
578 Delete all spaces and tabs around point.
579 kkiillll--rreeggiioonn
580 Kill the text between the point and _m_a_r_k (saved
581 cursor position). This text is referred to as the
582 _r_e_g_i_o_n.
583 ccooppyy--rreeggiioonn--aass--kkiillll
584 Copy the text in the region to the kill buffer.
585 ccooppyy--bbaacckkwwaarrdd--wwoorrdd
586 Copy the word before point to the kill buffer.
587 ccooppyy--ffoorrwwaarrdd--wwoorrdd
588 Copy the word following point to the kill buffer.
589
590
591
592 GNU 1997 Feb 5 9
593
594
595
596
597
598 READLINE(3) READLINE(3)
599
600
601 yyaannkk ((CC--yy))
602 Yank the top of the kill ring into the buffer at
603 the cursor.
604 yyaannkk--ppoopp ((MM--yy))
605 Rotate the kill ring, and yank the new top. Only
606 works following yyaannkk or yyaannkk--ppoopp.
607
608 NNuummeerriicc AArrgguummeennttss
609 ddiiggiitt--aarrgguummeenntt ((MM--00,, MM--11,, ......,, MM----))
610 Add this digit to the argument already accumulat-
611 ing, or start a new argument. M-- starts a nega-
612 tive argument.
613 uunniivveerrssaall--aarrgguummeenntt
614 This is another way to specify an argument. If
615 this command is followed by one or more digits,
616 optionally with a leading minus sign, those digits
617 define the argument. If the command is followed by
618 digits, executing uunniivveerrssaall--aarrgguummeenntt again ends the
619 numeric argument, but is otherwise ignored. As a
620 special case, if this command is immediately fol-
621 lowed by a character that is neither a digit or
622 minus sign, the argument count for the next command
623 is multiplied by four. The argument count is ini-
624 tially one, so executing this function the first
625 time makes the argument count four, a second time
626 makes the argument count sixteen, and so on.
627
628 CCoommpplleettiinngg
629 ccoommpplleettee ((TTAABB))
630 Attempt to perform completion on the text before
631 point. The actual completion performed is applica-
632 tion-specific. BBaasshh, for instance, attempts com-
633 pletion treating the text as a variable (if the
634 text begins with $$), username (if the text begins
635 with ~~), hostname (if the text begins with @@), or
636 command (including aliases and functions) in turn.
637 If none of these produces a match, filename comple-
638 tion is attempted. GGddbb, on the other hand, allows
639 completion of program functions and variables, and
640 only attempts filename completion under certain
641 circumstances.
642 ppoossssiibbllee--ccoommpplleettiioonnss ((MM--??))
643 List the possible completions of the text before
644 point.
645 iinnsseerrtt--ccoommpplleettiioonnss ((MM--**))
646 Insert all completions of the text before point
647 that would have been generated by ppoossssii--
648 bbllee--ccoommpplleettiioonnss.
649
650 KKeeyybbooaarrdd MMaaccrrooss
651 ssttaarrtt--kkbbdd--mmaaccrroo ((CC--xx (())
652 Begin saving the characters typed into the current
653 keyboard macro.
654
655
656
657
658 GNU 1997 Feb 5 10
659
660
661
662
663
664 READLINE(3) READLINE(3)
665
666
667 eenndd--kkbbdd--mmaaccrroo ((CC--xx ))))
668 Stop saving the characters typed into the current
669 keyboard macro and store the definition.
670 ccaallll--llaasstt--kkbbdd--mmaaccrroo ((CC--xx ee))
671 Re-execute the last keyboard macro defined, by mak-
672 ing the characters in the macro appear as if typed
673 at the keyboard.
674
675 MMiisscceellllaanneeoouuss
676 rree--rreeaadd--iinniitt--ffiillee ((CC--xx CC--rr))
677 Read in the contents of the _i_n_p_u_t_r_c file, and
678 incorporate any bindings or variable assignments
679 found there.
680 aabboorrtt ((CC--gg))
681 Abort the current editing command and ring the ter-
682 minal's bell (subject to the setting of
683 bbeellll--ssttyyllee).
684 ddoo--uuppppeerrccaassee--vveerrssiioonn ((MM--aa,, MM--bb,, MM--_x,, ......))
685 If the metafied character _x is lowercase, run the
686 command that is bound to the corresponding upper-
687 case character.
688 pprreeffiixx--mmeettaa ((EESSCC))
689 Metafy the next character typed. EESSCC ff is equiva-
690 lent to MMeettaa--ff.
691 uunnddoo ((CC--__,, CC--xx CC--uu))
692 Incremental undo, separately remembered for each
693 line.
694 rreevveerrtt--lliinnee ((MM--rr))
695 Undo all changes made to this line. This is like
696 typing the uunnddoo command enough times to return the
697 line to its initial state.
698 ttiillddee--eexxppaanndd ((MM--~~))
699 Perform tilde expansion on the current word.
700 sseett--mmaarrkk ((CC--@@,, MM--<<ssppaaccee>>))
701 Set the mark to the current point. If a numeric
702 argument is supplied, the mark is set to that posi-
703 tion.
704 eexxcchhaannggee--ppooiinntt--aanndd--mmaarrkk ((CC--xx CC--xx))
705 Swap the point with the mark. The current cursor
706 position is set to the saved position, and the old
707 cursor position is saved as the mark.
708 cchhaarraacctteerr--sseeaarrcchh ((CC--]]))
709 A character is read and point is moved to the next
710 occurrence of that character. A negative count
711 searches for previous occurrences.
712 cchhaarraacctteerr--sseeaarrcchh--bbaacckkwwaarrdd ((MM--CC--]]))
713 A character is read and point is moved to the pre-
714 vious occurrence of that character. A negative
715 count searches for subsequent occurrences.
716 iinnsseerrtt--ccoommmmeenntt ((MM--##))
717 The value of the readline ccoommmmeenntt--bbeeggiinn variable is
718 inserted at the beginning of the current line, and
719 the line is accepted as if a newline had been
720 typed. This makes the current line a shell
721
722
723
724 GNU 1997 Feb 5 11
725
726
727
728
729
730 READLINE(3) READLINE(3)
731
732
733 comment.
734 gglloobb--eexxppaanndd--wwoorrdd ((CC--xx **))
735 The word before point is treated as a pattern for
736 pathname expansion, and the list of matching file
737 names is inserted, replacing the word.
738 gglloobb--lliisstt--eexxppaannssiioonnss ((CC--xx gg))
739 The list of expansions that would have been gener-
740 ated by gglloobb--eexxppaanndd--wwoorrdd is inserted into the line,
741 replacing the word before point.
742 dduummpp--ffuunnccttiioonnss
743 Print all of the functions and their key bindings
744 to the readline output stream. If a numeric argu-
745 ment is supplied, the output is formatted in such a
746 way that it can be made part of an _i_n_p_u_t_r_c file.
747 dduummpp--vvaarriiaabblleess
748 Print all of the settable variables and their val-
749 ues to the readline output stream. If a numeric
750 argument is supplied, the output is formatted in
751 such a way that it can be made part of an _i_n_p_u_t_r_c
752 file.
753 dduummpp--mmaaccrrooss
754 Print all of the readline key sequences bound to
755 macros and the strings they ouput. If a numeric
756 argument is supplied, the output is formatted in
757 such a way that it can be made part of an _i_n_p_u_t_r_c
758 file.
759 eemmaaccss--eeddiittiinngg--mmooddee ((CC--ee))
760 When in vvii editing mode, this causes a switch to
761 eemmaaccss editing mode.
762 vvii--eeddiittiinngg--mmooddee ((MM--CC--jj))
763 When in eemmaaccss editing mode, this causes a switch to
764 vvii editing mode.
765
766 DDEEFFAAUULLTT KKEEYY BBIINNDDIINNGGSS
767 The following is a list of the default emacs and vi bind-
768 ings. Characters with the 8th bit set are written as
769 M-<character>, and are referred to as _m_e_t_a_f_i_e_d characters.
770 The printable ASCII characters not mentioned in the list
771 of emacs standard bindings are bound to the _s_e_l_f_-_i_n_s_e_r_t
772 function, which just inserts the given character into the
773 input line. In vi insertion mode, all characters not
774 specifically mentioned are bound to _s_e_l_f_-_i_n_s_e_r_t. Charac-
775 ters assigned to signal generation by _s_t_t_y(1) or the ter-
776 minal driver, such as C-Z or C-C, retain that function.
777 Upper and lower case _m_e_t_a_f_i_e_d characters are bound to the
778 same function in the emacs mode meta keymap. The remain-
779 ing characters are unbound, which causes readline to ring
780 the bell (subject to the setting of the bbeellll--ssttyyllee vari-
781 able).
782
783 EEmmaaccss MMooddee
784 Emacs Standard bindings
785
786 "C-@" set-mark
787
788
789
790 GNU 1997 Feb 5 12
791
792
793
794
795
796 READLINE(3) READLINE(3)
797
798
799 "C-A" beginning-of-line
800 "C-B" backward-char
801 "C-D" delete-char
802 "C-E" end-of-line
803 "C-F" forward-char
804 "C-G" abort
805 "C-H" backward-delete-char
806 "C-I" complete
807 "C-J" accept-line
808 "C-K" kill-line
809 "C-L" clear-screen
810 "C-M" accept-line
811 "C-N" next-history
812 "C-P" previous-history
813 "C-Q" quoted-insert
814 "C-R" reverse-search-history
815 "C-S" forward-search-history
816 "C-T" transpose-chars
817 "C-U" unix-line-discard
818 "C-V" quoted-insert
819 "C-W" unix-word-rubout
820 "C-Y" yank
821 "C-]" character-search
822 "C-_" undo
823 " " to "/" self-insert
824 "0" to "9" self-insert
825 ":" to "~" self-insert
826 "C-?" backward-delete-char
827
828 Emacs Meta bindings
829
830 "M-C-G" abort
831 "M-C-H" backward-kill-word
832 "M-C-I" tab-insert
833 "M-C-J" vi-editing-mode
834 "M-C-M" vi-editing-mode
835 "M-C-R" revert-line
836 "M-C-Y" yank-nth-arg
837 "M-C-[" complete
838 "M-C-]" character-search-backward
839 "M-space" set-mark
840 "M-#" insert-comment
841 "M-&" tilde-expand
842 "M-*" insert-completions
843 "M--" digit-argument
844 "M-." yank-last-arg
845 "M-0" digit-argument
846 "M-1" digit-argument
847 "M-2" digit-argument
848 "M-3" digit-argument
849 "M-4" digit-argument
850 "M-5" digit-argument
851 "M-6" digit-argument
852 "M-7" digit-argument
853
854
855
856 GNU 1997 Feb 5 13
857
858
859
860
861
862 READLINE(3) READLINE(3)
863
864
865 "M-8" digit-argument
866 "M-9" digit-argument
867 "M-<" beginning-of-history
868 "M-=" possible-completions
869 "M->" end-of-history
870 "M-?" possible-completions
871 "M-B" backward-word
872 "M-C" capitalize-word
873 "M-D" kill-word
874 "M-F" forward-word
875 "M-L" downcase-word
876 "M-N" non-incremental-forward-search-history
877 "M-P" non-incremental-reverse-search-history
878 "M-R" revert-line
879 "M-T" transpose-words
880 "M-U" upcase-word
881 "M-Y" yank-pop
882 "M-\" delete-horizontal-space
883 "M-~" tilde-expand
884 "M-C-?" backward-delete-word
885 "M-_" yank-last-arg
886
887 Emacs Control-X bindings
888
889 "C-XC-G" abort
890 "C-XC-R" re-read-init-file
891 "C-XC-U" undo
892 "C-XC-X" exchange-point-and-mark
893 "C-X(" start-kbd-macro
894 "C-X)" end-kbd-macro
895 "C-XE" call-last-kbd-macro
896 "C-XC-?" backward-kill-line
897
898
899 VVII MMooddee bbiinnddiinnggss
900 VI Insert Mode functions
901
902 "C-D" vi-eof-maybe
903 "C-H" backward-delete-char
904 "C-I" complete
905 "C-J" accept-line
906 "C-M" accept-line
907 "C-R" reverse-search-history
908 "C-S" forward-search-history
909 "C-T" transpose-chars
910 "C-U" unix-line-discard
911 "C-V" quoted-insert
912 "C-W" unix-word-rubout
913 "C-Y" yank
914 "C-[" vi-movement-mode
915 "C-_" undo
916 " " to "~" self-insert
917 "C-?" backward-delete-char
918
919
920
921
922 GNU 1997 Feb 5 14
923
924
925
926
927
928 READLINE(3) READLINE(3)
929
930
931 VI Command Mode functions
932
933 "C-D" vi-eof-maybe
934 "C-E" emacs-editing-mode
935 "C-G" abort
936 "C-H" backward-char
937 "C-J" accept-line
938 "C-K" kill-line
939 "C-L" clear-screen
940 "C-M" accept-line
941 "C-N" next-history
942 "C-P" previous-history
943 "C-Q" quoted-insert
944 "C-R" reverse-search-history
945 "C-S" forward-search-history
946 "C-T" transpose-chars
947 "C-U" unix-line-discard
948 "C-V" quoted-insert
949 "C-W" unix-word-rubout
950 "C-Y" yank
951 " " forward-char
952 "#" insert-comment
953 "$" end-of-line
954 "%" vi-match
955 "&" vi-tilde-expand
956 "*" vi-complete
957 "+" next-history
958 "," vi-char-search
959 "-" previous-history
960 "." vi-redo
961 "/" vi-search
962 "0" beginning-of-line
963 "1" to "9" vi-arg-digit
964 ";" vi-char-search
965 "=" vi-complete
966 "?" vi-search
967 "A" vi-append-eol
968 "B" vi-prev-word
969 "C" vi-change-to
970 "D" vi-delete-to
971 "E" vi-end-word
972 "F" vi-char-search
973 "G" vi-fetch-history
974 "I" vi-insert-beg
975 "N" vi-search-again
976 "P" vi-put
977 "R" vi-replace
978 "S" vi-subst
979 "T" vi-char-search
980 "U" revert-line
981 "W" vi-next-word
982 "X" backward-delete-char
983 "Y" vi-yank-to
984 "\" vi-complete
985
986
987
988 GNU 1997 Feb 5 15
989
990
991
992
993
994 READLINE(3) READLINE(3)
995
996
997 "^" vi-first-print
998 "_" vi-yank-arg
999 "`" vi-goto-mark
1000 "a" vi-append-mode
1001 "b" vi-prev-word
1002 "c" vi-change-to
1003 "d" vi-delete-to
1004 "e" vi-end-word
1005 "f" vi-char-search
1006 "h" backward-char
1007 "i" vi-insertion-mode
1008 "j" next-history
1009 "k" prev-history
1010 "l" forward-char
1011 "m" vi-set-mark
1012 "n" vi-search-again
1013 "p" vi-put
1014 "r" vi-change-char
1015 "s" vi-subst
1016 "t" vi-char-search
1017 "u" undo
1018 "w" vi-next-word
1019 "x" vi-delete
1020 "y" vi-yank-to
1021 "|" vi-column
1022 "~" vi-change-case
1023
1024 SSEEEE AALLSSOO
1025 _T_h_e _G_n_u _R_e_a_d_l_i_n_e _L_i_b_r_a_r_y, Brian Fox and Chet Ramey
1026 _T_h_e _G_n_u _H_i_s_t_o_r_y _L_i_b_r_a_r_y, Brian Fox and Chet Ramey
1027 _b_a_s_h(1)
1028
1029 FFIILLEESS
1030 _~_/_._i_n_p_u_t_r_c
1031 Individual rreeaaddlliinnee initialization file
1032
1033 AAUUTTHHOORRSS
1034 Brian Fox, Free Software Foundation (primary author)
1035 bfox@ai.MIT.Edu
1036
1037 Chet Ramey, Case Western Reserve University
1038 chet@ins.CWRU.Edu
1039
1040 BBUUGG RREEPPOORRTTSS
1041 If you find a bug in rreeaaddlliinnee,, you should report it. But
1042 first, you should make sure that it really is a bug, and
1043 that it appears in the latest version of the rreeaaddlliinnee
1044 library that you have.
1045
1046 Once you have determined that a bug actually exists, mail
1047 a bug report to _b_u_g_-_r_e_a_d_l_i_n_e@_p_r_e_p_._a_i_._M_I_T_._E_d_u. If you have
1048 a fix, you are welcome to mail that as well! Suggestions
1049 and `philosophical' bug reports may be mailed to _b_u_g_-
1050 _r_e_a_d_l_i_n_e@_p_r_e_p_._a_i_._M_I_T_._E_d_u or posted to the Usenet newsgroup
1051
1052
1053
1054 GNU 1997 Feb 5 16
1055
1056
1057
1058
1059
1060 READLINE(3) READLINE(3)
1061
1062
1063 ggnnuu..bbaasshh..bbuugg.
1064
1065 Comments and bug reports concerning this manual page
1066 should be directed to _c_h_e_t_@_i_n_s_._C_W_R_U_._E_d_u.
1067
1068 BBUUGGSS
1069 It's too big and too slow.
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120 GNU 1997 Feb 5 17
1121
1122