Merge illumos-gate
[unleashed.git] / share / man / man5 / tecla.5
blob1de777853f5f7b7366911c5ad1743cb51635591a
1 '\" te
2 .\" Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd. All Rights Reserved.
3 .\" Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
4 .\" "Software"), to deal in the Software without restriction, including
5 .\" without limitation the rights to use, copy, modify, merge, publish,
6 .\" distribute, and/or sell copies of the Software, and to permit persons
7 .\" to whom the Software is furnished to do so, provided that the above
8 .\" copyright notice(s) and this permission notice appear in all copies of
9 .\" the Software and that both the above copyright notice(s) and this
10 .\" permission notice appear in supporting documentation.
11 .\"
12 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
13 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
15 .\" OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
16 .\" HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
17 .\" INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
18 .\" FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
19 .\" NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
20 .\" WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 .\"
22 .\" Except as contained in this notice, the name of a copyright holder
23 .\" shall not be used in advertising or otherwise to promote the sale, use
24 .\" or other dealings in this Software without prior written authorization
25 .\" of the copyright holder.
26 .\" Portions Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
27 .TH TECLA 5 "April 9, 2016"
28 .SH NAME
29 tecla, teclarc \- User interface provided by the tecla library.
30 .SH DESCRIPTION
31 .LP
32 This man page describes the command-line editing features that are available to
33 users of programs that read keyboard input via the tecla library. Users of the
34 \fBtcsh\fR shell will find the default key bindings very familiar. Users of the
35 \fBbash\fR shell will also find it quite familiar, but with a few minor
36 differences, most notably in how forward and backward searches through the list
37 of historical commands are performed. There are two major editing modes, one
38 with \fBemacs\fR-like key bindings and another with \fBvi\fR-like key bindings.
39 By default \fBemacs\fR mode is enabled, but \fBvi\fR(1) mode can alternatively
40 be selected via the user's configuration file. This file can also be used to
41 change the bindings of individual keys to suit the user's preferences. By
42 default, tab completion is provided. If the application hasn't reconfigured
43 this to complete other types of symbols, then tab completion completes file
44 names.
45 .SS "Key Sequence Notation"
46 .LP
47 In the rest of this man page, and also in all tecla configuration files, key
48 sequences are expressed as follows.
49 .sp
50 .ne 2
51 .na
52 \fB\fB^A\fR or \fBC-a\fR\fR
53 .ad
54 .RS 13n
55 This is a 'CONTROL-A', entered by pressing the CONTROL key at the same time as
56 the 'A' key.
57 .RE
59 .sp
60 .ne 2
61 .na
62 \fB\eE\fR or \fBM-\fR
63 .ad
64 .RS 13n
65 In key sequences, both of these notations can be entered either by pressing the
66 ESCAPE key, then the following key, or by pressing the META key at the same
67 time as the following key. Thus the key sequence \fBM-p\fR can be typed in two
68 ways, by pressing the ESCAPE key, followed by pressing 'P', or by pressing the
69 META key at the same time as 'P'.
70 .RE
72 .sp
73 .ne 2
74 .na
75 \fBup\fR
76 .ad
77 .RS 13n
78 This refers to the up-arrow key.
79 .RE
81 .sp
82 .ne 2
83 .na
84 \fBdown\fR
85 .ad
86 .RS 13n
87 This refers to the down-arrow key.
88 .RE
90 .sp
91 .ne 2
92 .na
93 \fBleft\fR
94 .ad
95 .RS 13n
96 This refers to the left-arrow key.
97 .RE
99 .sp
100 .ne 2
102 \fBright\fR
104 .RS 13n
105 This refers to the right-arrow key.
109 .ne 2
111 \fBa\fR
113 .RS 13n
114 This is just a normal 'A' key.
117 .SS "The Tecla Configuration File"
119 By default, tecla looks for a file called \fB\&.teclarc\fR in your home
120 directory (ie. \fB~/.teclarc\fR). If it finds this file, it reads it,
121 interpreting each line as defining a new key binding or an editing
122 configuration option. Since the \fBemacs\fR key-bindings are installed by
123 default, if you want to use the non-default \fBvi\fR editing mode, the most
124 important item to go in this file is the following line:
126 .in +2
128 edit-mode vi
130 .in -2
134 This will re-configure the default bindings for \fBvi\fR-mode. The complete set
135 of arguments that this command accepts are:
137 .ne 2
139 \fBvi\fR
141 .RS 9n
142 Install key bindings like those of the \fBvi\fR editor.
146 .ne 2
148 \fBemacs\fR
150 .RS 9n
151 Install key bindings like those of the \fBemacs\fR editor. This is the default.
155 .ne 2
157 \fBnone\fR
159 .RS 9n
160 Use just the native line editing facilities provided by the terminal driver.
165 To prevent the terminal bell from being rung, such as when an unrecognized
166 control-sequence is typed, place the following line in the configuration file:
168 .in +2
170 nobeep
172 .in -2
176 An example of a key binding line in the configuration file is the following.
178 .in +2
180 bind M-[2~ insert-mode
182 .in -2
186 On many keyboards, the above key sequence is generated when one presses the
187 insert key, so with this key binding, one can toggle between the
188 \fBemacs\fR-mode insert and overwrite modes by hitting one key. One could also
189 do it by typing out the above sequence of characters one by one. As explained
190 above, the \fBM-\fR part of this sequence can be typed either by pressing the
191 ESCAPE key before the following key, or by pressing the META key at the same
192 time as the following key. Thus if you had set the above key binding, and the
193 insert key on your keyboard didn't generate the above key sequence, you could
194 still type it in either of the following 2 ways.
195 .RS +4
198 Hit the ESCAPE key momentarily, then press '[', then '2', then finally '~'.
200 .RS +4
203 Press the META key at the same time as pressing the '[' key, then press '2',
204 then '~'.
208 If you set a key binding for a key sequence that is already bound to a
209 function, the new binding overrides the old one. If in the new binding you omit
210 the name of the new function to bind to the key sequence, the original binding
211 becomes undefined.
214 Starting with versions of \fBlibtecla\fR later than 1.3.3 it is now possible to
215 bind key sequences that begin with a printable character. Previously key
216 sequences were required to start with a CONTROL or META character.
219 Note that the special keywords "up", "down", "left", and "right" refer to the
220 arrow keys, and are thus not treated as key sequences. So, for example, to
221 rebind the up and down arrow keys to use the history search mechanism instead
222 of the simple history recall method, you could place the following in your
223 configuration file:
225 .in +2
227 bind up history-search-backwards
228 bind down history-search-backwards
230 .in -2
234 To unbind an existing binding, you can do this with the bind command by
235 omitting to name any action to rebind the key sequence to. For example, by not
236 specifying an action function, the following command unbinds the default
237 beginning-of-line action from the \fB^A\fR key sequence:
239 .in +2
241 bind ^A
243 .in -2
247 If you create a \fB~/.teclarc\fR configuration file, but it appears to have no
248 effect on the program, check the documentation of the program to see if the
249 author chose a different name for this file.
250 .SS "Filename and Tilde Completion"
252 With the default key bindings, pressing the TAB key (aka. \fB^I\fR) results in
253 tecla attempting to complete the incomplete file name that precedes the cursor.
254 Tecla searches backwards from the cursor, looking for the start of the file
255 name, stopping when it hits either a space or the start of the line. If more
256 than one file has the specified prefix, then tecla completes the file name up
257 to the point at which the ambiguous matches start to differ, then lists the
258 possible matches.
261 In addition to literally written file names, tecla can complete files that
262 start with \fB~/\fR and \fB~user/\fR expressions and that contain \fB$envvar\fR
263 expressions. In particular, if you hit TAB within an incomplete \fB~user\fR,
264 expression, tecla will attempt to complete the username, listing any ambiguous
265 matches.
268 The completion binding is implemented using the \fBcpl_complete_word()\fR
269 function, which is also available separately to users of this library. See the
270 \fBcpl_complete_word\fR(3TECLA) man page for more details.
271 .SS "Filename Expansion"
273 With the default key bindings, pressing \fB^X*\fR causes tecla to expand the
274 file name that precedes the cursor, replacing \fB~/\fR and \fB~user/\fR
275 expressions with the corresponding home directories, and replacing
276 \fB$envvar\fR expressions with the value of the specified environment variable,
277 then if there are any wildcards, replacing the so far expanded file name with a
278 space-separated list of the files which match the wild cards.
281 The expansion binding is implemented using the \fBef_expand_file()\fR function.
282 See the \fBef_expand_file\fR(3TECLA) man page for more details.
283 .SS "Recalling Previously Typed Lines"
285 Every time that a new line is entered by the user, it is appended to a list of
286 historical input lines maintained within the \fBGetLine\fR resource object. You
287 can traverse up and down this list using the up and down arrow keys.
288 Alternatively, you can do the same with the \fB^P\fR, and \fB^N\fR keys, and in
289 \fBvi\fR command mode you can alternatively use the k and j characters. Thus
290 pressing up-arrow once, replaces the current input line with the previously
291 entered line. Pressing up-arrow again, replaces this with the line that was
292 entered before it, etc.. Having gone back one or more lines into the history
293 list, one can return to newer lines by pressing down-arrow one or more times.
294 If you do this sufficient times, you will return to the original line that you
295 were entering when you first hit up-arrow.
298 Note that in \fBvi\fR mode, all of the history recall functions switch the
299 library into command mode.
302 In \fBemacs\fR mode the \fBM-p\fR and \fBM-n\fR keys work just like the
303 \fB^P\fR and \fB^N\fR keys, except that they skip all but those historical
304 lines which share the prefix that precedes the cursor. In \fBvi\fR command mode
305 the upper case 'K' and 'J' characters do the same thing, except that the string
306 that they search for includes the character under the cursor as well as what
307 precedes it.
310 Thus for example, suppose that you were in \fBemacs\fR mode, and you had just
311 entered the following list of commands in the order shown:
313 .in +2
315 ls ~/tecla/
316 cd ~/tecla
317 ls -l getline.c
318 \fBemacs\fR ~/tecla/getline.c
320 .in -2
324 If you next typed:
326 .in +2
330 .in -2
334 and then hit \fBM-p\fR, then rather than returning the previously typed
335 \fBemacs\fR line, which doesn't start with "ls", tecla would recall the "ls -l
336 getline.c" line. Pressing \fBM-p\fR again would recall the "ls ~/tecla/" line.
339 Note that if the string that you are searching for, contains any of the special
340 characters, *, ?, or '[', then it is interpreted as a pattern to be matched.
341 Thus, continuing with the above example, after typing in the list of commands
342 shown, if you then typed:
344 .in +2
346 *tecla*
348 .in -2
352 and hit \fBM-p\fR, then the "\fBemacs\fR ~/tecla/getline.c" line would be
353 recalled first, since it contains the word tecla somewhere in the line,
354 Similarly, hitting \fBM-p\fR again, would recall the "ls ~/tecla/" line, and
355 hitting it once more would recall the "ls ~/tecla/" line. The pattern syntax is
356 the same as that described for file name expansion, in the
357 \fBef_expand_file\fR(3TECLA).
358 .SS "History Files"
360 Authors of programs that use the tecla library have the option of saving
361 historical command-lines in a file before exiting, and subsequently reading
362 them back in from this file when the program is next started. There is no
363 standard name for this file, since it makes sense for each application to use
364 its own history file, so that commands from different applications don't get
365 mixed up.
366 .SS "International Character Sets"
368 Since \fBlibtecla\fR version 1.4.0, tecla has been 8-bit clean. This means that
369 all 8-bit characters that are printable in the user's current locale are now
370 displayed verbatim and included in the returned input line. Assuming that the
371 calling program correctly contains a call like the following,
373 .in +2
375 setlocale(LC_CTYPE, "");
377 .in -2
381 then the current locale is determined by the first of the environment variables
382 \fBLC_CTYPE\fR, \fBLC_ALL\fR, and \fBLANG\fR, that is found to contain a valid
383 locale name. If none of these variables are defined, or the program neglects to
384 call \fBsetlocale\fR, then the default C locale is used, which is US 7-bit
385 ASCII. On most unix-like platforms, you can get a list of valid locales by
386 typing the command:
388 .in +2
390 locale -a
392 .in -2
396 at the shell prompt.
397 .SS "Meta Keys and Locales"
399 Beware that in most locales other than the default C locale, META characters
400 become printable, and they are then no longer considered to match \fBM-c\fR
401 style key bindings. This allows international characters to be entered with the
402 compose key without unexpectedly triggering META key bindings. You can still
403 invoke META bindings, since there are actually two ways to do this. For example
404 the binding \fBM-c\fR can also be invoked by pressing the ESCAPE key
405 momentarily, then pressing the c key, and this will work regardless of locale.
406 Moreover, many modern terminal emulators, such as gnome's gnome-terminal's and
407 KDE's konsole terminals, already generate escape pairs like this when you use
408 the META key, rather than a real meta character, and other emulators usually
409 have a way to request this behavior, so you can continue to use the META key on
410 most systems.
413 For example, although xterm terminal emulators generate real 8-bit meta
414 characters by default when you use the META key, they can be configured to
415 output the equivalent escape pair by setting their \fBEightBitInput\fR X
416 resource to False. You can either do this by placing a line like the following
417 in your \fB~/.Xdefaults\fR file,
419 .in +2
421 XTerm*EightBitInput: False
423 .in -2
427 or by starting an \fBxterm\fR with an \fB-xrm\fR \&'*EightBitInput: False'
428 command-line argument. In recent versions of xterm you can toggle this feature
429 on and off with the 'Meta Sends Escape' option in the menu that is displayed
430 when you press the left mouse button and the CONTROL key within an xterm
431 window. In CDE, dtterms can be similarly coerced to generate escape pairs in
432 place of meta characters, by setting the \fBDtterm*KshMode\fR resource to True.
433 .SS "Entering International Characters"
435 If you don't have a keyboard that generates all of the international characters
436 that you need, there is usually a compose key that will allow you to enter
437 special characters, or a way to create one. For example, under X windows on
438 unix-like systems, if your keyboard doesn't have a compose key, you can
439 designate a redundant key to serve this purpose with the xmodmap command. For
440 example, on many PC keyboards there is a microsoft-windows key, which is
441 otherwise useless under Linux. On a laptop, for example, the \fBxev\fR program
442 might report that pressing this key generates keycode 115. To turn this key
443 into a COMPOSE  key, do the following:
445 .in +2
447 xmodmap -e 'keycode 115 = Multi_key'
449 .in -2
453 Type this key followed by a " character to enter an 'I' with a umlaut over it.
454 .SS "The Available Key Binding Functions"
456 The following is a list of the editing functions provided by the tecla library.
457 The names in the leftmost column of the list can be used in configuration files
458 to specify which function a given key or combination of keys should invoke.
459 They are also used in the next two sections to list the default key bindings in
460 \fBemacs\fR and \fBvi\fR modes.
462 .ne 2
464 \fBuser-interrupt\fR
466 .RS 30n
467 Send a SIGINT signal to the parent process.
471 .ne 2
473 \fBsuspend\fR
475 .RS 30n
476 Suspend the parent process.
480 .ne 2
482 \fBstop-output\fR
484 .RS 30n
485 Pause terminal output.
489 .ne 2
491 \fBstart-output\fR
493 .RS 30n
494 Resume paused terminal output.
498 .ne 2
500 \fBliteral-next\fR
502 .RS 30n
503 Arrange for the next character to be treated as a normal character. This allows
504 control characters to be entered.
508 .ne 2
510 \fBcursor-right\fR
512 .RS 30n
513 Move the cursor one character right.
517 .ne 2
519 \fBcursor-left\fR
521 .RS 30n
522 Move the cursor one character left.
526 .ne 2
528 \fBinsert-mode\fR
530 .RS 30n
531 Toggle between insert mode and overwrite mode.
535 .ne 2
537 \fBbeginning-of-line\fR
539 .RS 30n
540 Move the cursor to the beginning of the line.
544 .ne 2
546 \fBend-of-line\fR
548 .RS 30n
549 Move the cursor to the end of the line.
553 .ne 2
555 \fBdelete-line\fR
557 .RS 30n
558 Delete the contents of the current line.
562 .ne 2
564 \fBkill-line\fR
566 .RS 30n
567 Delete everything that follows the cursor.
571 .ne 2
573 \fBbackward-kill-line\fR
575 .RS 30n
576 Delete all characters between the cursor and the start of the line.
580 .ne 2
582 \fBforward-word\fR
584 .RS 30n
585 Move to the end of the word which follows the cursor.
589 .ne 2
591 \fBforward-to-word\fR
593 .RS 30n
594 Move the cursor to the start of the word that follows the cursor.
598 .ne 2
600 \fBbackward-word\fR
602 .RS 30n
603 Move to the start of the word which precedes the cursor.
607 .ne 2
609 \fBgoto-column\fR
611 .RS 30n
612 Move the cursor to the 1-relative column in the line specified by any preceding
613 digit-argument sequences (see Entering Repeat Counts below).
617 .ne 2
619 \fBfind-parenthesis\fR
621 .RS 30n
622 If the cursor is currently over a parenthesis character, move it to the
623 matching parenthesis character. If not over a parenthesis character move right
624 to the next close parenthesis.
628 .ne 2
630 \fBforward-delete-char\fR
632 .RS 30n
633 Delete the character under the cursor.
637 .ne 2
639 \fBbackward-delete-char\fR
641 .RS 30n
642 Delete the character which precedes the cursor.
646 .ne 2
648 \fBlist-or-eof\fR
650 .RS 30n
651 This is intended for binding to \fB^D\fR. When invoked when the cursor is
652 within the line it displays all possible completions then redisplays the line
653 unchanged. When invoked on an empty line, it signals end-of-input (EOF) to the
654 caller of \fBgl_get_line()\fR.
658 .ne 2
660 \fBdel-char-or-list-or-eof\fR
662 .RS 30n
663 This is intended for binding to \fB^D\fR. When invoked when the cursor is
664 within the line it invokes forward-delete-char. When invoked at the end of the
665 line it displays all possible completions then redisplays the line unchanged.
666 When invoked on an empty line, it signals end-of-input (EOF) to the caller of
667 \fBgl_get_line()\fR.
671 .ne 2
673 \fBforward-delete-word\fR
675 .RS 30n
676 Delete the word which follows the cursor.
680 .ne 2
682 \fBbackward-delete-word\fR
684 .RS 30n
685 Delete the word which precedes the cursor.
689 .ne 2
691 \fBupcase-word\fR
693 .RS 30n
694 Convert all of the characters of the word which follows the cursor, to upper
695 case.
699 .ne 2
701 \fBdowncase-word\fR
703 .RS 30n
704 Convert all of the characters of the word which follows the cursor, to lower
705 case.
709 .ne 2
711 \fBcapitalize-word\fR
713 .RS 30n
714 Capitalize the word which follows the cursor.
718 .ne 2
720 \fBchange-case\fR
722 .RS 30n
723 If the next character is upper case, toggle it to lower case and vice versa.
727 .ne 2
729 \fBredisplay\fR
731 .RS 30n
732 Redisplay the line.
736 .ne 2
738 \fBclear-screen\fR
740 .RS 30n
741 Clear the terminal, then redisplay the current line.
745 .ne 2
747 \fBtranspose-chars\fR
749 .RS 30n
750 Swap the character under the cursor with the character just before the cursor.
754 .ne 2
756 \fBset-mark\fR
758 .RS 30n
759 Set a mark at the position of the cursor.
763 .ne 2
765 \fBexchange-point-and-mark\fR
767 .RS 30n
768 Move the cursor to the last mark that was set, and move the mark to where the
769 cursor used to be.
773 .ne 2
775 \fBkill-region\fR
777 .RS 30n
778 Delete the characters that lie between the last mark that was set, and the
779 cursor.
783 .ne 2
785 \fBcopy-region-as-kill\fR
787 .RS 30n
788 Copy the text between the mark and the cursor to the cut buffer, without
789 deleting the original text.
793 .ne 2
795 \fByank\fR
797 .RS 30n
798 Insert the text that was last deleted, just before the current position of the
799 cursor.
803 .ne 2
805 \fBappend-yank\fR
807 .RS 30n
808 Paste the current contents of the cut buffer, after the cursor.
812 .ne 2
814 \fBup-history\fR
816 .RS 30n
817 Recall the next oldest line that was entered. Note that in \fBvi\fR mode you
818 are left in command mode.
822 .ne 2
824 \fBdown-history\fR
826 .RS 30n
827 Recall the next most recent line that was entered. If no history recall session
828 is currently active, the next line from a previous recall session is recalled.
829 Note that in vi mode you are left in command mode.
833 .ne 2
835 \fBhistory-search-backward\fR
837 .RS 30n
838 Recall the next oldest line who's prefix matches the string which currently
839 precedes the cursor (in \fBvi\fR command-mode the character under the cursor is
840 also included in the search string). Note that in \fBvi\fR mode you are left in
841 command mode.
845 .ne 2
847 \fBhistory-search-forward\fR
849 .RS 30n
850 Recall the next newest line who's prefix matches the string which currently
851 precedes the cursor (in \fBvi\fR command-mode the character under the cursor is
852 also included in the search string). Note that in \fBvi\fR mode you are left in
853 command mode.
857 .ne 2
859 \fBhistory-re-search-backward\fR
861 .RS 30n
862 Recall the next oldest line who's prefix matches that established by the last
863 invocation of either history-search-forward or history-search-backward.
867 .ne 2
869 \fBhistory-re-search-forward\fR
871 .RS 30n
872 Recall the next newest line who's prefix matches that established by the last
873 invocation of either history-search-forward or history-search-backward.
877 .ne 2
879 \fBcomplete-word\fR
881 .RS 30n
882 Attempt to complete the incomplete word which precedes the cursor. Unless the
883 host program has customized word completion, file name completion is attempted.
884 In \fBvi\fR command mode the character under the cursor is also included in
885 the word being completed, and you are left in \fBvi\fR insert mode.
889 .ne 2
891 \fBexpand-filename\fR
893 .RS 30n
894 Within the command line, expand wild cards, tilde expressions and dollar
895 expressions in the file name which immediately precedes the cursor. In \fBvi\fR
896 command mode the character under the cursor is also included in the file name
897 being expanded, and you are left in \fBvi\fR insert mode.
901 .ne 2
903 \fBlist-glob\fR
905 .RS 30n
906 List any file names which match the wild-card, tilde and dollar expressions in
907 the file name which immediately precedes the cursor, then redraw the input line
908 unchanged.
912 .ne 2
914 \fBlist-history\fR
916 .RS 30n
917 Display the contents of the history list for the current history group. If a
918 repeat count of \fB> 1\fR is specified, only that many of the most recent lines
919 are displayed. See the Entering Repeat Counts section.
923 .ne 2
925 \fBread-from-file\fR
927 .RS 30n
928 Temporarily switch to reading input from the file who's name precedes the
929 cursor.
933 .ne 2
935 \fBread-init-files\fR
937 .RS 30n
938 Re-read \fBteclarc\fR configuration files.
942 .ne 2
944 \fBbeginning-of-history\fR
946 .RS 30n
947 Move to the oldest line in the history list. Note that in \fBvi\fR mode you are
948 left in command mode.
952 .ne 2
954 \fBend-of-history\fR
956 .RS 30n
957 Move to the newest line in the history list (ie. the current line). Note that
958 in \fBvi\fR mode this leaves you in command mode.
962 .ne 2
964 \fBdigit-argument\fR
966 .RS 30n
967 Enter a repeat count for the next key binding function. For details, see the
968 Entering Repeat Counts section.
972 .ne 2
974 \fBnewline\fR
976 .RS 30n
977 Terminate and return the current contents of the line, after appending a
978 newline character. The newline character is normally '\en', but will be the
979 first character of the key sequence that invoked the newline action, if this
980 happens to be a printable character. If the action was invoked by the '\en'
981 newline character or the '\er' carriage return character, the line is appended
982 to the history buffer.
986 .ne 2
988 \fBrepeat-history\fR
990 .RS 30n
991 Return the line that is being edited, then arrange for the next most recent
992 entry in the history buffer to be recalled when tecla is next called.
993 Repeatedly invoking this action causes successive historical input lines to be
994 re-executed. Note that this action is equivalent to the 'Operate' action in
995 ksh.
999 .ne 2
1001 \fBring-bell\fR
1003 .RS 30n
1004 Ring the terminal bell, unless the bell has been silenced via the nobeep
1005 configuration option (see The Tecla Configuration File section).
1009 .ne 2
1011 \fBforward-copy-char\fR
1013 .RS 30n
1014 Copy the next character into the cut buffer (NB. use repeat counts to copy more
1015 than one).
1019 .ne 2
1021 \fBbackward-copy-char\fR
1023 .RS 30n
1024 Copy the previous character into the cut buffer.
1028 .ne 2
1030 \fBforward-copy-word\fR
1032 .RS 30n
1033 Copy the next word into the cut buffer.
1037 .ne 2
1039 \fBbackward-copy-word\fR
1041 .RS 30n
1042 Copy the previous word into the cut buffer.
1046 .ne 2
1048 \fBforward-find-char\fR
1050 .RS 30n
1051 Move the cursor to the next occurrence of the next character that you type.
1055 .ne 2
1057 \fBbackward-find-char\fR
1059 .RS 30n
1060 Move the cursor to the last occurrence of the next character that you type.
1064 .ne 2
1066 \fBforward-to-char\fR
1068 .RS 30n
1069 Move the cursor to the character just before the next occurrence of the next
1070 character that the user types.
1074 .ne 2
1076 \fBbackward-to-char\fR
1078 .RS 30n
1079 Move the cursor to the character just after the last occurrence before the
1080 cursor of the next character that the user types.
1084 .ne 2
1086 \fBrepeat-find-char\fR
1088 .RS 30n
1089 Repeat the last backward-find-char, forward-find-char, backward-to-char or
1090 forward-to-char.
1094 .ne 2
1096 \fBinvert-refind-char\fR
1098 .RS 30n
1099 Repeat the last backward-find-char, forward-find-char, backward-to-char, or
1100 forward-to-char in the opposite direction.
1104 .ne 2
1106 \fBdelete-to-column\fR
1108 .RS 30n
1109 Delete the characters from the cursor up to the column that is specified by the
1110 repeat count.
1114 .ne 2
1116 \fBdelete-to-parenthesis\fR
1118 .RS 30n
1119 Delete the characters from the cursor up to and including the matching
1120 parenthesis, or next close parenthesis.
1124 .ne 2
1126 \fBforward-delete-find\fR
1128 .RS 30n
1129 Delete the characters from the cursor up to and including the following
1130 occurrence of the next character typed.
1134 .ne 2
1136 \fBbackward-delete-find\fR
1138 .RS 30n
1139 Delete the characters from the cursor up to and including the preceding
1140 occurrence of the next character typed.
1144 .ne 2
1146 \fBforward-delete-to\fR
1148 .RS 30n
1149 Delete the characters from the cursor up to, but not including, the following
1150 occurrence of the next character typed.
1154 .ne 2
1156 \fBbackward-delete-to\fR
1158 .RS 30n
1159 Delete the characters from the cursor up to, but not including, the preceding
1160 occurrence of the next character typed.
1164 .ne 2
1166 \fBdelete-refind\fR
1168 .RS 30n
1169 Repeat the last *-delete-find or *-delete-to action.
1173 .ne 2
1175 \fBdelete-invert-refind\fR
1177 .RS 30n
1178 Repeat the last *-delete-find or *-delete-to action, in the opposite direction.
1182 .ne 2
1184 \fBcopy-to-column\fR
1186 .RS 30n
1187 Copy the characters from the cursor up to the column that is specified by the
1188 repeat count, into the cut buffer.
1192 .ne 2
1194 \fBcopy-to-parenthesis\fR
1196 .RS 30n
1197 Copy the characters from the cursor up to and including the matching
1198 parenthesis, or next close parenthesis, into the cut buffer.
1202 .ne 2
1204 \fBforward-copy-find\fR
1206 .RS 30n
1207 Copy the characters from the cursor up to and including the following occurrence
1208 of the next character typed, into the cut buffer.
1212 .ne 2
1214 \fBbackward-copy-find\fR
1216 .RS 30n
1217 Copy the characters from the cursor up to and including the preceding occurrence
1218 of the next character typed, into the cut buffer.
1222 .ne 2
1224 \fBforward-copy-to\fR
1226 .RS 30n
1227 Copy the characters from the cursor up to, but not including, the following
1228 occurrence of the next character typed, into the cut buffer.
1232 .ne 2
1234 \fBbackward-copy-to\fR
1236 .RS 30n
1237 Copy the characters from the cursor up to, but not including, the preceding
1238 occurrence of the next character typed, into the cut buffer.
1242 .ne 2
1244 \fBcopy-refind\fR
1246 .RS 30n
1247 Repeat the last *-copy-find or *-copy-to action.
1251 .ne 2
1253 \fBcopy-invert-refind\fR
1255 .RS 30n
1256 Repeat the last *-copy-find or *-copy-to action, in the opposite direction.
1260 .ne 2
1262 \fBvi-mode\fR
1264 .RS 30n
1265 Switch to \fBvi\fR mode from emacs mode.
1269 .ne 2
1271 \fBemacs-mode\fR
1273 .RS 30n
1274 Switch to \fBemacs\fR mode from \fBvi\fR mode.
1278 .ne 2
1280 \fBvi-insert\fR
1282 .RS 30n
1283 From \fBvi\fR command mode, switch to insert mode.
1287 .ne 2
1289 \fBvi-overwrite\fR
1291 .RS 30n
1292 From \fBvi\fR command mode, switch to overwrite mode.
1296 .ne 2
1298 \fBvi-insert-at-bol\fR
1300 .RS 30n
1301 From \fBvi\fR command mode, move the cursor to the start of the line and switch
1302 to insert mode.
1306 .ne 2
1308 \fBvi-append-at-eol\fR
1310 .RS 30n
1311 From \fBvi\fR command mode, move the cursor to the end of the line and switch
1312 to append mode.
1316 .ne 2
1318 \fBvi-append\fR
1320 .RS 30n
1321 From \fBvi\fR command mode, move the cursor one position right, and switch to
1322 insert mode.
1326 .ne 2
1328 \fBvi-replace-char\fR
1330 .RS 30n
1331 From \fBvi\fR command mode, replace the character under the cursor with the
1332 next character entered.
1336 .ne 2
1338 \fBvi-forward-change-char\fR
1340 .RS 30n
1341 From \fBvi\fR command mode, delete the next character then enter insert mode.
1345 .ne 2
1347 \fBvi-backward-change-char\fR
1349 .RS 30n
1350 From vi command mode, delete the preceding character then enter insert mode.
1354 .ne 2
1356 \fBvi-forward-change-word\fR
1358 .RS 30n
1359 From \fBvi\fR command mode, delete the next word then enter insert mode.
1363 .ne 2
1365 \fBvi-backward-change-word\fR
1367 .RS 30n
1368 From vi command mode, delete the preceding word then enter insert mode.
1372 .ne 2
1374 \fBvi-change-rest-of-line\fR
1376 .RS 30n
1377 From \fBvi\fR command mode, delete from the cursor to the end of the line, then
1378 enter insert mode.
1382 .ne 2
1384 \fBvi-change-line\fR
1386 .RS 30n
1387 From \fBvi\fR command mode, delete the current line, then enter insert mode.
1391 .ne 2
1393 \fBvi-change-to-bol\fR
1395 .RS 30n
1396 From \fBvi\fR command mode, delete all characters between the cursor and the
1397 beginning of the line, then enter insert mode.
1401 .ne 2
1403 \fBvi-change-to-column\fR
1405 .RS 30n
1406 From \fBvi\fR command mode, delete the characters from the cursor up to the
1407 column that is specified by the repeat count, then enter insert mode.
1411 .ne 2
1413 \fBvi-change-to-parenthesis\fR
1415 .RS 30n
1416 Delete the characters from the cursor up to and including the matching
1417 parenthesis, or next close parenthesis, then enter \fBvi\fR insert mode.
1421 .ne 2
1423 \fBvi-forward-change-find\fR
1425 .RS 30n
1426 From \fBvi\fR command mode, delete the characters from the cursor up to and
1427 including the following occurrence of the next character typed, then enter
1428 insert mode.
1432 .ne 2
1434 \fBvi-backward-change-find\fR
1436 .RS 30n
1437 From vi command mode, delete the characters from the cursor up to and including
1438 the preceding occurrence of the next character typed, then enter insert mode.
1442 .ne 2
1444 \fBvi-forward-change-to\fR
1446 .RS 30n
1447 From \fBvi\fR command mode, delete the characters from the cursor up to, but
1448 not including, the following occurrence of the next character typed, then enter
1449 insert mode.
1453 .ne 2
1455 \fBvi-backward-change-to\fR
1457 .RS 30n
1458 From \fBvi\fR command mode, delete the characters from the cursor up to, but
1459 not including, the preceding occurrence of the next character typed, then enter
1460 insert mode.
1464 .ne 2
1466 \fBvi-change-refind\fR
1468 .RS 30n
1469 Repeat the last vi-*-change-find or vi-*-change-to action.
1473 .ne 2
1475 \fBvi-change-invert-refind\fR
1477 .RS 30n
1478 Repeat the last vi-*-change-find or vi-*-change-to action, in the opposite
1479 direction.
1483 .ne 2
1485 \fBvi-undo\fR
1487 .RS 30n
1488 In \fBvi\fR mode, undo the last editing operation.
1492 .ne 2
1494 \fBvi-repeat-change\fR
1496 .RS 30n
1497 In \fBvi\fR command mode, repeat the last command that modified the line.
1500 .SS "Default Key Bindings In \fBemacs\fR Mode"
1502 The following default key bindings, which can be overridden by the tecla
1503 configuration file, are designed to mimic most of the bindings of the unix
1504 \fBtcsh\fR shell, when it is in \fBemacs\fR editing mode.
1507 This is the default editing mode of the tecla library.
1510 Under UNIX the terminal driver sets a number of special keys for certain
1511 functions. The tecla library attempts to use the same key bindings to maintain
1512 consistency. The key sequences shown for the following 6 bindings are thus just
1513 examples of what they will probably be set to. If you have used the stty
1514 command to change these keys, then the default bindings should match.
1516 .ne 2
1518 \fB\fB^C\fR\fR
1520 .RS 6n
1521 user-interrupt
1525 .ne 2
1527 \fB^\e\fR
1529 .RS 6n
1530 abort
1534 .ne 2
1536 \fB\fB^Z\fR\fR
1538 .RS 6n
1539 suspend
1543 .ne 2
1545 \fB\fB^Q\fR\fR
1547 .RS 6n
1548 start-output
1552 .ne 2
1554 \fB\fB^S\fR\fR
1556 .RS 6n
1557 stop-output
1561 .ne 2
1563 \fB\fB^V\fR\fR
1565 .RS 6n
1566 literal-next
1571 The cursor keys are referred to by name, as follows. This is necessary because
1572 different types of terminals generate different key sequences when their cursor
1573 keys are pressed.
1575 .ne 2
1577 \fBright\fR
1579 .RS 9n
1580 cursor-right
1584 .ne 2
1586 \fBleft\fR
1588 .RS 9n
1589 cursor-left
1593 .ne 2
1595 \fBup\fR
1597 .RS 9n
1598 up-history
1602 .ne 2
1604 \fBdown\fR
1606 .RS 9n
1607 down-history
1612 The remaining bindings don't depend on the terminal settings.
1614 .ne 2
1616 \fB\fB^F\fR\fR
1618 .RS 21n
1619 cursor-right
1623 .ne 2
1625 \fB\fB^B\fR\fR
1627 .RS 21n
1628 cursor-left
1632 .ne 2
1634 \fB\fBM-i\fR\fR
1636 .RS 21n
1637 insert-mode
1641 .ne 2
1643 \fB\fB^A\fR\fR
1645 .RS 21n
1646 beginning-of-line
1650 .ne 2
1652 \fB\fB^E\fR\fR
1654 .RS 21n
1655 end-of-line
1659 .ne 2
1661 \fB\fB^U\fR\fR
1663 .RS 21n
1664 delete-line
1668 .ne 2
1670 \fB\fB^K\fR\fR
1672 .RS 21n
1673 kill-line
1677 .ne 2
1679 \fB\fBM-f\fR\fR
1681 .RS 21n
1682 forward-word
1686 .ne 2
1688 \fB\fBM-b\fR\fR
1690 .RS 21n
1691 backward-word
1695 .ne 2
1697 \fB\fB^D\fR\fR
1699 .RS 21n
1700 del-char-or-list-or-eof
1704 .ne 2
1706 \fB\fB^H\fR\fR
1708 .RS 21n
1709 backward-delete-char
1713 .ne 2
1715 \fB\fB^?\fR\fR
1717 .RS 21n
1718 backward-delete-char
1722 .ne 2
1724 \fB\fBM-d\fR\fR
1726 .RS 21n
1727 forward-delete-word
1731 .ne 2
1733 \fB\fBM-^H\fR\fR
1735 .RS 21n
1736 backward-delete-word
1740 .ne 2
1742 \fB\fBM-^?\fR\fR
1744 .RS 21n
1745 backward-delete-word
1749 .ne 2
1751 \fB\fBM-u\fR\fR
1753 .RS 21n
1754 upcase-word
1758 .ne 2
1760 \fB\fBM-l\fR\fR
1762 .RS 21n
1763 downcase-word
1767 .ne 2
1769 \fB\fBM-c\fR\fR
1771 .RS 21n
1772 capitalize-word
1776 .ne 2
1778 \fB\fB^R\fR\fR
1780 .RS 21n
1781 redisplay
1785 .ne 2
1787 \fB\fB^L\fR\fR
1789 .RS 21n
1790 clear-screen
1794 .ne 2
1796 \fB\fB^T\fR\fR
1798 .RS 21n
1799 transpose-chars
1803 .ne 2
1805 \fB\fB^@\fR\fR
1807 .RS 21n
1808 set-mark
1812 .ne 2
1814 \fB\fB^X^X\fR\fR
1816 .RS 21n
1817 exchange-point-and-mark
1821 .ne 2
1823 \fB\fB^W\fR\fR
1825 .RS 21n
1826 kill-region
1830 .ne 2
1832 \fB\fBM-w\fR\fR
1834 .RS 21n
1835 copy-region-as-kill
1839 .ne 2
1841 \fB\fB^Y\fR\fR
1843 .RS 21n
1844 yank
1848 .ne 2
1850 \fB\fB^P\fR\fR
1852 .RS 21n
1853 up-history
1857 .ne 2
1859 \fB\fB^N\fR\fR
1861 .RS 21n
1862 down-history
1866 .ne 2
1868 \fB\fBM-p\fR\fR
1870 .RS 21n
1871 history-search-backward
1875 .ne 2
1877 \fB\fBM-n\fR\fR
1879 .RS 21n
1880 history-search-forward
1884 .ne 2
1886 \fB\fB^I\fR\fR
1888 .RS 21n
1889 complete-word
1893 .ne 2
1895 \fB\fB^X*\fR\fR
1897 .RS 21n
1898 expand-filename
1902 .ne 2
1904 \fB\fB^X^F\fR\fR
1906 .RS 21n
1907 read-from-file
1911 .ne 2
1913 \fB\fB^X^R\fR\fR
1915 .RS 21n
1916 read-init-files
1920 .ne 2
1922 \fB\fB^Xg\fR\fR
1924 .RS 21n
1925 list-glob
1929 .ne 2
1931 \fB\fB^Xh\fR\fR
1933 .RS 21n
1934 list-history
1938 .ne 2
1940 \fB\fBM-<\fR\fR
1942 .RS 21n
1943 beginning-of-history
1947 .ne 2
1949 \fB\fBM->\fR\fR
1951 .RS 21n
1952 end-of-history
1956 .ne 2
1958 \fB\fB\en\fR\fR
1960 .RS 21n
1961 newline
1965 .ne 2
1967 \fB\fB\er\fR\fR
1969 .RS 21n
1970 newline
1974 .ne 2
1976 \fB\fBM-o\fR\fR
1978 .RS 21n
1979 repeat-history
1983 .ne 2
1985 \fB\fBM-^V\fR\fR
1987 .RS 21n
1988 \fBvi\fR-mode
1992 .ne 2
1994 \fB\fBM-0, M-1, ... M-9\fR\fR
1996 .RS 21n
1997 digit-argument (see below)
2002 Note that \fB^I\fR is what the TAB key generates, and that \fB^@\fR can be
2003 generated not only by pressing the CONTROL key and the @ key simultaneously,
2004 but also by pressing the CONTROL key and the space bar at the same time.
2005 .SS "Default Key Bindings in \fBvi\fR Mode"
2007 The following default key bindings are designed to mimic the \fBvi\fR style of
2008 editing as closely as possible. This means that very few editing functions are
2009 provided in the initial character input mode, editing functions instead being
2010 provided by the \fBvi\fR command mode. The \fBvi\fR command mode is entered
2011 whenever the ESCAPE character is pressed, or whenever a key sequence that
2012 starts with a meta character is entered. In addition to mimicing \fBvi\fR,
2013 \fBlibtecla\fR provides bindings for tab completion, wild-card expansion of
2014 file names, and historical line recall.
2017 To learn how to tell the tecla library to use \fBvi\fR mode instead of the
2018 default \fBemacs\fR editing mode, see the earlier section entitled The Tecla
2019 Configuration File.
2022 Under UNIX the terminal driver sets a number of special keys for certain
2023 functions. The tecla library attempts to use the same key bindings to maintain
2024 consistency, binding them both in input mode and in command mode. The key
2025 sequences shown for the following 6 bindings are thus just examples of what
2026 they will probably be set to. If you have used the \fBstty\fR command to change
2027 these keys, then the default bindings should match.
2029 .ne 2
2031 \fB\fB^C\fR\fR
2033 .RS 8n
2034 user-interrupt
2038 .ne 2
2040 \fB^\e\fR
2042 .RS 8n
2043 abort
2047 .ne 2
2049 \fB\fB^Z\fR\fR
2051 .RS 8n
2052 suspend
2056 .ne 2
2058 \fB\fB^Q\fR\fR
2060 .RS 8n
2061 start-output
2065 .ne 2
2067 \fB\fB^S\fR\fR
2069 .RS 8n
2070 stop-output
2074 .ne 2
2076 \fB\fB^V\fR\fR
2078 .RS 8n
2079 literal-next
2083 .ne 2
2085 \fB\fBM-^C\fR\fR
2087 .RS 8n
2088 user-interrupt
2092 .ne 2
2094 \fBM-^\e\fR
2096 .RS 8n
2097 abort
2101 .ne 2
2103 \fB\fBM-^Z\fR\fR
2105 .RS 8n
2106 suspend
2110 .ne 2
2112 \fB\fBM-^Q\fR\fR
2114 .RS 8n
2115 start-output
2119 .ne 2
2121 \fB\fBM-^S\fR\fR
2123 .RS 8n
2124 stop-output
2129 Note that above, most of the bindings are defined twice, once as a raw control
2130 code like \fB^C\fR and then a second time as a META character like \fBM-^C\fR.
2131 The former is the binding for \fBvi\fR input mode, whereas the latter is the
2132 binding for \fBvi\fR command mode. Once in command mode all key sequences that
2133 the user types that they don't explicitly start with an ESCAPE or a META key,
2134 have their first key secretly converted to a META character before the key
2135 sequence is looked up in the key binding table. Thus, once in command mode,
2136 when you type the letter i, for example, the tecla library actually looks up
2137 the binding for \fBM-i\fR.
2140 The cursor keys are referred to by name, as follows. This is necessary because
2141 different types of terminals generate different key sequences when their cursor
2142 keys are pressed.
2144 .ne 2
2146 \fB\fBright\fR\fR
2148 .RS 9n
2149 cursor-right
2153 .ne 2
2155 \fB\fBleft\fR\fR
2157 .RS 9n
2158 cursor-left
2162 .ne 2
2164 \fB\fBup\fR\fR
2166 .RS 9n
2167 up-history
2171 .ne 2
2173 \fB\fBdown\fR\fR
2175 .RS 9n
2176 down-history
2181 The cursor keys normally generate a key sequence that start with an ESCAPE
2182 character, so beware that using the arrow keys will put you into command mode
2183 (if you aren't already in command mode).
2186 The following are the terminal-independent key bindings for \fBvi\fR input
2187 mode.
2189 .ne 2
2191 \fB\fB^D\fR\fR
2193 .RS 8n
2194 list-or-eof
2198 .ne 2
2200 \fB\fB^G\fR\fR
2202 .RS 8n
2203 list-glob
2207 .ne 2
2209 \fB\fB^H\fR\fR
2211 .RS 8n
2212 backward-delete-char
2216 .ne 2
2218 \fB\fB^I\fR\fR
2220 .RS 8n
2221 complete-word
2225 .ne 2
2227 \fB\fB\er\fR\fR
2229 .RS 8n
2230 newline
2234 .ne 2
2236 \fB\fB\en\fR\fR
2238 .RS 8n
2239 newline
2243 .ne 2
2245 \fB\fB^L\fR\fR
2247 .RS 8n
2248 clear-screen
2252 .ne 2
2254 \fB\fB^N\fR\fR
2256 .RS 8n
2257 down-history
2261 .ne 2
2263 \fB\fB^P\fR\fR
2265 .RS 8n
2266 up-history
2270 .ne 2
2272 \fB\fB^R\fR\fR
2274 .RS 8n
2275 redisplay
2279 .ne 2
2281 \fB\fB^U\fR\fR
2283 .RS 8n
2284 backward-kill-line
2288 .ne 2
2290 \fB\fB^W\fR\fR
2292 .RS 8n
2293 backward-delete-word
2297 .ne 2
2299 \fB\fB^X*\fR\fR
2301 .RS 8n
2302 expand-filename
2306 .ne 2
2308 \fB\fB^X^F\fR\fR
2310 .RS 8n
2311 read-from-file
2315 .ne 2
2317 \fB\fB^X^R\fR\fR
2319 .RS 8n
2320 read-init-files
2324 .ne 2
2326 \fB\fB^?\fR\fR
2328 .RS 8n
2329 backward-delete-char
2334 The following are the key bindings that are defined in \fBvi\fR command mode,
2335 this being specified by them all starting with a META character. As mentioned
2336 above, once in command mode the initial meta character is optional. For
2337 example, you might enter command mode by typing ESCAPE, and then press 'H'
2338 twice to move the cursor two positions to the left. Both 'H' characters get
2339 quietly converted to \fBM-h\fR before being compared to the key binding table,
2340 the first one because ESCAPE followed by a character is always converted to the
2341 equivalent META character, and the second because command mode was already
2342 active.
2344 .ne 2
2346 \fBM-<space>\fR
2348 .RS 21n
2349 cursor-right (META-space)
2353 .ne 2
2355 \fB\fBM-$\fR\fR
2357 .RS 21n
2358 end-of-line
2362 .ne 2
2364 \fB\fBM-*\fR\fR
2366 .RS 21n
2367 expand-filename
2371 .ne 2
2373 \fB\fBM-+\fR\fR
2375 .RS 21n
2376 down-history
2380 .ne 2
2382 \fB\fBM--\fR\fR
2384 .RS 21n
2385 up-history
2389 .ne 2
2391 \fB\fBM-<\fR\fR
2393 .RS 21n
2394 beginning-of-history
2398 .ne 2
2400 \fB\fBM->\fR\fR
2402 .RS 21n
2403 end-of-history
2407 .ne 2
2409 \fB\fBM-^\fR\fR
2411 .RS 21n
2412 beginning-of-line
2416 .ne 2
2418 \fB\fBM-\fR\fR
2420 .RS 21n
2421 repeat-find-char
2425 .ne 2
2427 \fB\fBM-,\fR\fR
2429 .RS 21n
2430 invert-refind-char
2434 .ne 2
2436 \fB\fBM-|\fR\fR
2438 .RS 21n
2439 goto-column
2443 .ne 2
2445 \fB\fBM-~\fR\fR
2447 .RS 21n
2448 change-case
2452 .ne 2
2454 \fB\fBM-.\fR\fR
2456 .RS 21n
2457 vi-repeat-change
2461 .ne 2
2463 \fB\fBM-%\fR\fR
2465 .RS 21n
2466 find-parenthesis
2470 .ne 2
2472 \fB\fBM-a\fR\fR
2474 .RS 21n
2475 vi-append
2479 .ne 2
2481 \fB\fBM-A\fR\fR
2483 .RS 21n
2484 vi-append-at-eol
2488 .ne 2
2490 \fB\fBM-b\fR\fR
2492 .RS 21n
2493 backward-word
2497 .ne 2
2499 \fB\fBM-B\fR\fR
2501 .RS 21n
2502 backward-word
2506 .ne 2
2508 \fB\fBM-C\fR\fR
2510 .RS 21n
2511 vi-change-rest-of-line
2515 .ne 2
2517 \fB\fBM-cb\fR\fR
2519 .RS 21n
2520 vi-backward-change-word
2524 .ne 2
2526 \fB\fBM-cB\fR\fR
2528 .RS 21n
2529 vi-backward-change-word
2533 .ne 2
2535 \fB\fBM-cc\fR\fR
2537 .RS 21n
2538 vi-change-line
2542 .ne 2
2544 \fB\fBM-ce\fR\fR
2546 .RS 21n
2547 vi-forward-change-word
2551 .ne 2
2553 \fB\fBM-cE\fR\fR
2555 .RS 21n
2556 vi-forward-change-word
2560 .ne 2
2562 \fB\fBM-cw\fR\fR
2564 .RS 21n
2565 vi-forward-change-word
2569 .ne 2
2571 \fB\fBM-cW\fR\fR
2573 .RS 21n
2574 vi-forward-change-word
2578 .ne 2
2580 \fB\fBM-cF\fR\fR
2582 .RS 21n
2583 vi-backward-change-find
2587 .ne 2
2589 \fB\fBM-cf\fR\fR
2591 .RS 21n
2592 vi-forward-change-find
2596 .ne 2
2598 \fB\fBM-cT\fR\fR
2600 .RS 21n
2601 vi-backward-change-to
2605 .ne 2
2607 \fB\fBM-ct\fR\fR
2609 .RS 21n
2610 vi-forward-change-to
2614 .ne 2
2616 \fB\fBM-c;\fR\fR
2618 .RS 21n
2619 vi-change-refind
2623 .ne 2
2625 \fB\fBM-c,\fR\fR
2627 .RS 21n
2628 vi-change-invert-refind
2632 .ne 2
2634 \fB\fBM-ch\fR\fR
2636 .RS 21n
2637 vi-backward-change-char
2641 .ne 2
2643 \fB\fBM-c^H\fR\fR
2645 .RS 21n
2646 vi-backward-change-char
2650 .ne 2
2652 \fB\fBM-c^?\fR\fR
2654 .RS 21n
2655 vi-backward-change-char
2659 .ne 2
2661 \fB\fBM-cl\fR\fR
2663 .RS 21n
2664 vi-forward-change-char
2668 .ne 2
2670 \fBM-c<space>\fR
2672 .RS 21n
2673 vi-forward-change-char (META-c-space)
2677 .ne 2
2679 \fB\fBM-c^\fR\fR
2681 .RS 21n
2682 vi-change-to-bol
2686 .ne 2
2688 \fB\fBM-c0\fR\fR
2690 .RS 21n
2691 vi-change-to-bol
2695 .ne 2
2697 \fB\fBM-c$\fR\fR
2699 .RS 21n
2700 vi-change-rest-of-line
2704 .ne 2
2706 \fB\fBM-c|\fR\fR
2708 .RS 21n
2709 vi-change-to-column
2713 .ne 2
2715 \fB\fBM-c%\fR\fR
2717 .RS 21n
2718 vi-change-to-parenthesis
2722 .ne 2
2724 \fB\fBM-dh\fR\fR
2726 .RS 21n
2727 backward-delete-char
2731 .ne 2
2733 \fB\fBM-d^H\fR\fR
2735 .RS 21n
2736 backward-delete-char
2740 .ne 2
2742 \fB\fBM-d^?\fR\fR
2744 .RS 21n
2745 backward-delete-char
2749 .ne 2
2751 \fB\fBM-dl\fR\fR
2753 .RS 21n
2754 forward-delete-char
2758 .ne 2
2760 \fBM-d<space>\fR
2762 .RS 21n
2763 forward-delete-char (META-d-space)
2767 .ne 2
2769 \fB\fBM-dd\fR\fR
2771 .RS 21n
2772 delete-line
2776 .ne 2
2778 \fB\fBM-db\fR\fR
2780 .RS 21n
2781 backward-delete-word
2785 .ne 2
2787 \fB\fBM-dB\fR\fR
2789 .RS 21n
2790 backward-delete-word
2794 .ne 2
2796 \fB\fBM-de\fR\fR
2798 .RS 21n
2799 forward-delete-word
2803 .ne 2
2805 \fB\fBM-dE\fR\fR
2807 .RS 21n
2808 forward-delete-word
2812 .ne 2
2814 \fB\fBM-dw\fR\fR
2816 .RS 21n
2817 forward-delete-word
2821 .ne 2
2823 \fB\fBM-dW\fR\fR
2825 .RS 21n
2826 forward-delete-word
2830 .ne 2
2832 \fB\fBM-dF\fR\fR
2834 .RS 21n
2835 backward-delete-find
2839 .ne 2
2841 \fB\fBM-df\fR\fR
2843 .RS 21n
2844 forward-delete-find
2848 .ne 2
2850 \fB\fBM-dT\fR\fR
2852 .RS 21n
2853 backward-delete-to
2857 .ne 2
2859 \fB\fBM-dt\fR\fR
2861 .RS 21n
2862 forward-delete-to
2866 .ne 2
2868 \fB\fBM-d;\fR\fR
2870 .RS 21n
2871 delete-refind
2875 .ne 2
2877 \fB\fBM-d,\fR\fR
2879 .RS 21n
2880 delete-invert-refind
2884 .ne 2
2886 \fB\fBM-d^\fR\fR
2888 .RS 21n
2889 backward-kill-line
2893 .ne 2
2895 \fB\fBM-d0\fR\fR
2897 .RS 21n
2898 backward-kill-line
2902 .ne 2
2904 \fB\fBM-d$\fR\fR
2906 .RS 21n
2907 kill-line
2911 .ne 2
2913 \fB\fBM-D\fR\fR
2915 .RS 21n
2916 kill-line
2920 .ne 2
2922 \fB\fBM-d|\fR\fR
2924 .RS 21n
2925 delete-to-column
2929 .ne 2
2931 \fB\fBM-d%\fR\fR
2933 .RS 21n
2934 delete-to-parenthesis
2938 .ne 2
2940 \fB\fBM-e\fR\fR
2942 .RS 21n
2943 forward-word
2947 .ne 2
2949 \fB\fBM-E\fR\fR
2951 .RS 21n
2952 forward-word
2956 .ne 2
2958 \fB\fBM-f\fR\fR
2960 .RS 21n
2961 forward-find-char
2965 .ne 2
2967 \fB\fBM-F\fR\fR
2969 .RS 21n
2970 backward-find-char
2974 .ne 2
2976 \fB\fBM--\fR\fR
2978 .RS 21n
2979 up-history
2983 .ne 2
2985 \fB\fBM-h\fR\fR
2987 .RS 21n
2988 cursor-left
2992 .ne 2
2994 \fB\fBM-H\fR\fR
2996 .RS 21n
2997 beginning-of-history
3001 .ne 2
3003 \fB\fBM-i\fR\fR
3005 .RS 21n
3006 vi-insert
3010 .ne 2
3012 \fB\fBM-I\fR\fR
3014 .RS 21n
3015 vi-insert-at-bol
3019 .ne 2
3021 \fB\fBM-j\fR\fR
3023 .RS 21n
3024 down-history
3028 .ne 2
3030 \fB\fBM-J\fR\fR
3032 .RS 21n
3033 history-search-forward
3037 .ne 2
3039 \fB\fBM-k\fR\fR
3041 .RS 21n
3042 up-history
3046 .ne 2
3048 \fB\fBM-K\fR\fR
3050 .RS 21n
3051 history-search-backward
3055 .ne 2
3057 \fB\fBM-l\fR\fR
3059 .RS 21n
3060 cursor-right
3064 .ne 2
3066 \fB\fBM-L\fR\fR
3068 .RS 21n
3069 end-of-history
3073 .ne 2
3075 \fB\fBM-n\fR\fR
3077 .RS 21n
3078 history-re-search-forward
3082 .ne 2
3084 \fB\fBM-N\fR\fR
3086 .RS 21n
3087 history-re-search-backward
3091 .ne 2
3093 \fB\fBM-p\fR\fR
3095 .RS 21n
3096 append-yank
3100 .ne 2
3102 \fB\fBM-P\fR\fR
3104 .RS 21n
3105 yank
3109 .ne 2
3111 \fB\fBM-r\fR\fR
3113 .RS 21n
3114 vi-replace-char
3118 .ne 2
3120 \fB\fBM-R\fR\fR
3122 .RS 21n
3123 vi-overwrite
3127 .ne 2
3129 \fB\fBM-s\fR\fR
3131 .RS 21n
3132 vi-forward-change-char
3136 .ne 2
3138 \fB\fBM-S\fR\fR
3140 .RS 21n
3141 vi-change-line
3145 .ne 2
3147 \fB\fBM-t\fR\fR
3149 .RS 21n
3150 forward-to-char
3154 .ne 2
3156 \fB\fBM-T\fR\fR
3158 .RS 21n
3159 backward-to-char
3163 .ne 2
3165 \fB\fBM-u\fR\fR
3167 .RS 21n
3168 vi-undo
3172 .ne 2
3174 \fB\fBM-w\fR\fR
3176 .RS 21n
3177 forward-to-word
3181 .ne 2
3183 \fB\fBM-W\fR\fR
3185 .RS 21n
3186 forward-to-word
3190 .ne 2
3192 \fB\fBM-x\fR\fR
3194 .RS 21n
3195 forward-delete-char
3199 .ne 2
3201 \fB\fBM-X\fR\fR
3203 .RS 21n
3204 backward-delete-char
3208 .ne 2
3210 \fB\fBM-yh\fR\fR
3212 .RS 21n
3213 backward-copy-char
3217 .ne 2
3219 \fB\fBM-y^H\fR\fR
3221 .RS 21n
3222 backward-copy-char
3226 .ne 2
3228 \fB\fBM-y^?\fR\fR
3230 .RS 21n
3231 backward-copy-char
3235 .ne 2
3237 \fB\fBM-yl\fR\fR
3239 .RS 21n
3240 forward-copy-char
3244 .ne 2
3246 \fBM-y<space>\fR
3248 .RS 21n
3249 forward-copy-char (META-y-space)
3253 .ne 2
3255 \fB\fBM-ye\fR\fR
3257 .RS 21n
3258 forward-copy-word
3262 .ne 2
3264 \fB\fBM-yE\fR\fR
3266 .RS 21n
3267 forward-copy-word
3271 .ne 2
3273 \fB\fBM-yw\fR\fR
3275 .RS 21n
3276 forward-copy-word
3280 .ne 2
3282 \fB\fBM-yW\fR\fR
3284 .RS 21n
3285 forward-copy-word
3289 .ne 2
3291 \fB\fBM-yb\fR\fR
3293 .RS 21n
3294 backward-copy-word
3298 .ne 2
3300 \fB\fBM-yB\fR\fR
3302 .RS 21n
3303 backward-copy-word
3307 .ne 2
3309 \fB\fBM-yf\fR\fR
3311 .RS 21n
3312 forward-copy-find
3316 .ne 2
3318 \fB\fBM-yF\fR\fR
3320 .RS 21n
3321 backward-copy-find
3325 .ne 2
3327 \fB\fBM-yt\fR\fR
3329 .RS 21n
3330 forward-copy-to
3334 .ne 2
3336 \fB\fBM-yT\fR\fR
3338 .RS 21n
3339 backward-copy-to
3343 .ne 2
3345 \fB\fBM-y;\fR\fR
3347 .RS 21n
3348 copy-refind
3352 .ne 2
3354 \fB\fBM-y,\fR\fR
3356 .RS 21n
3357 copy-invert-refind
3361 .ne 2
3363 \fB\fBM-y^\fR\fR
3365 .RS 21n
3366 copy-to-bol
3370 .ne 2
3372 \fB\fBM-y0\fR\fR
3374 .RS 21n
3375 copy-to-bol
3379 .ne 2
3381 \fB\fBM-y$\fR\fR
3383 .RS 21n
3384 copy-rest-of-line
3388 .ne 2
3390 \fB\fBM-yy\fR\fR
3392 .RS 21n
3393 copy-line
3397 .ne 2
3399 \fB\fBM-Y\fR\fR
3401 .RS 21n
3402 copy-line
3406 .ne 2
3408 \fB\fBM-y|\fR\fR
3410 .RS 21n
3411 copy-to-column
3415 .ne 2
3417 \fB\fBM-y%\fR\fR
3419 .RS 21n
3420 copy-to-parenthesis
3424 .ne 2
3426 \fB\fBM-^E\fR\fR
3428 .RS 21n
3429 emacs-mode
3433 .ne 2
3435 \fB\fBM-^H\fR\fR
3437 .RS 21n
3438 cursor-left
3442 .ne 2
3444 \fB\fBM-^?\fR\fR
3446 .RS 21n
3447 cursor-left
3451 .ne 2
3453 \fB\fBM-^L\fR\fR
3455 .RS 21n
3456 clear-screen
3460 .ne 2
3462 \fB\fBM-^N\fR\fR
3464 .RS 21n
3465 down-history
3469 .ne 2
3471 \fB\fBM-^P\fR\fR
3473 .RS 21n
3474 up-history
3478 .ne 2
3480 \fB\fBM-^R\fR\fR
3482 .RS 21n
3483 redisplay
3487 .ne 2
3489 \fB\fBM-^D\fR\fR
3491 .RS 21n
3492 list-or-eof
3496 .ne 2
3498 \fB\fBM-^I\fR\fR
3500 .RS 21n
3501 complete-word
3505 .ne 2
3507 \fBM-\er\fR
3509 .RS 21n
3510 newline
3514 .ne 2
3516 \fB\fBM-\en\fR\fR
3518 .RS 21n
3519 newline
3523 .ne 2
3525 \fB\fBM-^X^R\fR\fR
3527 .RS 21n
3528 read-init-files
3532 .ne 2
3534 \fB\fBM-^Xh\fR\fR
3536 .RS 21n
3537 list-history
3541 .ne 2
3543 \fB\fBM-0, M-1, ... M-9\fR\fR
3545 .RS 21n
3546 digit-argument (see below)
3551 Note that \fB^I\fR is what the TAB key generates.
3552 .SS "Entering Repeat Counts"
3554 Many of the key binding functions described previously, take an optional count,
3555 typed in before the target key sequence. This is interpreted as a repeat count
3556 by most bindings. A notable exception is the goto-column binding, which
3557 interprets the count as a column number.
3560 By default you can specify this count argument by pressing the META key while
3561 typing in the numeric count. This relies on the digit-argument action being
3562 bound to 'META-0', 'META-1' etc. Once any one of these bindings has been
3563 activated, you can optionally take your finger off the META key to type in the
3564 rest of the number, since every numeric digit thereafter is treated as part of
3565 the number, unless it is preceded by the literal-next binding. As soon as a
3566 non-digit, or literal digit key is pressed the repeat count is terminated and
3567 either causes the just typed character to be added to the line that many times,
3568 or causes the next key binding function to be given that argument.
3571 For example, in \fBemacs\fR mode, typing:
3573 .in +2
3575 M-12a
3577 .in -2
3581 causes the letter 'a' to be added to the line 12 times, whereas
3583 .in +2
3585 M-4M-c
3587 .in -2
3591 Capitalizes the next 4 words.
3594 In \fBvi\fR command mode the meta modifier is automatically added to all
3595 characters typed in, so to enter a count in \fBvi\fR command-mode, just
3596 involves typing in the number, just as it does in the \fBvi\fR editor itself.
3597 So for example, in vi command mode, typing:
3599 .in +2
3601 4w2x
3603 .in -2
3607 moves the cursor four words to the right, then deletes two characters.
3610 You can also bind digit-argument to other key sequences. If these end in a
3611 numeric digit, that digit gets appended to the current repeat count. If it
3612 doesn't end in a numeric digit, a new repeat count is started with a value of
3613 zero, and can be completed by typing in the number, after letting go of the key
3614 which triggered the digit-argument action.
3615 .SH FILES
3616 .ne 2
3618 \fB\fB/usr/lib/libtecla.so\fR\fR
3620 .RS 27n
3621 The tecla library
3625 .ne 2
3627 \fB\fB/usr/include/libtecla.h\fR\fR
3629 .RS 27n
3630 The tecla header file
3634 .ne 2
3636 \fB\fB~/.teclarc\fR\fR
3638 .RS 27n
3639 The personal tecla customization file
3642 .SH ATTRIBUTES
3644 See \fBattributes\fR(5) for descriptions of the following attributes:
3649 box;
3650 c | c
3651 l | l .
3652 ATTRIBUTE TYPE  ATTRIBUTE VALUE
3654 Interface Stability     Evolving
3657 .SH SEE ALSO
3659 \fBvi\fR(1), \fBcpl_complete_word\fR(3TECLA), \fBef_expand_file\fR(3TECLA),
3660 \fBgl_get_line\fR(3TECLA), \fBgl_io_mode\fR(3TECLA), \fBlibtecla\fR(3LIB),
3661 \fBpca_lookup_file\fR(3TECLA), \fBattributes\fR(5)