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.
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.
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"
29 tecla, teclarc \- User interface provided by the tecla library.
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 shell\fR 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
45 .SS "Key Sequence Notation"
47 In the rest of this man page, and also in all tecla configuration files, key
48 sequences are expressed as follows.
52 \fB\fB^A\fR or \fBC-a\fR\fR
55 This is a 'CONTROL-A', entered by pressing the CONTROL key at the same time as
62 \fB\fB\E\fR or \fBM-\fR\fR
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'.
78 This refers to the up-arrow key.
87 This refers to the down-arrow key.
96 This refers to the left-arrow key.
105 This refers to the right-arrow key.
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:
134 This will re-configure the default bindings for \fBvi\fR-mode. The complete set
135 of arguments that this command accepts are:
142 Install key bindings like those of the \fBvi\fR editor.
151 Install key bindings like those of the \fBemacs\fR editor. This is the default.
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:
176 An example of a key binding line in the configuration file is the following.
180 bind M-[2~ insert-mode
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.
198 Hit the ESCAPE key momentarily, then press '[', then '2', then finally '~'.
203 Press the META key at the same time as pressing the '[' key, then press '2',
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
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
227 bind up history-search-backwards
228 bind down history-search-backwards
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:
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
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
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
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:
318 \fBemacs\fR ~/tecla/getline.c
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 interpretted as a pattern to be matched.
341 Thus, cotinuing with the above example, after typing in the list of commands
342 shown, if you then typed:
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).
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
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,
375 setlocale(LC_CTYPE, "");
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
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
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,
421 XTerm*EightBitInput: False
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:
447 xmodmap -e 'keycode 115 = Multi_key'
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.
467 Send a SIGINT signal to the parent process.
476 Suspend the parent process.
485 Pause terminal output.
494 Resume paused terminal output.
503 Arrange for the next character to be treated as a normal character. This allows
504 control characters to be entered.
513 Move the cursor one character right.
522 Move the cursor one character left.
531 Toggle between insert mode and overwrite mode.
537 \fBbeginning-of-line\fR
540 Move the cursor to the beginning of the line.
549 Move the cursor to the end of the line.
558 Delete the contents of the current line.
567 Delete everything that follows the cursor.
573 \fBbackward-kill-line\fR
576 Delete all characters between the cursor and the start of the line.
585 Move to the end of the word which follows the cursor.
591 \fBforward-to-word\fR
594 Move the cursor to the start of the word that follows the cursor.
603 Move to the start of the word which precedes the cursor.
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).
619 \fBfind-parenthesis\fR
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.
630 \fBforward-delete-char\fR
633 Delete the character under the cursor.
639 \fBbackward-delete-char\fR
642 Delete the character which precedes the cursor.
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.
660 \fBdel-char-or-list-or-eof\fR
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
673 \fBforward-delete-word\fR
676 Delete the word which follows the cursor.
682 \fBbackward-delete-word\fR
685 Delete the word which precedes the cursor.
694 Convert all of the characters of the word which follows the cursor, to upper
704 Convert all of the characters of the word which follows the cursor, to lower
711 \fBcapitalize-word\fR
714 Capitalize the word which follows the cursor.
723 If the next character is upper case, toggle it to lower case and vice versa.
741 Clear the terminal, then redisplay the current line.
747 \fBtranspose-chars\fR
750 Swap the character under the cursor with the character just before the cursor.
759 Set a mark at the position of the cursor.
765 \fBexchange-point-and-mark\fR
768 Move the cursor to the last mark that was set, and move the mark to where the
778 Delete the characters that lie between the last mark that was set, and the
785 \fBcopy-region-as-kill\fR
788 Copy the text between the mark and the cursor to the cut buffer, without
789 deleting the original text.
798 Insert the text that was last deleted, just before the current position of the
808 Paste the current contents of the cut buffer, after the cursor.
817 Recall the next oldest line that was entered. Note that in \fBvi\fR mode you
818 are left in command mode.
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.
835 \fBhistory-search-backward\fR
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
847 \fBhistory-search-forward\fR
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
859 \fBhistory-re-search-backward\fR
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.
869 \fBhistory-re-search-forward\fR
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.
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 commmand mode the character under the cursor is also included in
885 the word being completed, and you are left in \fBvi\fR insert mode.
891 \fBexpand-filename\fR
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 commmand 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.
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
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.
928 Temporarily switch to reading input from the file who's name precedes the
935 \fBread-init-files\fR
938 Re-read \fBteclarc\fR configuration files.
944 \fBbeginning-of-history\fR
947 Move to the oldest line in the history list. Note that in \fBvi\fR mode you are
948 left in command mode.
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.
967 Enter a repeat count for the next key binding function. For details, see the
968 Entering Repeat Counts section.
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 '\n'
981 newline character or the '\er' carriage return character, the line is appended
982 to the history buffer.
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
1004 Ring the terminal bell, unless the bell has been silenced via the nobeep
1005 configuration option (see The Tecla Configuration File section).
1011 \fBforward-copy-char\fR
1014 Copy the next character into the cut buffer (NB. use repeat counts to copy more
1021 \fBbackward-copy-char\fR
1024 Copy the previous character into the cut buffer.
1030 \fBforward-copy-word\fR
1033 Copy the next word into the cut buffer.
1039 \fBbackward-copy-word\fR
1042 Copy the previous word into the cut buffer.
1048 \fBforward-find-char\fR
1051 Move the cursor to the next occurrence of the next character that you type.
1057 \fBbackward-find-char\fR
1060 Move the cursor to the last occurrence of the next character that you type.
1066 \fBforward-to-char\fR
1069 Move the cursor to the character just before the next occurrence of the next
1070 character that the user types.
1076 \fBbackward-to-char\fR
1079 Move the cursor to the character just after the last occurrence before the
1080 cursor of the next character that the user types.
1086 \fBrepeat-find-char\fR
1089 Repeat the last backward-find-char, forward-find-char, backward-to-char or
1096 \fBinvert-refind-char\fR
1099 Repeat the last backward-find-char, forward-find-char, backward-to-char, or
1100 forward-to-char in the opposite direction.
1106 \fBdelete-to-column\fR
1109 Delete the characters from the cursor up to the column that is specified by the
1116 \fBdelete-to-parenthesis\fR
1119 Delete the characters from the cursor up to and including the matching
1120 parenthesis, or next close parenthesis.
1126 \fBforward-delete-find\fR
1129 Delete the characters from the cursor up to and including the following
1130 occurrence of the next character typed.
1136 \fBbackward-delete-find\fR
1139 Delete the characters from the cursor up to and including the preceding
1140 occurrence of the next character typed.
1146 \fBforward-delete-to\fR
1149 Delete the characters from the cursor up to, but not including, the following
1150 occurrence of the next character typed.
1156 \fBbackward-delete-to\fR
1159 Delete the characters from the cursor up to, but not including, the preceding
1160 occurrence of the next character typed.
1169 Repeat the last *-delete-find or *-delete-to action.
1175 \fBdelete-invert-refind\fR
1178 Repeat the last *-delete-find or *-delete-to action, in the opposite direction.
1184 \fBcopy-to-column\fR
1187 Copy the characters from the cursor up to the column that is specified by the
1188 repeat count, into the cut buffer.
1194 \fBcopy-to-parenthesis\fR
1197 Copy the characters from the cursor up to and including the matching
1198 parenthesis, or next close parenthesis, into the cut buffer.
1204 \fBforward-copy-find\fR
1207 Copy the characters from the cursor up to and including the following occurrence
1208 of the next character typed, into the cut buffer.
1214 \fBbackward-copy-find\fR
1217 Copy the characters from the cursor up to and including the preceding occurrence
1218 of the next character typed, into the cut buffer.
1224 \fBforward-copy-to\fR
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.
1234 \fBbackward-copy-to\fR
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.
1247 Repeat the last *-copy-find or *-copy-to action.
1253 \fBcopy-invert-refind\fR
1256 Repeat the last *-copy-find or *-copy-to action, in the opposite direction.
1265 Switch to \fBvi\fR mode from emacs mode.
1274 Switch to \fBemacs\fR mode from \fBvi\fR mode.
1283 From \fBvi\fR command mode, switch to insert mode.
1292 From \fBvi\fR command mode, switch to overwrite mode.
1298 \fBvi-insert-at-bol\fR
1301 From \fBvi\fR command mode, move the cursor to the start of the line and switch
1308 \fBvi-append-at-eol\fR
1311 From \fBvi\fR command mode, move the cursor to the end of the line and switch
1321 From \fBvi\fR command mode, move the cursor one position right, and switch to
1328 \fBvi-replace-char\fR
1331 From \fBvi\fR command mode, replace the character under the cursor with the
1332 next character entered.
1338 \fBvi-forward-change-char\fR
1341 From \fBvi\fR command mode, delete the next character then enter insert mode.
1347 \fBvi-backward-change-char\fR
1350 From vi command mode, delete the preceding character then enter insert mode.
1356 \fBvi-forward-change-word\fR
1359 From \fBvi\fR command mode, delete the next word then enter insert mode.
1365 \fBvi-backward-change-word\fR
1368 From vi command mode, delete the preceding word then enter insert mode.
1374 \fBvi-change-rest-of-line\fR
1377 From \fBvi\fR command mode, delete from the cursor to the end of the line, then
1384 \fBvi-change-line\fR
1387 From \fBvi\fR command mode, delete the current line, then enter insert mode.
1393 \fBvi-change-to-bol\fR
1396 From \fBvi\fR command mode, delete all characters between the cursor and the
1397 beginning of the line, then enter insert mode.
1403 \fBvi-change-to-column\fR
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.
1413 \fBvi-change-to-parenthesis\fR
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.
1423 \fBvi-forward-change-find\fR
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
1434 \fBvi-backward-change-find\fR
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.
1444 \fBvi-forward-change-to\fR
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
1455 \fBvi-backward-change-to\fR
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
1466 \fBvi-change-refind\fR
1469 Repeat the last vi-*-change-find or vi-*-change-to action.
1475 \fBvi-change-invert-refind\fR
1478 Repeat the last vi-*-change-find or vi-*-change-to action, in the opposite
1488 In \fBvi\fR mode, undo the last editing operation.
1494 \fBvi-repeat-change\fR
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 overriden by the tecla
1503 configuration file, are designed to mimic most of the bindings of the unix
1504 \fBtcsh shell\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.
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
1612 The remaining bindings don't depend on the terminal setttings.
1700 del-char-or-list-or-eof
1709 backward-delete-char
1718 backward-delete-char
1736 backward-delete-word
1745 backward-delete-word
1817 exchange-point-and-mark
1871 history-search-backward
1880 history-search-forward
1943 beginning-of-history
1994 \fB\fBM-0, M-1, ... M-9\fR\fR
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
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.
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
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
2212 backward-delete-char
2293 backward-delete-word
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
2349 cursor-right (META-space)
2394 beginning-of-history
2511 vi-change-rest-of-line
2520 vi-backward-change-word
2529 vi-backward-change-word
2547 vi-forward-change-word
2556 vi-forward-change-word
2565 vi-forward-change-word
2574 vi-forward-change-word
2583 vi-backward-change-find
2592 vi-forward-change-find
2601 vi-backward-change-to
2610 vi-forward-change-to
2628 vi-change-invert-refind
2637 vi-backward-change-char
2646 vi-backward-change-char
2655 vi-backward-change-char
2664 vi-forward-change-char
2673 vi-forward-change-char (META-c-space)
2700 vi-change-rest-of-line
2718 vi-change-to-parenthesis
2727 backward-delete-char
2736 backward-delete-char
2745 backward-delete-char
2763 forward-delete-char (META-d-space)
2781 backward-delete-word
2790 backward-delete-word
2835 backward-delete-find
2880 delete-invert-refind
2934 delete-to-parenthesis
2997 beginning-of-history
3033 history-search-forward
3051 history-search-backward
3078 history-re-search-forward
3087 history-re-search-backward
3132 vi-forward-change-char
3204 backward-delete-char
3249 forward-copy-char (META-y-space)
3543 \fB\fBM-0, M-1, ... M-9\fR\fR
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:
3581 causes the letter 'a' to be added to the line 12 times, whereas
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:
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.
3618 \fB\fB/usr/lib/libtecla.so\fR\fR
3627 \fB\fB/usr/include/libtecla.h\fR\fR
3630 The tecla header file
3636 \fB\fB~/.teclarc\fR\fR
3639 The personal tecla customization file
3644 See \fBattributes\fR(5) for descriptions of the following attributes:
3652 ATTRIBUTE TYPE ATTRIBUTE VALUE
3654 Interface Stability Evolving
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)