1 | /* $Header: /afs/dev.mit.edu/source/repository/third/tcsh/ed.defns.c,v 1.2 1996-10-03 04:35:38 ghudson Exp $ */ |
---|
2 | /* |
---|
3 | * ed.defns.c: Editor function definitions and initialization |
---|
4 | */ |
---|
5 | /*- |
---|
6 | * Copyright (c) 1980, 1991 The Regents of the University of California. |
---|
7 | * All rights reserved. |
---|
8 | * |
---|
9 | * Redistribution and use in source and binary forms, with or without |
---|
10 | * modification, are permitted provided that the following conditions |
---|
11 | * are met: |
---|
12 | * 1. Redistributions of source code must retain the above copyright |
---|
13 | * notice, this list of conditions and the following disclaimer. |
---|
14 | * 2. Redistributions in binary form must reproduce the above copyright |
---|
15 | * notice, this list of conditions and the following disclaimer in the |
---|
16 | * documentation and/or other materials provided with the distribution. |
---|
17 | * 3. All advertising materials mentioning features or use of this software |
---|
18 | * must display the following acknowledgement: |
---|
19 | * This product includes software developed by the University of |
---|
20 | * California, Berkeley and its contributors. |
---|
21 | * 4. Neither the name of the University nor the names of its contributors |
---|
22 | * may be used to endorse or promote products derived from this software |
---|
23 | * without specific prior written permission. |
---|
24 | * |
---|
25 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
---|
26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
---|
29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
---|
30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
---|
31 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
---|
32 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
---|
33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
---|
34 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
---|
35 | * SUCH DAMAGE. |
---|
36 | */ |
---|
37 | #include "sh.h" |
---|
38 | |
---|
39 | RCSID("$Id: ed.defns.c,v 1.2 1996-10-03 04:35:38 ghudson Exp $") |
---|
40 | |
---|
41 | #include "ed.h" |
---|
42 | |
---|
43 | static void ed_InitMetaBindings __P((void)); |
---|
44 | |
---|
45 | PFCmd CcFuncTbl[] = { /* table of available commands */ |
---|
46 | e_unassigned, |
---|
47 | /* no #define here -- this is a dummy to detect initing of the key map */ |
---|
48 | e_unassigned, |
---|
49 | #define F_UNASSIGNED 1 |
---|
50 | e_insert, |
---|
51 | #define F_INSERT 2 |
---|
52 | e_newline, |
---|
53 | #define F_NEWLINE 3 |
---|
54 | e_delprev, |
---|
55 | #define F_DELPREV 4 |
---|
56 | e_delnext, |
---|
57 | #define F_DELNEXT 5 |
---|
58 | e_toend, |
---|
59 | #define F_TOEND 6 |
---|
60 | e_tobeg, |
---|
61 | #define F_TOBEG 7 |
---|
62 | e_charback, |
---|
63 | #define F_CHARBACK 8 |
---|
64 | e_charfwd, |
---|
65 | #define F_CHARFWD 9 |
---|
66 | e_quote, |
---|
67 | #define F_QUOTE 10 |
---|
68 | e_startover, |
---|
69 | #define F_STARTOVER 11 |
---|
70 | e_redisp, |
---|
71 | #define F_REDISP 12 |
---|
72 | e_tty_int, |
---|
73 | #define F_TTY_INT 13 |
---|
74 | e_wordback, |
---|
75 | #define F_WORDBACK 14 |
---|
76 | e_wordfwd, |
---|
77 | #define F_WORDFWD 15 |
---|
78 | e_cleardisp, |
---|
79 | #define F_CLEARDISP 16 |
---|
80 | e_complete, |
---|
81 | #define F_COMPLETE 17 |
---|
82 | e_correct, |
---|
83 | #define F_CORRECT 18 |
---|
84 | e_up_hist, |
---|
85 | #define F_UP_HIST 19 |
---|
86 | e_down_hist, |
---|
87 | #define F_DOWN_HIST 20 |
---|
88 | e_up_search_hist, |
---|
89 | #define F_UP_SEARCH_HIST 21 |
---|
90 | e_down_search_hist, |
---|
91 | #define F_DOWN_SEARCH_HIST 22 |
---|
92 | e_helpme, |
---|
93 | #define F_HELPME 23 |
---|
94 | e_list_choices, |
---|
95 | #define F_LIST_CHOICES 24 |
---|
96 | e_delwordprev, |
---|
97 | #define F_DELWORDPREV 25 |
---|
98 | e_delwordnext, |
---|
99 | #define F_DELWORDNEXT 26 |
---|
100 | e_digit, |
---|
101 | #define F_DIGIT 27 |
---|
102 | e_killend, |
---|
103 | #define F_KILLEND 28 |
---|
104 | e_killbeg, |
---|
105 | #define F_KILLBEG 29 |
---|
106 | e_metanext, |
---|
107 | #define F_METANEXT 30 |
---|
108 | e_send_eof, |
---|
109 | #define F_SEND_EOF 31 |
---|
110 | e_charswitch, |
---|
111 | #define F_CHARSWITCH 32 |
---|
112 | e_which, |
---|
113 | #define F_WHICH 33 |
---|
114 | e_yank_kill, |
---|
115 | #define F_YANK_KILL 34 |
---|
116 | e_tty_dsusp, |
---|
117 | #define F_TTY_DSUSP 35 |
---|
118 | e_tty_flusho, |
---|
119 | #define F_TTY_FLUSHO 36 |
---|
120 | e_tty_quit, |
---|
121 | #define F_TTY_QUIT 37 |
---|
122 | e_tty_tsusp, |
---|
123 | #define F_TTY_TSUSP 38 |
---|
124 | e_tty_stopo, |
---|
125 | #define F_TTY_STOPO 39 |
---|
126 | e_tty_starto, |
---|
127 | #define F_TTY_STARTO 40 |
---|
128 | e_argfour, |
---|
129 | #define F_ARGFOUR 41 |
---|
130 | e_set_mark, |
---|
131 | #define F_SET_MARK 42 |
---|
132 | e_exchange_mark, |
---|
133 | #define F_EXCHANGE_MARK 43 |
---|
134 | e_last_item, |
---|
135 | #define F_LAST_ITEM 44 |
---|
136 | e_list_delnext, |
---|
137 | #define F_LIST_DELNEXT 45 |
---|
138 | v_cmd_mode, |
---|
139 | #define V_CMD_MODE 46 |
---|
140 | v_insert, |
---|
141 | #define V_INSERT 47 |
---|
142 | e_argdigit, |
---|
143 | #define F_ARGDIGIT 48 |
---|
144 | e_killregion, |
---|
145 | #define F_KILLREGION 49 |
---|
146 | e_copyregion, |
---|
147 | #define F_COPYREGION 50 |
---|
148 | e_gcharswitch, |
---|
149 | #define F_GCHARSWITCH 51 |
---|
150 | e_run_fg_editor, |
---|
151 | #define F_RUN_FG_EDITOR 52 |
---|
152 | e_unassigned, /* place holder for sequence lead in character */ |
---|
153 | #define F_XKEY 53 |
---|
154 | e_uppercase, |
---|
155 | #define F_CASEUPPER 54 |
---|
156 | e_lowercase, |
---|
157 | #define F_CASELOWER 55 |
---|
158 | e_capitolcase, |
---|
159 | #define F_CASECAPITAL 56 |
---|
160 | v_zero, |
---|
161 | #define V_ZERO 57 |
---|
162 | v_add, |
---|
163 | #define V_ADD 58 |
---|
164 | v_addend, |
---|
165 | #define V_ADDEND 59 |
---|
166 | v_wordbegnext, |
---|
167 | #define V_WORDBEGNEXT 60 |
---|
168 | e_killall, |
---|
169 | #define F_KILLALL 61 |
---|
170 | e_unassigned, |
---|
171 | /* F_EXTENDNEXT removed */ |
---|
172 | v_insbeg, |
---|
173 | #define V_INSBEG 63 |
---|
174 | v_replmode, |
---|
175 | #define V_REPLMODE 64 |
---|
176 | v_replone, |
---|
177 | #define V_REPLONE 65 |
---|
178 | v_substline, |
---|
179 | #define V_SUBSTLINE 66 |
---|
180 | v_substchar, |
---|
181 | #define V_SUBSTCHAR 67 |
---|
182 | v_chgtoend, |
---|
183 | #define V_CHGTOEND 68 |
---|
184 | e_list_eof, |
---|
185 | #define F_LIST_EOF 69 |
---|
186 | e_list_glob, |
---|
187 | #define F_LIST_GLOB 70 |
---|
188 | e_expand_history, |
---|
189 | #define F_EXPAND_HISTORY 71 |
---|
190 | e_magic_space, |
---|
191 | #define F_MAGIC_SPACE 72 |
---|
192 | e_insovr, |
---|
193 | #define F_INSOVR 73 |
---|
194 | v_cm_complete, |
---|
195 | #define V_CM_COMPLETE 74 |
---|
196 | e_copyprev, |
---|
197 | #define F_COPYPREV 75 |
---|
198 | e_correctl, |
---|
199 | #define F_CORRECT_L 76 |
---|
200 | e_expand_glob, |
---|
201 | #define F_EXPAND_GLOB 77 |
---|
202 | e_expand_vars, |
---|
203 | #define F_EXPAND_VARS 78 |
---|
204 | e_toggle_hist, |
---|
205 | #define F_TOGGLE_HIST 79 |
---|
206 | v_change_case, |
---|
207 | #define V_CHGCASE 80 |
---|
208 | e_expand, |
---|
209 | #define F_EXPAND 81 |
---|
210 | e_load_average, |
---|
211 | #define F_LOAD_AVERAGE 82 |
---|
212 | v_delprev, |
---|
213 | #define V_DELPREV 83 |
---|
214 | v_delmeta, |
---|
215 | #define V_DELMETA 84 |
---|
216 | v_wordfwd, |
---|
217 | #define V_WORDFWD 85 |
---|
218 | v_wordback, |
---|
219 | #define V_WORDBACK 86 |
---|
220 | v_endword, |
---|
221 | #define V_ENDWORD 87 |
---|
222 | v_eword, |
---|
223 | #define V_EWORD 88 |
---|
224 | v_undo, |
---|
225 | #define V_UNDO 89 |
---|
226 | v_ush_meta, |
---|
227 | #define V_USH_META 90 |
---|
228 | v_dsh_meta, |
---|
229 | #define V_DSH_META 91 |
---|
230 | v_rsrch_fwd, |
---|
231 | #define V_RSRCH_FWD 92 |
---|
232 | v_rsrch_back, |
---|
233 | #define V_RSRCH_BACK 93 |
---|
234 | v_char_fwd, |
---|
235 | #define V_CHAR_FWD 94 |
---|
236 | v_char_back, |
---|
237 | #define V_CHAR_BACK 95 |
---|
238 | v_chgmeta, |
---|
239 | #define V_CHGMETA 96 |
---|
240 | e_inc_fwd, |
---|
241 | #define F_INC_FWD 97 |
---|
242 | e_inc_back, |
---|
243 | #define F_INC_BACK 98 |
---|
244 | v_rchar_fwd, |
---|
245 | #define V_RCHAR_FWD 99 |
---|
246 | v_rchar_back, |
---|
247 | #define V_RCHAR_BACK 100 |
---|
248 | v_charto_fwd, |
---|
249 | #define V_CHARTO_FWD 101 |
---|
250 | v_charto_back, |
---|
251 | #define V_CHARTO_BACK 102 |
---|
252 | e_normalize_path, |
---|
253 | #define F_PATH_NORM 103 |
---|
254 | e_delnext_eof, /* added by mtk@ari.ncl.omron.co.jp (920818) */ |
---|
255 | #define F_DELNEXT_EOF 104 |
---|
256 | e_stuff_char, |
---|
257 | #define F_STUFF_CHAR 105 |
---|
258 | e_complete_all, |
---|
259 | #define F_COMPLETE_ALL 106 |
---|
260 | e_list_all, |
---|
261 | #define F_LIST_ALL 107 |
---|
262 | 0 /* DUMMY VALUE */ |
---|
263 | #define F_NUM_FNS 108 |
---|
264 | }; |
---|
265 | |
---|
266 | KEYCMD NumFuns = F_NUM_FNS; |
---|
267 | |
---|
268 | KEYCMD CcKeyMap[256]; /* the real key map */ |
---|
269 | KEYCMD CcAltMap[256]; /* the alternative key map */ |
---|
270 | |
---|
271 | KEYCMD CcEmacsMap[] = { |
---|
272 | /* keymap table, each index into above tbl; should be 256*sizeof(KEYCMD) |
---|
273 | bytes long */ |
---|
274 | |
---|
275 | F_SET_MARK, /* ^@ */ |
---|
276 | F_TOBEG, /* ^A */ |
---|
277 | F_CHARBACK, /* ^B */ |
---|
278 | F_TTY_INT, /* ^C */ |
---|
279 | F_LIST_DELNEXT, /* ^D */ |
---|
280 | F_TOEND, /* ^E */ |
---|
281 | F_CHARFWD, /* ^F */ |
---|
282 | F_UNASSIGNED, /* ^G */ |
---|
283 | F_DELPREV, /* ^H */ |
---|
284 | F_COMPLETE, /* ^I */ |
---|
285 | F_NEWLINE, /* ^J */ |
---|
286 | F_KILLEND, /* ^K */ |
---|
287 | F_CLEARDISP, /* ^L */ |
---|
288 | F_NEWLINE, /* ^M */ |
---|
289 | F_DOWN_HIST, /* ^N */ |
---|
290 | F_TTY_FLUSHO, /* ^O */ |
---|
291 | F_UP_HIST, /* ^P */ |
---|
292 | F_TTY_STARTO, /* ^Q */ |
---|
293 | F_REDISP, /* ^R */ |
---|
294 | F_TTY_STOPO, /* ^S */ |
---|
295 | F_CHARSWITCH, /* ^T */ |
---|
296 | F_KILLALL, /* ^U */ |
---|
297 | F_QUOTE, /* ^V */ |
---|
298 | F_DELWORDPREV, /* ^W */ |
---|
299 | F_XKEY, /* ^X */ |
---|
300 | F_YANK_KILL, /* ^Y */ |
---|
301 | F_COMPLETE, /* ^Z */ |
---|
302 | F_METANEXT, /* ^[ */ |
---|
303 | F_TTY_QUIT, /* ^\ */ |
---|
304 | F_TTY_DSUSP, /* ^] */ |
---|
305 | F_UNASSIGNED, /* ^^ */ |
---|
306 | F_UNASSIGNED, /* ^_ */ |
---|
307 | F_MAGIC_SPACE, /* SPACE */ |
---|
308 | F_INSERT, /* ! */ |
---|
309 | F_INSERT, /* " */ |
---|
310 | F_INSERT, /* # */ |
---|
311 | F_INSERT, /* $ */ |
---|
312 | F_INSERT, /* % */ |
---|
313 | F_INSERT, /* & */ |
---|
314 | F_INSERT, /* ' */ |
---|
315 | F_INSERT, /* ( */ |
---|
316 | F_INSERT, /* ) */ |
---|
317 | F_INSERT, /* * */ |
---|
318 | F_INSERT, /* + */ |
---|
319 | F_INSERT, /* , */ |
---|
320 | F_INSERT, /* - */ |
---|
321 | F_INSERT, /* . */ |
---|
322 | F_INSERT, /* / */ |
---|
323 | F_DIGIT, /* 0 */ |
---|
324 | F_DIGIT, /* 1 */ |
---|
325 | F_DIGIT, /* 2 */ |
---|
326 | F_DIGIT, /* 3 */ |
---|
327 | F_DIGIT, /* 4 */ |
---|
328 | F_DIGIT, /* 5 */ |
---|
329 | F_DIGIT, /* 6 */ |
---|
330 | F_DIGIT, /* 7 */ |
---|
331 | F_DIGIT, /* 8 */ |
---|
332 | F_DIGIT, /* 9 */ |
---|
333 | F_INSERT, /* : */ |
---|
334 | F_INSERT, /* ; */ |
---|
335 | F_INSERT, /* < */ |
---|
336 | F_INSERT, /* = */ |
---|
337 | F_INSERT, /* > */ |
---|
338 | F_INSERT, /* ? */ |
---|
339 | F_INSERT, /* @ */ |
---|
340 | F_INSERT, /* A */ |
---|
341 | F_INSERT, /* B */ |
---|
342 | F_INSERT, /* C */ |
---|
343 | F_INSERT, /* D */ |
---|
344 | F_INSERT, /* E */ |
---|
345 | F_INSERT, /* F */ |
---|
346 | F_INSERT, /* G */ |
---|
347 | F_INSERT, /* H */ |
---|
348 | F_INSERT, /* I */ |
---|
349 | F_INSERT, /* J */ |
---|
350 | F_INSERT, /* K */ |
---|
351 | F_INSERT, /* L */ |
---|
352 | F_INSERT, /* M */ |
---|
353 | F_INSERT, /* N */ |
---|
354 | F_INSERT, /* O */ |
---|
355 | F_INSERT, /* P */ |
---|
356 | F_INSERT, /* Q */ |
---|
357 | F_INSERT, /* R */ |
---|
358 | F_INSERT, /* S */ |
---|
359 | F_INSERT, /* T */ |
---|
360 | F_INSERT, /* U */ |
---|
361 | F_INSERT, /* V */ |
---|
362 | F_INSERT, /* W */ |
---|
363 | F_INSERT, /* X */ |
---|
364 | F_INSERT, /* Y */ |
---|
365 | F_INSERT, /* Z */ |
---|
366 | F_INSERT, /* [ */ |
---|
367 | F_INSERT, /* \ */ |
---|
368 | F_INSERT, /* ] */ |
---|
369 | F_INSERT, /* ^ */ |
---|
370 | F_INSERT, /* _ */ |
---|
371 | F_INSERT, /* ` */ |
---|
372 | F_INSERT, /* a */ |
---|
373 | F_INSERT, /* b */ |
---|
374 | F_INSERT, /* c */ |
---|
375 | F_INSERT, /* d */ |
---|
376 | F_INSERT, /* e */ |
---|
377 | F_INSERT, /* f */ |
---|
378 | F_INSERT, /* g */ |
---|
379 | F_INSERT, /* h */ |
---|
380 | F_INSERT, /* i */ |
---|
381 | F_INSERT, /* j */ |
---|
382 | F_INSERT, /* k */ |
---|
383 | F_INSERT, /* l */ |
---|
384 | F_INSERT, /* m */ |
---|
385 | F_INSERT, /* n */ |
---|
386 | F_INSERT, /* o */ |
---|
387 | F_INSERT, /* p */ |
---|
388 | F_INSERT, /* q */ |
---|
389 | F_INSERT, /* r */ |
---|
390 | F_INSERT, /* s */ |
---|
391 | F_INSERT, /* t */ |
---|
392 | F_INSERT, /* u */ |
---|
393 | F_INSERT, /* v */ |
---|
394 | F_INSERT, /* w */ |
---|
395 | F_INSERT, /* x */ |
---|
396 | F_INSERT, /* y */ |
---|
397 | F_INSERT, /* z */ |
---|
398 | F_INSERT, /* { */ |
---|
399 | F_INSERT, /* | */ |
---|
400 | F_INSERT, /* } */ |
---|
401 | F_INSERT, /* ~ */ |
---|
402 | F_DELPREV, /* ^? */ |
---|
403 | F_UNASSIGNED, /* M-^@ */ |
---|
404 | F_UNASSIGNED, /* M-^A */ |
---|
405 | F_UNASSIGNED, /* M-^B */ |
---|
406 | F_UNASSIGNED, /* M-^C */ |
---|
407 | F_LIST_CHOICES, /* M-^D */ |
---|
408 | F_UNASSIGNED, /* M-^E */ |
---|
409 | F_UNASSIGNED, /* M-^F */ |
---|
410 | F_UNASSIGNED, /* M-^G */ |
---|
411 | F_DELWORDPREV, /* M-^H */ |
---|
412 | F_COMPLETE, /* M-^I */ |
---|
413 | F_UNASSIGNED, /* M-^J */ |
---|
414 | F_UNASSIGNED, /* M-^K */ |
---|
415 | F_CLEARDISP, /* M-^L */ |
---|
416 | F_UNASSIGNED, /* M-^M */ |
---|
417 | F_UNASSIGNED, /* M-^N */ |
---|
418 | F_UNASSIGNED, /* M-^O */ |
---|
419 | F_UNASSIGNED, /* M-^P */ |
---|
420 | F_UNASSIGNED, /* M-^Q */ |
---|
421 | F_UNASSIGNED, /* M-^R */ |
---|
422 | F_UNASSIGNED, /* M-^S */ |
---|
423 | F_UNASSIGNED, /* M-^T */ |
---|
424 | F_UNASSIGNED, /* M-^U */ |
---|
425 | F_UNASSIGNED, /* M-^V */ |
---|
426 | F_UNASSIGNED, /* M-^W */ |
---|
427 | F_UNASSIGNED, /* M-^X */ |
---|
428 | F_UNASSIGNED, /* M-^Y */ |
---|
429 | F_RUN_FG_EDITOR, /* M-^Z */ |
---|
430 | F_COMPLETE, /* M-^[ */ |
---|
431 | F_UNASSIGNED, /* M-^\ */ |
---|
432 | F_UNASSIGNED, /* M-^] */ |
---|
433 | F_UNASSIGNED, /* M-^^ */ |
---|
434 | F_COPYPREV, /* M-^_ */ |
---|
435 | F_EXPAND_HISTORY, /* M-SPACE */ |
---|
436 | F_EXPAND_HISTORY, /* M-! */ |
---|
437 | F_UNASSIGNED, /* M-" */ |
---|
438 | F_UNASSIGNED, /* M-# */ |
---|
439 | F_CORRECT_L, /* M-$ */ |
---|
440 | F_UNASSIGNED, /* M-% */ |
---|
441 | F_UNASSIGNED, /* M-& */ |
---|
442 | F_UNASSIGNED, /* M-' */ |
---|
443 | F_UNASSIGNED, /* M-( */ |
---|
444 | F_UNASSIGNED, /* M-) */ |
---|
445 | F_UNASSIGNED, /* M-* */ |
---|
446 | F_UNASSIGNED, /* M-+ */ |
---|
447 | F_UNASSIGNED, /* M-, */ |
---|
448 | F_UNASSIGNED, /* M-- */ |
---|
449 | F_UNASSIGNED, /* M-. */ |
---|
450 | F_UNASSIGNED, /* M-/ */ |
---|
451 | F_ARGDIGIT, /* M-0 */ |
---|
452 | F_ARGDIGIT, /* M-1 */ |
---|
453 | F_ARGDIGIT, /* M-2 */ |
---|
454 | F_ARGDIGIT, /* M-3 */ |
---|
455 | F_ARGDIGIT, /* M-4 */ |
---|
456 | F_ARGDIGIT, /* M-5 */ |
---|
457 | F_ARGDIGIT, /* M-6 */ |
---|
458 | F_ARGDIGIT, /* M-7 */ |
---|
459 | F_ARGDIGIT, /* M-8 */ |
---|
460 | F_ARGDIGIT, /* M-9 */ |
---|
461 | F_UNASSIGNED, /* M-: */ |
---|
462 | F_UNASSIGNED, /* M-; */ |
---|
463 | F_UNASSIGNED, /* M-< */ |
---|
464 | F_UNASSIGNED, /* M-= */ |
---|
465 | F_UNASSIGNED, /* M-> */ |
---|
466 | F_WHICH, /* M-? */ |
---|
467 | F_UNASSIGNED, /* M-@ */ |
---|
468 | F_UNASSIGNED, /* M-A */ |
---|
469 | F_WORDBACK, /* M-B */ |
---|
470 | F_CASECAPITAL, /* M-C */ |
---|
471 | F_DELWORDNEXT, /* M-D */ |
---|
472 | F_UNASSIGNED, /* M-E */ |
---|
473 | F_WORDFWD, /* M-F */ |
---|
474 | F_UNASSIGNED, /* M-G */ |
---|
475 | F_HELPME, /* M-H */ |
---|
476 | F_UNASSIGNED, /* M-I */ |
---|
477 | F_UNASSIGNED, /* M-J */ |
---|
478 | F_UNASSIGNED, /* M-K */ |
---|
479 | F_CASELOWER, /* M-L */ |
---|
480 | F_UNASSIGNED, /* M-M */ |
---|
481 | F_DOWN_SEARCH_HIST, /* M-N */ |
---|
482 | F_XKEY, /* M-O *//* extended key esc PWP Mar 88 */ |
---|
483 | F_UP_SEARCH_HIST, /* M-P */ |
---|
484 | F_UNASSIGNED, /* M-Q */ |
---|
485 | F_TOGGLE_HIST, /* M-R */ |
---|
486 | F_CORRECT, /* M-S */ |
---|
487 | F_UNASSIGNED, /* M-T */ |
---|
488 | F_CASEUPPER, /* M-U */ |
---|
489 | F_UNASSIGNED, /* M-V */ |
---|
490 | F_COPYREGION, /* M-W */ |
---|
491 | F_UNASSIGNED, /* M-X */ |
---|
492 | F_UNASSIGNED, /* M-Y */ |
---|
493 | F_UNASSIGNED, /* M-Z */ |
---|
494 | F_XKEY, /* M-[ *//* extended key esc -mf Oct 87 */ |
---|
495 | F_UNASSIGNED, /* M-\ */ |
---|
496 | F_UNASSIGNED, /* M-] */ |
---|
497 | F_UNASSIGNED, /* M-^ */ |
---|
498 | F_LAST_ITEM, /* M-_ */ |
---|
499 | F_UNASSIGNED, /* M-` */ |
---|
500 | F_UNASSIGNED, /* M-a */ |
---|
501 | F_WORDBACK, /* M-b */ |
---|
502 | F_CASECAPITAL, /* M-c */ |
---|
503 | F_DELWORDNEXT, /* M-d */ |
---|
504 | F_UNASSIGNED, /* M-e */ |
---|
505 | F_WORDFWD, /* M-f */ |
---|
506 | F_UNASSIGNED, /* M-g */ |
---|
507 | F_HELPME, /* M-h */ |
---|
508 | F_UNASSIGNED, /* M-i */ |
---|
509 | F_UNASSIGNED, /* M-j */ |
---|
510 | F_UNASSIGNED, /* M-k */ |
---|
511 | F_CASELOWER, /* M-l */ |
---|
512 | F_UNASSIGNED, /* M-m */ |
---|
513 | F_DOWN_SEARCH_HIST, /* M-n */ |
---|
514 | F_UNASSIGNED, /* M-o */ |
---|
515 | F_UP_SEARCH_HIST, /* M-p */ |
---|
516 | F_UNASSIGNED, /* M-q */ |
---|
517 | F_TOGGLE_HIST, /* M-r */ |
---|
518 | F_CORRECT, /* M-s */ |
---|
519 | F_UNASSIGNED, /* M-t */ |
---|
520 | F_CASEUPPER, /* M-u */ |
---|
521 | F_UNASSIGNED, /* M-v */ |
---|
522 | F_COPYREGION, /* M-w */ |
---|
523 | F_UNASSIGNED, /* M-x */ |
---|
524 | F_UNASSIGNED, /* M-y */ |
---|
525 | F_UNASSIGNED, /* M-z */ |
---|
526 | F_UNASSIGNED, /* M-{ */ |
---|
527 | F_UNASSIGNED, /* M-| */ |
---|
528 | F_UNASSIGNED, /* M-} */ |
---|
529 | F_UNASSIGNED, /* M-~ */ |
---|
530 | F_DELWORDPREV /* M-^? */ |
---|
531 | }; |
---|
532 | |
---|
533 | /* |
---|
534 | * keymap table for vi. Each index into above tbl; should be |
---|
535 | * 256 entries long. Vi mode uses a sticky-extend to do command mode: |
---|
536 | * insert mode characters are in the normal keymap, and command mode |
---|
537 | * in the extended keymap. |
---|
538 | */ |
---|
539 | static KEYCMD CcViMap[] = { |
---|
540 | #ifdef KSHVI |
---|
541 | F_UNASSIGNED, /* ^@ */ |
---|
542 | F_INSERT, /* ^A */ |
---|
543 | F_INSERT, /* ^B */ |
---|
544 | F_INSERT, /* ^C */ |
---|
545 | F_INSERT, /* ^D */ |
---|
546 | F_INSERT, /* ^E */ |
---|
547 | F_INSERT, /* ^F */ |
---|
548 | F_INSERT, /* ^G */ |
---|
549 | V_DELPREV, /* ^H */ /* BackSpace key */ |
---|
550 | F_COMPLETE, /* ^I */ /* Tab Key */ |
---|
551 | F_NEWLINE, /* ^J */ |
---|
552 | F_INSERT, /* ^K */ |
---|
553 | F_INSERT, /* ^L */ |
---|
554 | F_NEWLINE, /* ^M */ |
---|
555 | F_INSERT, /* ^N */ |
---|
556 | F_INSERT, /* ^O */ |
---|
557 | F_INSERT, /* ^P */ |
---|
558 | F_TTY_STARTO, /* ^Q */ |
---|
559 | F_INSERT, /* ^R */ |
---|
560 | F_INSERT, /* ^S */ |
---|
561 | F_INSERT, /* ^T */ |
---|
562 | F_INSERT, /* ^U */ |
---|
563 | F_QUOTE, /* ^V */ |
---|
564 | F_DELWORDPREV, /* ^W */ /* Only until start edit pos */ |
---|
565 | F_INSERT, /* ^X */ |
---|
566 | F_INSERT, /* ^Y */ |
---|
567 | F_INSERT, /* ^Z */ |
---|
568 | V_CMD_MODE, /* ^[ */ /* [ Esc ] key */ |
---|
569 | F_TTY_QUIT, /* ^\ */ |
---|
570 | F_INSERT, /* ^] */ |
---|
571 | F_INSERT, /* ^^ */ |
---|
572 | F_INSERT, /* ^_ */ |
---|
573 | #else /* !KSHVI */ |
---|
574 | F_UNASSIGNED, /* ^@ */ /* NOTE: These mapping do NOT */ |
---|
575 | F_TOBEG, /* ^A */ /* Correspond well to the KSH */ |
---|
576 | F_CHARBACK, /* ^B */ /* VI editting assignments */ |
---|
577 | F_TTY_INT, /* ^C */ /* On the other hand they are */ |
---|
578 | F_LIST_EOF, /* ^D */ /* convenient any many people */ |
---|
579 | F_TOEND, /* ^E */ /* have gotten used to them */ |
---|
580 | F_CHARFWD, /* ^F */ |
---|
581 | F_LIST_GLOB, /* ^G */ |
---|
582 | F_DELPREV, /* ^H */ /* BackSpace key */ |
---|
583 | F_COMPLETE, /* ^I */ /* Tab Key */ |
---|
584 | F_NEWLINE, /* ^J */ |
---|
585 | F_KILLEND, /* ^K */ |
---|
586 | F_CLEARDISP, /* ^L */ |
---|
587 | F_NEWLINE, /* ^M */ |
---|
588 | F_DOWN_HIST, /* ^N */ |
---|
589 | F_TTY_FLUSHO, /* ^O */ |
---|
590 | F_UP_HIST, /* ^P */ |
---|
591 | F_TTY_STARTO, /* ^Q */ |
---|
592 | F_REDISP, /* ^R */ |
---|
593 | F_TTY_STOPO, /* ^S */ |
---|
594 | F_CHARSWITCH, /* ^T */ |
---|
595 | F_KILLBEG, /* ^U */ |
---|
596 | F_QUOTE, /* ^V */ |
---|
597 | F_DELWORDPREV, /* ^W */ |
---|
598 | F_EXPAND, /* ^X */ |
---|
599 | F_TTY_DSUSP, /* ^Y */ |
---|
600 | F_TTY_TSUSP, /* ^Z */ |
---|
601 | V_CMD_MODE, /* ^[ */ |
---|
602 | F_TTY_QUIT, /* ^\ */ |
---|
603 | F_UNASSIGNED, /* ^] */ |
---|
604 | F_UNASSIGNED, /* ^^ */ |
---|
605 | F_UNASSIGNED, /* ^_ */ |
---|
606 | #endif /* KSHVI */ |
---|
607 | F_INSERT, /* SPACE */ |
---|
608 | F_INSERT, /* ! */ |
---|
609 | F_INSERT, /* " */ |
---|
610 | F_INSERT, /* # */ |
---|
611 | F_INSERT, /* $ */ |
---|
612 | F_INSERT, /* % */ |
---|
613 | F_INSERT, /* & */ |
---|
614 | F_INSERT, /* ' */ |
---|
615 | F_INSERT, /* ( */ |
---|
616 | F_INSERT, /* ) */ |
---|
617 | F_INSERT, /* * */ |
---|
618 | F_INSERT, /* + */ |
---|
619 | F_INSERT, /* , */ |
---|
620 | F_INSERT, /* - */ |
---|
621 | F_INSERT, /* . */ |
---|
622 | F_INSERT, /* / */ |
---|
623 | F_INSERT, /* 0 */ |
---|
624 | F_INSERT, /* 1 */ |
---|
625 | F_INSERT, /* 2 */ |
---|
626 | F_INSERT, /* 3 */ |
---|
627 | F_INSERT, /* 4 */ |
---|
628 | F_INSERT, /* 5 */ |
---|
629 | F_INSERT, /* 6 */ |
---|
630 | F_INSERT, /* 7 */ |
---|
631 | F_INSERT, /* 8 */ |
---|
632 | F_INSERT, /* 9 */ |
---|
633 | F_INSERT, /* : */ |
---|
634 | F_INSERT, /* ; */ |
---|
635 | F_INSERT, /* < */ |
---|
636 | F_INSERT, /* = */ |
---|
637 | F_INSERT, /* > */ |
---|
638 | F_INSERT, /* ? */ |
---|
639 | F_INSERT, /* @ */ |
---|
640 | F_INSERT, /* A */ |
---|
641 | F_INSERT, /* B */ |
---|
642 | F_INSERT, /* C */ |
---|
643 | F_INSERT, /* D */ |
---|
644 | F_INSERT, /* E */ |
---|
645 | F_INSERT, /* F */ |
---|
646 | F_INSERT, /* G */ |
---|
647 | F_INSERT, /* H */ |
---|
648 | F_INSERT, /* I */ |
---|
649 | F_INSERT, /* J */ |
---|
650 | F_INSERT, /* K */ |
---|
651 | F_INSERT, /* L */ |
---|
652 | F_INSERT, /* M */ |
---|
653 | F_INSERT, /* N */ |
---|
654 | F_INSERT, /* O */ |
---|
655 | F_INSERT, /* P */ |
---|
656 | F_INSERT, /* Q */ |
---|
657 | F_INSERT, /* R */ |
---|
658 | F_INSERT, /* S */ |
---|
659 | F_INSERT, /* T */ |
---|
660 | F_INSERT, /* U */ |
---|
661 | F_INSERT, /* V */ |
---|
662 | F_INSERT, /* W */ |
---|
663 | F_INSERT, /* X */ |
---|
664 | F_INSERT, /* Y */ |
---|
665 | F_INSERT, /* Z */ |
---|
666 | F_INSERT, /* [ */ |
---|
667 | F_INSERT, /* \ */ |
---|
668 | F_INSERT, /* ] */ |
---|
669 | F_INSERT, /* ^ */ |
---|
670 | F_INSERT, /* _ */ |
---|
671 | F_INSERT, /* ` */ |
---|
672 | F_INSERT, /* a */ |
---|
673 | F_INSERT, /* b */ |
---|
674 | F_INSERT, /* c */ |
---|
675 | F_INSERT, /* d */ |
---|
676 | F_INSERT, /* e */ |
---|
677 | F_INSERT, /* f */ |
---|
678 | F_INSERT, /* g */ |
---|
679 | F_INSERT, /* h */ |
---|
680 | F_INSERT, /* i */ |
---|
681 | F_INSERT, /* j */ |
---|
682 | F_INSERT, /* k */ |
---|
683 | F_INSERT, /* l */ |
---|
684 | F_INSERT, /* m */ |
---|
685 | F_INSERT, /* n */ |
---|
686 | F_INSERT, /* o */ |
---|
687 | F_INSERT, /* p */ |
---|
688 | F_INSERT, /* q */ |
---|
689 | F_INSERT, /* r */ |
---|
690 | F_INSERT, /* s */ |
---|
691 | F_INSERT, /* t */ |
---|
692 | F_INSERT, /* u */ |
---|
693 | F_INSERT, /* v */ |
---|
694 | F_INSERT, /* w */ |
---|
695 | F_INSERT, /* x */ |
---|
696 | F_INSERT, /* y */ |
---|
697 | F_INSERT, /* z */ |
---|
698 | F_INSERT, /* { */ |
---|
699 | F_INSERT, /* | */ |
---|
700 | F_INSERT, /* } */ |
---|
701 | F_INSERT, /* ~ */ |
---|
702 | F_DELPREV, /* ^? */ |
---|
703 | F_UNASSIGNED, /* M-^@ */ |
---|
704 | F_UNASSIGNED, /* M-^A */ |
---|
705 | F_UNASSIGNED, /* M-^B */ |
---|
706 | F_UNASSIGNED, /* M-^C */ |
---|
707 | F_UNASSIGNED, /* M-^D */ |
---|
708 | F_UNASSIGNED, /* M-^E */ |
---|
709 | F_UNASSIGNED, /* M-^F */ |
---|
710 | F_UNASSIGNED, /* M-^G */ |
---|
711 | F_UNASSIGNED, /* M-^H */ |
---|
712 | F_UNASSIGNED, /* M-^I */ |
---|
713 | F_UNASSIGNED, /* M-^J */ |
---|
714 | F_UNASSIGNED, /* M-^K */ |
---|
715 | F_UNASSIGNED, /* M-^L */ |
---|
716 | F_UNASSIGNED, /* M-^M */ |
---|
717 | F_UNASSIGNED, /* M-^N */ |
---|
718 | F_UNASSIGNED, /* M-^O */ |
---|
719 | F_UNASSIGNED, /* M-^P */ |
---|
720 | F_UNASSIGNED, /* M-^Q */ |
---|
721 | F_UNASSIGNED, /* M-^R */ |
---|
722 | F_UNASSIGNED, /* M-^S */ |
---|
723 | F_UNASSIGNED, /* M-^T */ |
---|
724 | F_UNASSIGNED, /* M-^U */ |
---|
725 | F_UNASSIGNED, /* M-^V */ |
---|
726 | F_UNASSIGNED, /* M-^W */ |
---|
727 | F_UNASSIGNED, /* M-^X */ |
---|
728 | F_UNASSIGNED, /* M-^Y */ |
---|
729 | F_UNASSIGNED, /* M-^Z */ |
---|
730 | F_UNASSIGNED, /* M-^[ */ |
---|
731 | F_UNASSIGNED, /* M-^\ */ |
---|
732 | F_UNASSIGNED, /* M-^] */ |
---|
733 | F_UNASSIGNED, /* M-^^ */ |
---|
734 | F_UNASSIGNED, /* M-^_ */ |
---|
735 | F_UNASSIGNED, /* M-SPACE */ |
---|
736 | F_UNASSIGNED, /* M-! */ |
---|
737 | F_UNASSIGNED, /* M-" */ |
---|
738 | F_UNASSIGNED, /* M-# */ |
---|
739 | F_UNASSIGNED, /* M-$ */ |
---|
740 | F_UNASSIGNED, /* M-% */ |
---|
741 | F_UNASSIGNED, /* M-& */ |
---|
742 | F_UNASSIGNED, /* M-' */ |
---|
743 | F_UNASSIGNED, /* M-( */ |
---|
744 | F_UNASSIGNED, /* M-) */ |
---|
745 | F_UNASSIGNED, /* M-* */ |
---|
746 | F_UNASSIGNED, /* M-+ */ |
---|
747 | F_UNASSIGNED, /* M-, */ |
---|
748 | F_UNASSIGNED, /* M-- */ |
---|
749 | F_UNASSIGNED, /* M-. */ |
---|
750 | F_UNASSIGNED, /* M-/ */ |
---|
751 | F_UNASSIGNED, /* M-0 */ |
---|
752 | F_UNASSIGNED, /* M-1 */ |
---|
753 | F_UNASSIGNED, /* M-2 */ |
---|
754 | F_UNASSIGNED, /* M-3 */ |
---|
755 | F_UNASSIGNED, /* M-4 */ |
---|
756 | F_UNASSIGNED, /* M-5 */ |
---|
757 | F_UNASSIGNED, /* M-6 */ |
---|
758 | F_UNASSIGNED, /* M-7 */ |
---|
759 | F_UNASSIGNED, /* M-8 */ |
---|
760 | F_UNASSIGNED, /* M-9 */ |
---|
761 | F_UNASSIGNED, /* M-: */ |
---|
762 | F_UNASSIGNED, /* M-; */ |
---|
763 | F_UNASSIGNED, /* M-< */ |
---|
764 | F_UNASSIGNED, /* M-= */ |
---|
765 | F_UNASSIGNED, /* M-> */ |
---|
766 | F_UNASSIGNED, /* M-? */ |
---|
767 | F_UNASSIGNED, /* M-@ */ |
---|
768 | F_UNASSIGNED, /* M-A */ |
---|
769 | F_UNASSIGNED, /* M-B */ |
---|
770 | F_UNASSIGNED, /* M-C */ |
---|
771 | F_UNASSIGNED, /* M-D */ |
---|
772 | F_UNASSIGNED, /* M-E */ |
---|
773 | F_UNASSIGNED, /* M-F */ |
---|
774 | F_UNASSIGNED, /* M-G */ |
---|
775 | F_UNASSIGNED, /* M-H */ |
---|
776 | F_UNASSIGNED, /* M-I */ |
---|
777 | F_UNASSIGNED, /* M-J */ |
---|
778 | F_UNASSIGNED, /* M-K */ |
---|
779 | F_UNASSIGNED, /* M-L */ |
---|
780 | F_UNASSIGNED, /* M-M */ |
---|
781 | F_UNASSIGNED, /* M-N */ |
---|
782 | F_UNASSIGNED, /* M-O */ |
---|
783 | F_UNASSIGNED, /* M-P */ |
---|
784 | F_UNASSIGNED, /* M-Q */ |
---|
785 | F_UNASSIGNED, /* M-R */ |
---|
786 | F_UNASSIGNED, /* M-S */ |
---|
787 | F_UNASSIGNED, /* M-T */ |
---|
788 | F_UNASSIGNED, /* M-U */ |
---|
789 | F_UNASSIGNED, /* M-V */ |
---|
790 | F_UNASSIGNED, /* M-W */ |
---|
791 | F_UNASSIGNED, /* M-X */ |
---|
792 | F_UNASSIGNED, /* M-Y */ |
---|
793 | F_UNASSIGNED, /* M-Z */ |
---|
794 | F_UNASSIGNED, /* M-[ */ |
---|
795 | F_UNASSIGNED, /* M-\ */ |
---|
796 | F_UNASSIGNED, /* M-] */ |
---|
797 | F_UNASSIGNED, /* M-^ */ |
---|
798 | F_UNASSIGNED, /* M-_ */ |
---|
799 | F_UNASSIGNED, /* M-` */ |
---|
800 | F_UNASSIGNED, /* M-a */ |
---|
801 | F_UNASSIGNED, /* M-b */ |
---|
802 | F_UNASSIGNED, /* M-c */ |
---|
803 | F_UNASSIGNED, /* M-d */ |
---|
804 | F_UNASSIGNED, /* M-e */ |
---|
805 | F_UNASSIGNED, /* M-f */ |
---|
806 | F_UNASSIGNED, /* M-g */ |
---|
807 | F_UNASSIGNED, /* M-h */ |
---|
808 | F_UNASSIGNED, /* M-i */ |
---|
809 | F_UNASSIGNED, /* M-j */ |
---|
810 | F_UNASSIGNED, /* M-k */ |
---|
811 | F_UNASSIGNED, /* M-l */ |
---|
812 | F_UNASSIGNED, /* M-m */ |
---|
813 | F_UNASSIGNED, /* M-n */ |
---|
814 | F_UNASSIGNED, /* M-o */ |
---|
815 | F_UNASSIGNED, /* M-p */ |
---|
816 | F_UNASSIGNED, /* M-q */ |
---|
817 | F_UNASSIGNED, /* M-r */ |
---|
818 | F_UNASSIGNED, /* M-s */ |
---|
819 | F_UNASSIGNED, /* M-t */ |
---|
820 | F_UNASSIGNED, /* M-u */ |
---|
821 | F_UNASSIGNED, /* M-v */ |
---|
822 | F_UNASSIGNED, /* M-w */ |
---|
823 | F_UNASSIGNED, /* M-x */ |
---|
824 | F_UNASSIGNED, /* M-y */ |
---|
825 | F_UNASSIGNED, /* M-z */ |
---|
826 | F_UNASSIGNED, /* M-{ */ |
---|
827 | F_UNASSIGNED, /* M-| */ |
---|
828 | F_UNASSIGNED, /* M-} */ |
---|
829 | F_UNASSIGNED, /* M-~ */ |
---|
830 | F_UNASSIGNED /* M-^? */ |
---|
831 | }; |
---|
832 | |
---|
833 | KEYCMD CcViCmdMap[] = { |
---|
834 | F_UNASSIGNED, /* ^@ */ |
---|
835 | F_TOBEG, /* ^A */ |
---|
836 | F_UNASSIGNED, /* ^B */ |
---|
837 | F_TTY_INT, /* ^C */ |
---|
838 | F_LIST_CHOICES, /* ^D */ |
---|
839 | F_TOEND, /* ^E */ |
---|
840 | F_UNASSIGNED, /* ^F */ |
---|
841 | F_LIST_GLOB, /* ^G */ |
---|
842 | F_CHARBACK, /* ^H */ |
---|
843 | V_CM_COMPLETE, /* ^I */ |
---|
844 | F_NEWLINE, /* ^J */ |
---|
845 | F_KILLEND, /* ^K */ |
---|
846 | F_CLEARDISP, /* ^L */ |
---|
847 | F_NEWLINE, /* ^M */ |
---|
848 | F_DOWN_HIST, /* ^N */ |
---|
849 | F_TTY_FLUSHO, /* ^O */ |
---|
850 | F_UP_HIST, /* ^P */ |
---|
851 | F_TTY_STARTO, /* ^Q */ |
---|
852 | F_REDISP, /* ^R */ |
---|
853 | F_TTY_STOPO, /* ^S */ |
---|
854 | F_UNASSIGNED, /* ^T */ |
---|
855 | F_KILLBEG, /* ^U */ |
---|
856 | F_UNASSIGNED, /* ^V */ |
---|
857 | F_DELWORDPREV, /* ^W */ |
---|
858 | F_EXPAND, /* ^X */ |
---|
859 | F_UNASSIGNED, /* ^Y */ |
---|
860 | F_UNASSIGNED, /* ^Z */ |
---|
861 | F_METANEXT, /* ^[ */ |
---|
862 | F_TTY_QUIT, /* ^\ */ |
---|
863 | F_UNASSIGNED, /* ^] */ |
---|
864 | F_UNASSIGNED, /* ^^ */ |
---|
865 | F_UNASSIGNED, /* ^_ */ |
---|
866 | F_CHARFWD, /* SPACE */ |
---|
867 | F_EXPAND_HISTORY, /* ! */ |
---|
868 | F_UNASSIGNED, /* " */ |
---|
869 | F_UNASSIGNED, /* # */ |
---|
870 | F_TOEND, /* $ */ |
---|
871 | F_UNASSIGNED, /* % */ |
---|
872 | F_UNASSIGNED, /* & */ |
---|
873 | F_UNASSIGNED, /* ' */ |
---|
874 | F_UNASSIGNED, /* ( */ |
---|
875 | F_UNASSIGNED, /* ) */ |
---|
876 | F_EXPAND_GLOB, /* * */ |
---|
877 | F_DOWN_HIST, /* + */ |
---|
878 | V_RCHAR_BACK, /* , */ |
---|
879 | F_UP_HIST, /* - */ |
---|
880 | F_UNASSIGNED, /* . */ |
---|
881 | V_DSH_META, /* / */ |
---|
882 | V_ZERO, /* 0 */ |
---|
883 | F_ARGDIGIT, /* 1 */ |
---|
884 | F_ARGDIGIT, /* 2 */ |
---|
885 | F_ARGDIGIT, /* 3 */ |
---|
886 | F_ARGDIGIT, /* 4 */ |
---|
887 | F_ARGDIGIT, /* 5 */ |
---|
888 | F_ARGDIGIT, /* 6 */ |
---|
889 | F_ARGDIGIT, /* 7 */ |
---|
890 | F_ARGDIGIT, /* 8 */ |
---|
891 | F_ARGDIGIT, /* 9 */ |
---|
892 | F_UNASSIGNED, /* : */ |
---|
893 | V_RCHAR_FWD, /* ; */ |
---|
894 | F_UNASSIGNED, /* < */ |
---|
895 | F_UNASSIGNED, /* = */ |
---|
896 | F_UNASSIGNED, /* > */ |
---|
897 | V_USH_META, /* ? */ |
---|
898 | F_UNASSIGNED, /* @ */ |
---|
899 | V_ADDEND, /* A */ |
---|
900 | V_WORDBACK, /* B */ |
---|
901 | V_CHGTOEND, /* C */ |
---|
902 | F_KILLEND, /* D */ |
---|
903 | V_ENDWORD, /* E */ |
---|
904 | V_CHAR_BACK, /* F */ |
---|
905 | F_UNASSIGNED, /* G */ |
---|
906 | F_UNASSIGNED, /* H */ |
---|
907 | V_INSBEG, /* I */ |
---|
908 | F_DOWN_SEARCH_HIST, /* J */ |
---|
909 | F_UP_SEARCH_HIST, /* K */ |
---|
910 | F_UNASSIGNED, /* L */ |
---|
911 | F_UNASSIGNED, /* M */ |
---|
912 | V_RSRCH_BACK, /* N */ |
---|
913 | F_XKEY, /* O */ |
---|
914 | F_UNASSIGNED, /* P */ |
---|
915 | F_UNASSIGNED, /* Q */ |
---|
916 | V_REPLMODE, /* R */ |
---|
917 | V_SUBSTLINE, /* S */ |
---|
918 | V_CHARTO_BACK, /* T */ |
---|
919 | F_UNASSIGNED, /* U */ |
---|
920 | F_EXPAND_VARS, /* V */ |
---|
921 | V_WORDFWD, /* W */ |
---|
922 | F_DELPREV, /* X */ |
---|
923 | F_UNASSIGNED, /* Y */ |
---|
924 | F_UNASSIGNED, /* Z */ |
---|
925 | F_XKEY, /* [ */ |
---|
926 | F_UNASSIGNED, /* \ */ |
---|
927 | F_UNASSIGNED, /* ] */ |
---|
928 | F_TOBEG, /* ^ */ |
---|
929 | F_UNASSIGNED, /* _ */ |
---|
930 | F_UNASSIGNED, /* ` */ |
---|
931 | V_ADD, /* a */ |
---|
932 | F_WORDBACK, /* b */ |
---|
933 | V_CHGMETA, /* c */ |
---|
934 | V_DELMETA, /* d */ |
---|
935 | V_EWORD, /* e */ |
---|
936 | V_CHAR_FWD, /* f */ |
---|
937 | F_UNASSIGNED, /* g */ |
---|
938 | F_CHARBACK, /* h */ |
---|
939 | V_INSERT, /* i */ |
---|
940 | F_DOWN_HIST, /* j */ |
---|
941 | F_UP_HIST, /* k */ |
---|
942 | F_CHARFWD, /* l */ |
---|
943 | F_UNASSIGNED, /* m */ |
---|
944 | V_RSRCH_FWD, /* n */ |
---|
945 | F_UNASSIGNED, /* o */ |
---|
946 | F_UNASSIGNED, /* p */ |
---|
947 | F_UNASSIGNED, /* q */ |
---|
948 | V_REPLONE, /* r */ |
---|
949 | V_SUBSTCHAR, /* s */ |
---|
950 | V_CHARTO_FWD, /* t */ |
---|
951 | V_UNDO, /* u */ |
---|
952 | F_EXPAND_VARS, /* v */ |
---|
953 | V_WORDBEGNEXT, /* w */ |
---|
954 | F_DELNEXT, /* x */ |
---|
955 | F_UNASSIGNED, /* y */ |
---|
956 | F_UNASSIGNED, /* z */ |
---|
957 | F_UNASSIGNED, /* { */ |
---|
958 | F_UNASSIGNED, /* | */ |
---|
959 | F_UNASSIGNED, /* } */ |
---|
960 | V_CHGCASE, /* ~ */ |
---|
961 | F_DELPREV, /* ^? */ |
---|
962 | F_UNASSIGNED, /* M-^@ */ |
---|
963 | F_UNASSIGNED, /* M-^A */ |
---|
964 | F_UNASSIGNED, /* M-^B */ |
---|
965 | F_UNASSIGNED, /* M-^C */ |
---|
966 | F_UNASSIGNED, /* M-^D */ |
---|
967 | F_UNASSIGNED, /* M-^E */ |
---|
968 | F_UNASSIGNED, /* M-^F */ |
---|
969 | F_UNASSIGNED, /* M-^G */ |
---|
970 | F_UNASSIGNED, /* M-^H */ |
---|
971 | F_UNASSIGNED, /* M-^I */ |
---|
972 | F_UNASSIGNED, /* M-^J */ |
---|
973 | F_UNASSIGNED, /* M-^K */ |
---|
974 | F_UNASSIGNED, /* M-^L */ |
---|
975 | F_UNASSIGNED, /* M-^M */ |
---|
976 | F_UNASSIGNED, /* M-^N */ |
---|
977 | F_UNASSIGNED, /* M-^O */ |
---|
978 | F_UNASSIGNED, /* M-^P */ |
---|
979 | F_UNASSIGNED, /* M-^Q */ |
---|
980 | F_UNASSIGNED, /* M-^R */ |
---|
981 | F_UNASSIGNED, /* M-^S */ |
---|
982 | F_UNASSIGNED, /* M-^T */ |
---|
983 | F_UNASSIGNED, /* M-^U */ |
---|
984 | F_UNASSIGNED, /* M-^V */ |
---|
985 | F_UNASSIGNED, /* M-^W */ |
---|
986 | F_UNASSIGNED, /* M-^X */ |
---|
987 | F_UNASSIGNED, /* M-^Y */ |
---|
988 | F_UNASSIGNED, /* M-^Z */ |
---|
989 | F_UNASSIGNED, /* M-^[ */ |
---|
990 | F_UNASSIGNED, /* M-^\ */ |
---|
991 | F_UNASSIGNED, /* M-^] */ |
---|
992 | F_UNASSIGNED, /* M-^^ */ |
---|
993 | F_UNASSIGNED, /* M-^_ */ |
---|
994 | F_UNASSIGNED, /* M-SPACE */ |
---|
995 | F_UNASSIGNED, /* M-! */ |
---|
996 | F_UNASSIGNED, /* M-" */ |
---|
997 | F_UNASSIGNED, /* M-# */ |
---|
998 | F_UNASSIGNED, /* M-$ */ |
---|
999 | F_UNASSIGNED, /* M-% */ |
---|
1000 | F_UNASSIGNED, /* M-& */ |
---|
1001 | F_UNASSIGNED, /* M-' */ |
---|
1002 | F_UNASSIGNED, /* M-( */ |
---|
1003 | F_UNASSIGNED, /* M-) */ |
---|
1004 | F_UNASSIGNED, /* M-* */ |
---|
1005 | F_UNASSIGNED, /* M-+ */ |
---|
1006 | F_UNASSIGNED, /* M-, */ |
---|
1007 | F_UNASSIGNED, /* M-- */ |
---|
1008 | F_UNASSIGNED, /* M-. */ |
---|
1009 | F_UNASSIGNED, /* M-/ */ |
---|
1010 | F_UNASSIGNED, /* M-0 */ |
---|
1011 | F_UNASSIGNED, /* M-1 */ |
---|
1012 | F_UNASSIGNED, /* M-2 */ |
---|
1013 | F_UNASSIGNED, /* M-3 */ |
---|
1014 | F_UNASSIGNED, /* M-4 */ |
---|
1015 | F_UNASSIGNED, /* M-5 */ |
---|
1016 | F_UNASSIGNED, /* M-6 */ |
---|
1017 | F_UNASSIGNED, /* M-7 */ |
---|
1018 | F_UNASSIGNED, /* M-8 */ |
---|
1019 | F_UNASSIGNED, /* M-9 */ |
---|
1020 | F_UNASSIGNED, /* M-: */ |
---|
1021 | F_UNASSIGNED, /* M-; */ |
---|
1022 | F_UNASSIGNED, /* M-< */ |
---|
1023 | F_UNASSIGNED, /* M-= */ |
---|
1024 | F_UNASSIGNED, /* M-> */ |
---|
1025 | F_HELPME, /* M-? */ |
---|
1026 | F_UNASSIGNED, /* M-@ */ |
---|
1027 | F_UNASSIGNED, /* M-A */ |
---|
1028 | F_UNASSIGNED, /* M-B */ |
---|
1029 | F_UNASSIGNED, /* M-C */ |
---|
1030 | F_UNASSIGNED, /* M-D */ |
---|
1031 | F_UNASSIGNED, /* M-E */ |
---|
1032 | F_UNASSIGNED, /* M-F */ |
---|
1033 | F_UNASSIGNED, /* M-G */ |
---|
1034 | F_UNASSIGNED, /* M-H */ |
---|
1035 | F_UNASSIGNED, /* M-I */ |
---|
1036 | F_UNASSIGNED, /* M-J */ |
---|
1037 | F_UNASSIGNED, /* M-K */ |
---|
1038 | F_UNASSIGNED, /* M-L */ |
---|
1039 | F_UNASSIGNED, /* M-M */ |
---|
1040 | F_UNASSIGNED, /* M-N */ |
---|
1041 | F_XKEY, /* M-O *//* extended key esc PWP Mar 88 */ |
---|
1042 | F_UNASSIGNED, /* M-P */ |
---|
1043 | F_UNASSIGNED, /* M-Q */ |
---|
1044 | F_UNASSIGNED, /* M-R */ |
---|
1045 | F_UNASSIGNED, /* M-S */ |
---|
1046 | F_UNASSIGNED, /* M-T */ |
---|
1047 | F_UNASSIGNED, /* M-U */ |
---|
1048 | F_UNASSIGNED, /* M-V */ |
---|
1049 | F_UNASSIGNED, /* M-W */ |
---|
1050 | F_UNASSIGNED, /* M-X */ |
---|
1051 | F_UNASSIGNED, /* M-Y */ |
---|
1052 | F_UNASSIGNED, /* M-Z */ |
---|
1053 | F_XKEY, /* M-[ *//* extended key esc -mf Oct 87 */ |
---|
1054 | F_UNASSIGNED, /* M-\ */ |
---|
1055 | F_UNASSIGNED, /* M-] */ |
---|
1056 | F_UNASSIGNED, /* M-^ */ |
---|
1057 | F_UNASSIGNED, /* M-_ */ |
---|
1058 | F_UNASSIGNED, /* M-` */ |
---|
1059 | F_UNASSIGNED, /* M-a */ |
---|
1060 | F_UNASSIGNED, /* M-b */ |
---|
1061 | F_UNASSIGNED, /* M-c */ |
---|
1062 | F_UNASSIGNED, /* M-d */ |
---|
1063 | F_UNASSIGNED, /* M-e */ |
---|
1064 | F_UNASSIGNED, /* M-f */ |
---|
1065 | F_UNASSIGNED, /* M-g */ |
---|
1066 | F_UNASSIGNED, /* M-h */ |
---|
1067 | F_UNASSIGNED, /* M-i */ |
---|
1068 | F_UNASSIGNED, /* M-j */ |
---|
1069 | F_UNASSIGNED, /* M-k */ |
---|
1070 | F_UNASSIGNED, /* M-l */ |
---|
1071 | F_UNASSIGNED, /* M-m */ |
---|
1072 | F_UNASSIGNED, /* M-n */ |
---|
1073 | F_UNASSIGNED, /* M-o */ |
---|
1074 | F_UNASSIGNED, /* M-p */ |
---|
1075 | F_UNASSIGNED, /* M-q */ |
---|
1076 | F_UNASSIGNED, /* M-r */ |
---|
1077 | F_UNASSIGNED, /* M-s */ |
---|
1078 | F_UNASSIGNED, /* M-t */ |
---|
1079 | F_UNASSIGNED, /* M-u */ |
---|
1080 | F_UNASSIGNED, /* M-v */ |
---|
1081 | F_UNASSIGNED, /* M-w */ |
---|
1082 | F_UNASSIGNED, /* M-x */ |
---|
1083 | F_UNASSIGNED, /* M-y */ |
---|
1084 | F_UNASSIGNED, /* M-z */ |
---|
1085 | F_UNASSIGNED, /* M-{ */ |
---|
1086 | F_UNASSIGNED, /* M-| */ |
---|
1087 | F_UNASSIGNED, /* M-} */ |
---|
1088 | F_UNASSIGNED, /* M-~ */ |
---|
1089 | F_UNASSIGNED /* M-^? */ |
---|
1090 | }; |
---|
1091 | |
---|
1092 | |
---|
1093 | struct KeyFuncs FuncNames[] = { |
---|
1094 | "backward-char", F_CHARBACK, |
---|
1095 | "Move back a character", |
---|
1096 | "backward-delete-char", F_DELPREV, |
---|
1097 | "Delete the character behind cursor", |
---|
1098 | "backward-delete-word", F_DELWORDPREV, |
---|
1099 | "Cut from beginning of current word to cursor - saved in cut buffer", |
---|
1100 | "backward-kill-line", F_KILLBEG, |
---|
1101 | "Cut from beginning of line to cursor - save in cut buffer", |
---|
1102 | "backward-word", F_WORDBACK, |
---|
1103 | "Move to beginning of current word", |
---|
1104 | "beginning-of-line", F_TOBEG, |
---|
1105 | "Move to beginning of line", |
---|
1106 | "capitalize-word", F_CASECAPITAL, |
---|
1107 | "Capitalize the characters from cursor to end of current word", |
---|
1108 | "change-case", V_CHGCASE, |
---|
1109 | "Vi change case of character under cursor and advance one character", |
---|
1110 | "change-till-end-of-line", V_CHGTOEND, /* backwards compat. */ |
---|
1111 | "Vi change to end of line", |
---|
1112 | "clear-screen", F_CLEARDISP, |
---|
1113 | "Clear screen leaving current line on top", |
---|
1114 | "complete-word", F_COMPLETE, |
---|
1115 | "Complete current word", |
---|
1116 | "complete-word-raw", F_COMPLETE_ALL, |
---|
1117 | "Complete current word ignoring programmable completions", |
---|
1118 | "copy-prev-word", F_COPYPREV, |
---|
1119 | "Copy current word to cursor", |
---|
1120 | "copy-region-as-kill", F_COPYREGION, |
---|
1121 | "Copy area between mark and cursor to cut buffer", |
---|
1122 | "delete-char", F_DELNEXT, |
---|
1123 | "Delete character under cursor", |
---|
1124 | "delete-char-or-eof", F_DELNEXT_EOF, |
---|
1125 | "Delete character under cursor or end of file if there is no character", |
---|
1126 | "delete-char-or-list", F_LIST_DELNEXT, |
---|
1127 | "Delete character under cursor or list completions if at end of line", |
---|
1128 | "delete-word", F_DELWORDNEXT, |
---|
1129 | "Cut from cursor to end of current word - save in cut buffer", |
---|
1130 | "digit", F_DIGIT, |
---|
1131 | "Adds to argument if started or enters digit", |
---|
1132 | "digit-argument", F_ARGDIGIT, |
---|
1133 | "Digit that starts argument", |
---|
1134 | "down-history", F_DOWN_HIST, |
---|
1135 | "Move to next history line", |
---|
1136 | "downcase-word", F_CASELOWER, |
---|
1137 | "Lowercase the characters from cursor to end of current word", |
---|
1138 | "end-of-file", F_SEND_EOF, |
---|
1139 | "Indicate end of file", |
---|
1140 | "end-of-line", F_TOEND, |
---|
1141 | "Move cursor to end of line", |
---|
1142 | "exchange-point-and-mark", F_EXCHANGE_MARK, |
---|
1143 | "Exchange the cursor and mark", |
---|
1144 | "expand-glob", F_EXPAND_GLOB, |
---|
1145 | "Expand file name wildcards", |
---|
1146 | "expand-history", F_EXPAND_HISTORY, |
---|
1147 | "Expand history escapes", |
---|
1148 | "expand-line", F_EXPAND, |
---|
1149 | "Expand the history escapes in a line", |
---|
1150 | "expand-variables", F_EXPAND_VARS, |
---|
1151 | "Expand variables", |
---|
1152 | "forward-char", F_CHARFWD, |
---|
1153 | "Move forward one character", |
---|
1154 | "forward-word", F_WORDFWD, |
---|
1155 | "Move forward to end of current word", |
---|
1156 | "gosmacs-transpose-chars", F_GCHARSWITCH, |
---|
1157 | "Exchange the two characters before the cursor", |
---|
1158 | "history-search-backward", F_UP_SEARCH_HIST, |
---|
1159 | "Search in history backwards for line beginning as current", |
---|
1160 | "history-search-forward", F_DOWN_SEARCH_HIST, |
---|
1161 | "Search in history forward for line beginning as current", |
---|
1162 | "insert-last-word", F_LAST_ITEM, |
---|
1163 | "Insert last item of previous command", |
---|
1164 | "i-search-fwd", F_INC_FWD, |
---|
1165 | "Incremental search forward", |
---|
1166 | "i-search-back", F_INC_BACK, |
---|
1167 | "Incremental search backwards", |
---|
1168 | "keyboard-quit", F_STARTOVER, |
---|
1169 | "Clear line", |
---|
1170 | "kill-line", F_KILLEND, |
---|
1171 | "Cut to end of line and save in cut buffer", |
---|
1172 | "kill-region", F_KILLREGION, |
---|
1173 | "Cut area between mark and cursor and save in cut buffer", |
---|
1174 | "kill-whole-line", F_KILLALL, |
---|
1175 | "Cut the entire line and save in cut buffer", |
---|
1176 | "list-choices", F_LIST_CHOICES, |
---|
1177 | "List choices for completion", |
---|
1178 | "list-choices-raw", F_LIST_ALL, |
---|
1179 | "List choices for completion overriding programmable completion", |
---|
1180 | "list-glob", F_LIST_GLOB, |
---|
1181 | "List file name wildcard matches", |
---|
1182 | "list-or-eof", F_LIST_EOF, |
---|
1183 | "List choices for completion or indicate end of file if empty line", |
---|
1184 | "load-average", F_LOAD_AVERAGE, |
---|
1185 | "Display load average and current process status", |
---|
1186 | "magic-space", F_MAGIC_SPACE, |
---|
1187 | "Expand history escapes and insert a space", |
---|
1188 | "newline", F_NEWLINE, |
---|
1189 | "Execute command", |
---|
1190 | "normalize-path", F_PATH_NORM, |
---|
1191 | "Expand pathnames, eliminating leading .'s and ..'s", |
---|
1192 | "overwrite-mode", F_INSOVR, |
---|
1193 | "Switch from insert to overwrite mode or vice versa", |
---|
1194 | "prefix-meta", F_METANEXT, |
---|
1195 | "Add 8th bit to next character typed", |
---|
1196 | "quoted-insert", F_QUOTE, |
---|
1197 | "Add the next character typed to the line verbatim", |
---|
1198 | "redisplay", F_REDISP, |
---|
1199 | "Redisplay everything", |
---|
1200 | "run-fg-editor", F_RUN_FG_EDITOR, |
---|
1201 | "Restart stopped editor", |
---|
1202 | "run-help", F_HELPME, |
---|
1203 | "Look for help on current command", |
---|
1204 | "self-insert-command", F_INSERT, |
---|
1205 | "This character is added to the line", |
---|
1206 | "sequence-lead-in", F_XKEY, |
---|
1207 | "This character is the first in a character sequence", |
---|
1208 | "set-mark-command", F_SET_MARK, |
---|
1209 | "Set the mark at cursor", |
---|
1210 | "spell-word", F_CORRECT, |
---|
1211 | "Correct the spelling of current word", |
---|
1212 | "spell-line", F_CORRECT_L, |
---|
1213 | "Correct the spelling of entire line", |
---|
1214 | "stuff-char", F_STUFF_CHAR, |
---|
1215 | "Send character to tty in cooked mode", |
---|
1216 | "toggle-literal-history", F_TOGGLE_HIST, |
---|
1217 | "Toggle between literal and lexical current history line", |
---|
1218 | "transpose-chars", F_CHARSWITCH, |
---|
1219 | "Exchange the character to the left of the cursor with the one under", |
---|
1220 | "transpose-gosling", F_GCHARSWITCH, |
---|
1221 | "Exchange the two characters before the cursor", |
---|
1222 | /* EGS: make Convex Users happy */ |
---|
1223 | "tty-dsusp", F_TTY_DSUSP, |
---|
1224 | "Tty delayed suspend character", |
---|
1225 | "tty-flush-output", F_TTY_FLUSHO, |
---|
1226 | "Tty flush output character", |
---|
1227 | "tty-sigintr", F_TTY_INT, |
---|
1228 | "Tty interrupt character", |
---|
1229 | "tty-sigquit", F_TTY_QUIT, |
---|
1230 | "Tty quit character", |
---|
1231 | "tty-sigtsusp", F_TTY_TSUSP, |
---|
1232 | "Tty suspend character", |
---|
1233 | "tty-start-output", F_TTY_STARTO, |
---|
1234 | "Tty allow output character", |
---|
1235 | "tty-stop-output", F_TTY_STOPO, |
---|
1236 | "Tty disallow output character", |
---|
1237 | "undefined-key", F_UNASSIGNED, |
---|
1238 | "Indicates unbound character", |
---|
1239 | "universal-argument", F_ARGFOUR, |
---|
1240 | "Emacs universal argument (argument times 4)", |
---|
1241 | "up-history", F_UP_HIST, |
---|
1242 | "Move to previous history line", |
---|
1243 | "upcase-word", F_CASEUPPER, |
---|
1244 | "Uppercase the characters from cursor to end of current word", |
---|
1245 | "vi-beginning-of-next-word", V_WORDBEGNEXT, |
---|
1246 | "Vi goto the beginning of next word", |
---|
1247 | "vi-add", V_ADD, |
---|
1248 | "Vi enter insert mode after the cursor", |
---|
1249 | "vi-add-at-eol", V_ADDEND, |
---|
1250 | "Vi enter insert mode at end of line", |
---|
1251 | "vi-chg-case", V_CHGCASE, |
---|
1252 | "Vi change case of character under cursor and advance one character", |
---|
1253 | "vi-chg-meta", V_CHGMETA, |
---|
1254 | "Vi change prefix command", |
---|
1255 | "vi-chg-to-eol", V_CHGTOEND, |
---|
1256 | "Vi change to end of line", |
---|
1257 | "vi-cmd-mode", V_CMD_MODE, |
---|
1258 | "Enter vi command mode (use alternative key bindings)", |
---|
1259 | "vi-cmd-mode-complete", V_CM_COMPLETE, |
---|
1260 | "Vi command mode complete current word", |
---|
1261 | "vi-delprev", V_DELPREV, |
---|
1262 | "Vi move to previous character (backspace)", |
---|
1263 | "vi-delmeta", V_DELMETA, |
---|
1264 | "Vi delete prefix command", |
---|
1265 | "vi-endword", V_ENDWORD, |
---|
1266 | "Vi move to the end of the current space delimited word", |
---|
1267 | "vi-eword", V_EWORD, |
---|
1268 | "Vi move to the end of the current word", |
---|
1269 | "vi-char-back", V_CHAR_BACK, |
---|
1270 | "Vi move to the character specified backwards", |
---|
1271 | "vi-char-fwd", V_CHAR_FWD, |
---|
1272 | "Vi move to the character specified forward", |
---|
1273 | "vi-charto-back", V_CHARTO_BACK, |
---|
1274 | "Vi move up to the character specified backwards", |
---|
1275 | "vi-charto-fwd", V_CHARTO_FWD, |
---|
1276 | "Vi move up to the character specified forward", |
---|
1277 | "vi-insert", V_INSERT, |
---|
1278 | "Enter vi insert mode", |
---|
1279 | "vi-insert-at-bol", V_INSBEG, |
---|
1280 | "Enter vi insert mode at beginning of line", |
---|
1281 | "vi-repeat-char-fwd", V_RCHAR_FWD, |
---|
1282 | "Vi repeat current character search in the same search direction", |
---|
1283 | "vi-repeat-char-back", V_RCHAR_BACK, |
---|
1284 | "Vi repeat current character search in the opposite search direction", |
---|
1285 | "vi-repeat-search-fwd", V_RSRCH_FWD, |
---|
1286 | "Vi repeat current search in the same search direction", |
---|
1287 | "vi-repeat-search-back", V_RSRCH_BACK, |
---|
1288 | "Vi repeat current search in the opposite search direction", |
---|
1289 | "vi-replace-char", V_REPLONE, |
---|
1290 | "Vi replace character under the cursor with the next character typed", |
---|
1291 | "vi-replace-mode", V_REPLMODE, |
---|
1292 | "Vi replace mode", |
---|
1293 | "vi-search-back", V_USH_META, |
---|
1294 | "Vi search history backwards", |
---|
1295 | "vi-search-fwd", V_DSH_META, |
---|
1296 | "Vi search history forward", |
---|
1297 | "vi-substitute-char", V_SUBSTCHAR, |
---|
1298 | "Vi replace character under the cursor and enter insert mode", |
---|
1299 | "vi-substitute-line", V_SUBSTLINE, |
---|
1300 | "Vi replace entire line", |
---|
1301 | "vi-word-back", V_WORDBACK, |
---|
1302 | "Vi move to the previous word", |
---|
1303 | "vi-word-fwd", V_WORDFWD, |
---|
1304 | "Vi move to the next word", |
---|
1305 | "vi-undo", V_UNDO, |
---|
1306 | "Vi undo last change", |
---|
1307 | "vi-zero", V_ZERO, |
---|
1308 | "Vi goto the beginning of line", |
---|
1309 | "which-command", F_WHICH, |
---|
1310 | "Perform which of current command", |
---|
1311 | "yank", F_YANK_KILL, |
---|
1312 | "Paste cut buffer at cursor position", |
---|
1313 | 0, 0 |
---|
1314 | }; |
---|
1315 | |
---|
1316 | #ifdef DEBUG_EDIT |
---|
1317 | void |
---|
1318 | CheckMaps() |
---|
1319 | { /* check the size of the key maps */ |
---|
1320 | int c1 = (256 * sizeof(KEYCMD)); |
---|
1321 | |
---|
1322 | if ((sizeof(CcKeyMap)) != c1) |
---|
1323 | xprintf("CcKeyMap should be 256 entries, but is %d.\r\n", |
---|
1324 | (sizeof(CcKeyMap) / sizeof(KEYCMD))); |
---|
1325 | |
---|
1326 | if ((sizeof(CcAltMap)) != c1) |
---|
1327 | xprintf("CcAltMap should be 256 entries, but is %d.\r\n", |
---|
1328 | (sizeof(CcAltMap) / sizeof(KEYCMD))); |
---|
1329 | |
---|
1330 | if ((sizeof(CcEmacsMap)) != c1) |
---|
1331 | xprintf("CcEmacsMap should be 256 entries, but is %d.\r\n", |
---|
1332 | (sizeof(CcEmacsMap) / sizeof(KEYCMD))); |
---|
1333 | |
---|
1334 | if ((sizeof(CcViMap)) != c1) |
---|
1335 | xprintf("CcViMap should be 256 entries, but is %d.\r\n", |
---|
1336 | (sizeof(CcViMap) / sizeof(KEYCMD))); |
---|
1337 | |
---|
1338 | if ((sizeof(CcViCmdMap)) != c1) |
---|
1339 | xprintf("CcViCmdMap should be 256 entries, but is %d.\r\n", |
---|
1340 | (sizeof(CcViCmdMap) / sizeof(KEYCMD))); |
---|
1341 | } |
---|
1342 | |
---|
1343 | #endif |
---|
1344 | |
---|
1345 | bool MapsAreInited = 0; |
---|
1346 | bool NLSMapsAreInited = 0; |
---|
1347 | bool NoNLSRebind; |
---|
1348 | |
---|
1349 | void |
---|
1350 | ed_InitNLSMaps() |
---|
1351 | { |
---|
1352 | register int i; |
---|
1353 | |
---|
1354 | if (AsciiOnly) |
---|
1355 | return; |
---|
1356 | if (NoNLSRebind) |
---|
1357 | return; |
---|
1358 | for (i = 0200; i <= 0377; i++) { |
---|
1359 | if (Isprint(i)) { |
---|
1360 | CcKeyMap[i] = F_INSERT; |
---|
1361 | } |
---|
1362 | } |
---|
1363 | NLSMapsAreInited = 1; |
---|
1364 | } |
---|
1365 | |
---|
1366 | static void |
---|
1367 | ed_InitMetaBindings() |
---|
1368 | { |
---|
1369 | Char buf[3]; |
---|
1370 | register int i; |
---|
1371 | KEYCMD *map; |
---|
1372 | |
---|
1373 | map = CcKeyMap; |
---|
1374 | for (i = 0; i <= 0377 && CcKeyMap[i] != F_METANEXT; i++) |
---|
1375 | continue; |
---|
1376 | if (i > 0377) { |
---|
1377 | for (i = 0; i <= 0377 && CcAltMap[i] != F_METANEXT; i++) |
---|
1378 | continue; |
---|
1379 | if (i > 0377) { |
---|
1380 | i = 033; |
---|
1381 | if (VImode) |
---|
1382 | map = CcAltMap; |
---|
1383 | } |
---|
1384 | else { |
---|
1385 | map = CcAltMap; |
---|
1386 | } |
---|
1387 | } |
---|
1388 | buf[0] = (Char) i; |
---|
1389 | buf[2] = 0; |
---|
1390 | for (i = 0200; i <= 0377; i++) { |
---|
1391 | if (map[i] != F_INSERT && map[i] != F_UNASSIGNED && map[i] != F_XKEY) { |
---|
1392 | buf[1] = i & ASCII; |
---|
1393 | AddXkey(buf, XmapCmd((int) map[i]), XK_CMD); |
---|
1394 | } |
---|
1395 | } |
---|
1396 | map[buf[0]] = F_XKEY; |
---|
1397 | } |
---|
1398 | |
---|
1399 | void |
---|
1400 | ed_InitVIMaps() |
---|
1401 | { |
---|
1402 | register int i; |
---|
1403 | |
---|
1404 | VImode = 1; |
---|
1405 | ResetXmap(); |
---|
1406 | for (i = 0; i < 256; i++) { |
---|
1407 | CcKeyMap[i] = CcViMap[i]; |
---|
1408 | CcAltMap[i] = CcViCmdMap[i]; |
---|
1409 | } |
---|
1410 | ed_InitMetaBindings(); |
---|
1411 | ed_InitNLSMaps(); |
---|
1412 | ResetArrowKeys(); |
---|
1413 | BindArrowKeys(); |
---|
1414 | } |
---|
1415 | |
---|
1416 | void |
---|
1417 | ed_InitEmacsMaps() |
---|
1418 | { |
---|
1419 | register int i; |
---|
1420 | Char buf[3]; |
---|
1421 | |
---|
1422 | VImode = 0; |
---|
1423 | ResetXmap(); |
---|
1424 | for (i = 0; i < 256; i++) { |
---|
1425 | CcKeyMap[i] = CcEmacsMap[i]; |
---|
1426 | CcAltMap[i] = F_UNASSIGNED; |
---|
1427 | } |
---|
1428 | ed_InitMetaBindings(); |
---|
1429 | ed_InitNLSMaps(); |
---|
1430 | buf[0] = 030; |
---|
1431 | buf[2] = 0; |
---|
1432 | buf[1] = 030; |
---|
1433 | AddXkey(buf, XmapCmd(F_EXCHANGE_MARK), XK_CMD); |
---|
1434 | buf[1] = '*'; |
---|
1435 | AddXkey(buf, XmapCmd(F_EXPAND_GLOB), XK_CMD); |
---|
1436 | buf[1] = '$'; |
---|
1437 | AddXkey(buf, XmapCmd(F_EXPAND_VARS), XK_CMD); |
---|
1438 | buf[1] = 'G'; |
---|
1439 | AddXkey(buf, XmapCmd(F_LIST_GLOB), XK_CMD); |
---|
1440 | buf[1] = 'g'; |
---|
1441 | AddXkey(buf, XmapCmd(F_LIST_GLOB), XK_CMD); |
---|
1442 | buf[1] = 'n'; |
---|
1443 | AddXkey(buf, XmapCmd(F_PATH_NORM), XK_CMD); |
---|
1444 | buf[1] = 'N'; |
---|
1445 | AddXkey(buf, XmapCmd(F_PATH_NORM), XK_CMD); |
---|
1446 | buf[1] = '\t'; |
---|
1447 | AddXkey(buf, XmapCmd(F_COMPLETE_ALL), XK_CMD); |
---|
1448 | buf[1] = 004; /* ^D */ |
---|
1449 | AddXkey(buf, XmapCmd(F_LIST_ALL), XK_CMD); |
---|
1450 | ResetArrowKeys(); |
---|
1451 | BindArrowKeys(); |
---|
1452 | } |
---|
1453 | |
---|
1454 | void |
---|
1455 | ed_InitMaps() |
---|
1456 | { |
---|
1457 | if (MapsAreInited) |
---|
1458 | return; |
---|
1459 | #ifdef VIDEFAULT |
---|
1460 | ed_InitVIMaps(); |
---|
1461 | #else |
---|
1462 | ed_InitEmacsMaps(); |
---|
1463 | #endif |
---|
1464 | |
---|
1465 | MapsAreInited = 1; |
---|
1466 | } |
---|