1 /* $Header: /p/tcsh/cvsroot/tcsh/ed.defns.c,v 3.51 2016/02/14 15:44:18 christos 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. Neither the name of the University nor the names of its contributors 18 * may be used to endorse or promote products derived from this software 19 * without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 #include "sh.h" 34 35 RCSID("$tcsh: ed.defns.c,v 3.51 2016/02/14 15:44:18 christos Exp $") 36 37 #include "ed.h" 38 39 static void ed_InitMetaBindings (void); 40 41 PFCmd CcFuncTbl[] = { /* table of available commands */ 42 e_unassigned, 43 /* no #define here -- this is a dummy to detect initing of the key map */ 44 e_unassigned, 45 #define F_UNASSIGNED 1 46 e_insert, 47 #define F_INSERT 2 48 e_newline, 49 #define F_NEWLINE 3 50 e_delprev, 51 #define F_DELPREV 4 52 e_delnext, 53 #define F_DELNEXT 5 54 e_toend, 55 #define F_TOEND 6 56 e_tobeg, 57 #define F_TOBEG 7 58 e_charback, 59 #define F_CHARBACK 8 60 e_charfwd, 61 #define F_CHARFWD 9 62 e_quote, 63 #define F_QUOTE 10 64 e_startover, 65 #define F_STARTOVER 11 66 e_redisp, 67 #define F_REDISP 12 68 e_tty_int, 69 #define F_TTY_INT 13 70 e_wordback, 71 #define F_WORDBACK 14 72 e_wordfwd, 73 #define F_WORDFWD 15 74 e_cleardisp, 75 #define F_CLEARDISP 16 76 e_complete, 77 #define F_COMPLETE 17 78 e_correct, 79 #define F_CORRECT 18 80 e_up_hist, 81 #define F_UP_HIST 19 82 e_down_hist, 83 #define F_DOWN_HIST 20 84 e_up_search_hist, 85 #define F_UP_SEARCH_HIST 21 86 e_down_search_hist, 87 #define F_DOWN_SEARCH_HIST 22 88 e_helpme, 89 #define F_HELPME 23 90 e_list_choices, 91 #define F_LIST_CHOICES 24 92 e_delwordprev, 93 #define F_DELWORDPREV 25 94 e_delwordnext, 95 #define F_DELWORDNEXT 26 96 e_digit, 97 #define F_DIGIT 27 98 e_killend, 99 #define F_KILLEND 28 100 e_killbeg, 101 #define F_KILLBEG 29 102 e_metanext, 103 #define F_METANEXT 30 104 e_send_eof, 105 #define F_SEND_EOF 31 106 e_charswitch, 107 #define F_CHARSWITCH 32 108 e_which, 109 #define F_WHICH 33 110 e_yank_kill, 111 #define F_YANK_KILL 34 112 e_tty_dsusp, 113 #define F_TTY_DSUSP 35 114 e_tty_flusho, 115 #define F_TTY_FLUSHO 36 116 e_tty_quit, 117 #define F_TTY_QUIT 37 118 e_tty_tsusp, 119 #define F_TTY_TSUSP 38 120 e_tty_stopo, 121 #define F_TTY_STOPO 39 122 e_tty_starto, 123 #define F_TTY_STARTO 40 124 e_argfour, 125 #define F_ARGFOUR 41 126 e_set_mark, 127 #define F_SET_MARK 42 128 e_exchange_mark, 129 #define F_EXCHANGE_MARK 43 130 e_last_item, 131 #define F_LAST_ITEM 44 132 e_delnext_list_eof, 133 #define F_DELNEXT_LIST_EOF 45 134 v_cmd_mode, 135 #define V_CMD_MODE 46 136 v_insert, 137 #define V_INSERT 47 138 e_argdigit, 139 #define F_ARGDIGIT 48 140 e_killregion, 141 #define F_KILLREGION 49 142 e_copyregion, 143 #define F_COPYREGION 50 144 e_gcharswitch, 145 #define F_GCHARSWITCH 51 146 e_run_fg_editor, 147 #define F_RUN_FG_EDITOR 52 148 e_unassigned, /* place holder for sequence lead in character */ 149 #define F_XKEY 53 150 e_uppercase, 151 #define F_CASEUPPER 54 152 e_lowercase, 153 #define F_CASELOWER 55 154 e_capitalcase, 155 #define F_CASECAPITAL 56 156 v_zero, 157 #define V_ZERO 57 158 v_add, 159 #define V_ADD 58 160 v_addend, 161 #define V_ADDEND 59 162 v_wordbegnext, 163 #define V_WORDBEGNEXT 60 164 e_killall, 165 #define F_KILLALL 61 166 e_unassigned, 167 /* F_EXTENDNEXT removed */ 168 v_insbeg, 169 #define V_INSBEG 63 170 v_replmode, 171 #define V_REPLMODE 64 172 v_replone, 173 #define V_REPLONE 65 174 v_substline, 175 #define V_SUBSTLINE 66 176 v_substchar, 177 #define V_SUBSTCHAR 67 178 v_chgtoend, 179 #define V_CHGTOEND 68 180 e_list_eof, 181 #define F_LIST_EOF 69 182 e_list_glob, 183 #define F_LIST_GLOB 70 184 e_expand_history, 185 #define F_EXPAND_HISTORY 71 186 e_magic_space, 187 #define F_MAGIC_SPACE 72 188 e_insovr, 189 #define F_INSOVR 73 190 v_cm_complete, 191 #define V_CM_COMPLETE 74 192 e_copyprev, 193 #define F_COPYPREV 75 194 e_correctl, 195 #define F_CORRECT_L 76 196 e_expand_glob, 197 #define F_EXPAND_GLOB 77 198 e_expand_vars, 199 #define F_EXPAND_VARS 78 200 e_toggle_hist, 201 #define F_TOGGLE_HIST 79 202 v_change_case, 203 #define V_CHGCASE 80 204 e_expand, 205 #define F_EXPAND 81 206 e_load_average, 207 #define F_LOAD_AVERAGE 82 208 v_delprev, 209 #define V_DELPREV 83 210 v_delmeta, 211 #define V_DELMETA 84 212 v_wordfwd, 213 #define V_WORDFWD 85 214 v_wordback, 215 #define V_WORDBACK 86 216 v_endword, 217 #define V_ENDWORD 87 218 v_eword, 219 #define V_EWORD 88 220 v_undo, 221 #define V_UNDO 89 222 v_ush_meta, 223 #define V_USH_META 90 224 v_dsh_meta, 225 #define V_DSH_META 91 226 v_rsrch_fwd, 227 #define V_RSRCH_FWD 92 228 v_rsrch_back, 229 #define V_RSRCH_BACK 93 230 v_char_fwd, 231 #define V_CHAR_FWD 94 232 v_char_back, 233 #define V_CHAR_BACK 95 234 v_chgmeta, 235 #define V_CHGMETA 96 236 e_inc_fwd, 237 #define F_INC_FWD 97 238 e_inc_back, 239 #define F_INC_BACK 98 240 v_rchar_fwd, 241 #define V_RCHAR_FWD 99 242 v_rchar_back, 243 #define V_RCHAR_BACK 100 244 v_charto_fwd, 245 #define V_CHARTO_FWD 101 246 v_charto_back, 247 #define V_CHARTO_BACK 102 248 e_normalize_path, 249 #define F_PATH_NORM 103 250 e_delnext_eof, /* added by mtk@ari.ncl.omron.co.jp (920818) */ 251 #define F_DELNEXT_EOF 104 252 e_stuff_char, 253 #define F_STUFF_CHAR 105 254 e_complete_all, 255 #define F_COMPLETE_ALL 106 256 e_list_all, 257 #define F_LIST_ALL 107 258 e_complete_fwd, 259 #define F_COMPLETE_FWD 108 260 e_complete_back, 261 #define F_COMPLETE_BACK 109 262 e_delnext_list, 263 #define F_DELNEXT_LIST 110 264 e_normalize_command, 265 #define F_COMMAND_NORM 111 266 e_dabbrev_expand, 267 #define F_DABBREV_EXPAND 112 268 e_copy_to_clipboard, 269 #define F_COPY_CLIP 113 270 e_paste_from_clipboard, 271 #define F_PASTE_CLIP 114 272 e_dosify_next, 273 #define F_DOSIFY_NEXT 115 274 e_dosify_prev, 275 #define F_DOSIFY_PREV 116 276 e_page_up, 277 #define F_PAGE_UP 117 278 e_page_down, 279 #define F_PAGE_DOWN 118 280 e_yank_pop, 281 #define F_YANK_POP 119 282 e_newline_hold, 283 #define F_NEWLINE_HOLD 120 284 e_newline_down_hist, 285 #define F_NEWLINE_DOWN_HIST 121 286 0 /* DUMMY VALUE */ 287 #define F_NUM_FNS 122 288 289 }; 290 291 KEYCMD NumFuns = F_NUM_FNS; 292 293 KEYCMD CcKeyMap[NT_NUM_KEYS]; /* the real key map */ 294 KEYCMD CcAltMap[NT_NUM_KEYS]; /* the alternative key map */ 295 #define F_NUM_FUNCNAMES (F_NUM_FNS + 2) 296 struct KeyFuncs FuncNames[F_NUM_FUNCNAMES]; 297 298 #ifdef WINNT_NATIVE 299 extern KEYCMD CcEmacsMap[]; 300 extern KEYCMD CcViMap[]; 301 extern KEYCMD CcViCmdMap[]; 302 #else /* !WINNT_NATIVE*/ 303 KEYCMD CcEmacsMap[] = { 304 /* keymap table, each index into above tbl; should be 256*sizeof(KEYCMD) 305 bytes long */ 306 307 F_SET_MARK, /* ^@ */ 308 F_TOBEG, /* ^A */ 309 F_CHARBACK, /* ^B */ 310 F_TTY_INT, /* ^C */ 311 F_DELNEXT_LIST_EOF, /* ^D */ 312 F_TOEND, /* ^E */ 313 F_CHARFWD, /* ^F */ 314 F_UNASSIGNED, /* ^G */ 315 F_DELPREV, /* ^H */ 316 F_COMPLETE, /* ^I */ 317 F_NEWLINE, /* ^J */ 318 F_KILLEND, /* ^K */ 319 F_CLEARDISP, /* ^L */ 320 F_NEWLINE, /* ^M */ 321 F_DOWN_HIST, /* ^N */ 322 F_TTY_FLUSHO, /* ^O */ 323 F_UP_HIST, /* ^P */ 324 F_TTY_STARTO, /* ^Q */ 325 F_REDISP, /* ^R */ 326 F_TTY_STOPO, /* ^S */ 327 F_CHARSWITCH, /* ^T */ 328 F_KILLALL, /* ^U */ 329 F_QUOTE, /* ^V */ 330 F_KILLREGION, /* ^W */ 331 F_XKEY, /* ^X */ 332 F_YANK_KILL, /* ^Y */ 333 F_TTY_TSUSP, /* ^Z */ 334 F_METANEXT, /* ^[ */ 335 F_TTY_QUIT, /* ^\ */ 336 F_TTY_DSUSP, /* ^] */ 337 F_UNASSIGNED, /* ^^ */ 338 F_UNASSIGNED, /* ^_ */ 339 F_INSERT, /* SPACE */ 340 F_INSERT, /* ! */ 341 F_INSERT, /* " */ 342 F_INSERT, /* # */ 343 F_INSERT, /* $ */ 344 F_INSERT, /* % */ 345 F_INSERT, /* & */ 346 F_INSERT, /* ' */ 347 F_INSERT, /* ( */ 348 F_INSERT, /* ) */ 349 F_INSERT, /* * */ 350 F_INSERT, /* + */ 351 F_INSERT, /* , */ 352 F_INSERT, /* - */ 353 F_INSERT, /* . */ 354 F_INSERT, /* / */ 355 F_DIGIT, /* 0 */ 356 F_DIGIT, /* 1 */ 357 F_DIGIT, /* 2 */ 358 F_DIGIT, /* 3 */ 359 F_DIGIT, /* 4 */ 360 F_DIGIT, /* 5 */ 361 F_DIGIT, /* 6 */ 362 F_DIGIT, /* 7 */ 363 F_DIGIT, /* 8 */ 364 F_DIGIT, /* 9 */ 365 F_INSERT, /* : */ 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_INSERT, /* _ */ 403 F_INSERT, /* ` */ 404 F_INSERT, /* a */ 405 F_INSERT, /* b */ 406 F_INSERT, /* c */ 407 F_INSERT, /* d */ 408 F_INSERT, /* e */ 409 F_INSERT, /* f */ 410 F_INSERT, /* g */ 411 F_INSERT, /* h */ 412 F_INSERT, /* i */ 413 F_INSERT, /* j */ 414 F_INSERT, /* k */ 415 F_INSERT, /* l */ 416 F_INSERT, /* m */ 417 F_INSERT, /* n */ 418 F_INSERT, /* o */ 419 F_INSERT, /* p */ 420 F_INSERT, /* q */ 421 F_INSERT, /* r */ 422 F_INSERT, /* s */ 423 F_INSERT, /* t */ 424 F_INSERT, /* u */ 425 F_INSERT, /* v */ 426 F_INSERT, /* w */ 427 F_INSERT, /* x */ 428 F_INSERT, /* y */ 429 F_INSERT, /* z */ 430 F_INSERT, /* { */ 431 F_INSERT, /* | */ 432 F_INSERT, /* } */ 433 F_INSERT, /* ~ */ 434 F_DELPREV, /* ^? */ 435 F_UNASSIGNED, /* M-^@ */ 436 F_UNASSIGNED, /* M-^A */ 437 F_UNASSIGNED, /* M-^B */ 438 F_UNASSIGNED, /* M-^C */ 439 F_LIST_CHOICES, /* M-^D */ 440 F_UNASSIGNED, /* M-^E */ 441 F_UNASSIGNED, /* M-^F */ 442 F_UNASSIGNED, /* M-^G */ 443 F_DELWORDPREV, /* M-^H */ 444 F_COMPLETE, /* M-^I */ 445 F_UNASSIGNED, /* M-^J */ 446 F_UNASSIGNED, /* M-^K */ 447 F_CLEARDISP, /* M-^L */ 448 F_UNASSIGNED, /* M-^M */ 449 F_UNASSIGNED, /* M-^N */ 450 F_UNASSIGNED, /* M-^O */ 451 F_UNASSIGNED, /* M-^P */ 452 F_UNASSIGNED, /* M-^Q */ 453 F_UNASSIGNED, /* M-^R */ 454 F_UNASSIGNED, /* M-^S */ 455 F_UNASSIGNED, /* M-^T */ 456 F_UNASSIGNED, /* M-^U */ 457 F_UNASSIGNED, /* M-^V */ 458 F_UNASSIGNED, /* M-^W */ 459 F_UNASSIGNED, /* M-^X */ 460 F_UNASSIGNED, /* M-^Y */ 461 F_RUN_FG_EDITOR, /* M-^Z */ 462 F_COMPLETE, /* M-^[ */ 463 F_UNASSIGNED, /* M-^\ */ 464 F_UNASSIGNED, /* M-^] */ 465 F_UNASSIGNED, /* M-^^ */ 466 F_COPYPREV, /* M-^_ */ 467 F_EXPAND_HISTORY, /* M-SPACE */ 468 F_EXPAND_HISTORY, /* M-! */ 469 F_UNASSIGNED, /* M-" */ 470 F_UNASSIGNED, /* M-# */ 471 F_CORRECT_L, /* M-$ */ 472 F_UNASSIGNED, /* M-% */ 473 F_UNASSIGNED, /* M-& */ 474 F_UNASSIGNED, /* M-' */ 475 F_UNASSIGNED, /* M-( */ 476 F_UNASSIGNED, /* M-) */ 477 F_UNASSIGNED, /* M-* */ 478 F_UNASSIGNED, /* M-+ */ 479 F_UNASSIGNED, /* M-, */ 480 F_UNASSIGNED, /* M-- */ 481 F_UNASSIGNED, /* M-. */ 482 F_DABBREV_EXPAND, /* M-/ */ 483 F_ARGDIGIT, /* M-0 */ 484 F_ARGDIGIT, /* M-1 */ 485 F_ARGDIGIT, /* M-2 */ 486 F_ARGDIGIT, /* M-3 */ 487 F_ARGDIGIT, /* M-4 */ 488 F_ARGDIGIT, /* M-5 */ 489 F_ARGDIGIT, /* M-6 */ 490 F_ARGDIGIT, /* M-7 */ 491 F_ARGDIGIT, /* M-8 */ 492 F_ARGDIGIT, /* M-9 */ 493 F_UNASSIGNED, /* M-: */ 494 F_UNASSIGNED, /* M-; */ 495 F_UNASSIGNED, /* M-< */ 496 F_UNASSIGNED, /* M-= */ 497 F_UNASSIGNED, /* M-> */ 498 F_WHICH, /* M-? */ 499 F_UNASSIGNED, /* M-@ */ 500 F_NEWLINE_HOLD, /* 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_XKEY, /* M-O *//* extended key esc PWP Mar 88 */ 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_YANK_POP, /* M-Y */ 525 F_UNASSIGNED, /* M-Z */ 526 F_XKEY, /* M-[ *//* extended key esc -mf Oct 87 */ 527 F_UNASSIGNED, /* M-\ */ 528 F_UNASSIGNED, /* M-] */ 529 F_UNASSIGNED, /* M-^ */ 530 F_LAST_ITEM, /* M-_ */ 531 F_UNASSIGNED, /* M-` */ 532 F_NEWLINE_HOLD, /* M-a */ 533 F_WORDBACK, /* M-b */ 534 F_CASECAPITAL, /* M-c */ 535 F_DELWORDNEXT, /* M-d */ 536 F_UNASSIGNED, /* M-e */ 537 F_WORDFWD, /* M-f */ 538 F_UNASSIGNED, /* M-g */ 539 F_HELPME, /* M-h */ 540 F_UNASSIGNED, /* M-i */ 541 F_UNASSIGNED, /* M-j */ 542 F_UNASSIGNED, /* M-k */ 543 F_CASELOWER, /* M-l */ 544 F_UNASSIGNED, /* M-m */ 545 F_DOWN_SEARCH_HIST, /* M-n */ 546 F_UNASSIGNED, /* M-o */ 547 F_UP_SEARCH_HIST, /* M-p */ 548 F_UNASSIGNED, /* M-q */ 549 F_TOGGLE_HIST, /* M-r */ 550 F_CORRECT, /* M-s */ 551 F_UNASSIGNED, /* M-t */ 552 F_CASEUPPER, /* M-u */ 553 F_UNASSIGNED, /* M-v */ 554 F_COPYREGION, /* M-w */ 555 F_UNASSIGNED, /* M-x */ 556 F_YANK_POP, /* M-y */ 557 F_UNASSIGNED, /* M-z */ 558 F_UNASSIGNED, /* M-{ */ 559 F_UNASSIGNED, /* M-| */ 560 F_UNASSIGNED, /* M-} */ 561 F_UNASSIGNED, /* M-~ */ 562 F_DELWORDPREV /* M-^? */ 563 }; 564 565 /* 566 * keymap table for vi. Each index into above tbl; should be 567 * 256 entries long. Vi mode uses a sticky-extend to do command mode: 568 * insert mode characters are in the normal keymap, and command mode 569 * in the extended keymap. 570 */ 571 static KEYCMD CcViMap[] = { 572 #ifdef KSHVI 573 F_UNASSIGNED, /* ^@ */ 574 F_INSERT, /* ^A */ 575 F_INSERT, /* ^B */ 576 F_INSERT, /* ^C */ 577 F_INSERT, /* ^D */ 578 F_INSERT, /* ^E */ 579 F_INSERT, /* ^F */ 580 F_INSERT, /* ^G */ 581 V_DELPREV, /* ^H */ /* BackSpace key */ 582 F_COMPLETE, /* ^I */ /* Tab Key */ 583 F_NEWLINE, /* ^J */ 584 F_INSERT, /* ^K */ 585 F_INSERT, /* ^L */ 586 F_NEWLINE, /* ^M */ 587 F_INSERT, /* ^N */ 588 F_INSERT, /* ^O */ 589 F_INSERT, /* ^P */ 590 F_TTY_STARTO, /* ^Q */ 591 F_INSERT, /* ^R */ 592 F_INSERT, /* ^S */ 593 F_INSERT, /* ^T */ 594 F_INSERT, /* ^U */ 595 F_QUOTE, /* ^V */ 596 F_DELWORDPREV, /* ^W */ /* Only until start edit pos */ 597 F_INSERT, /* ^X */ 598 F_INSERT, /* ^Y */ 599 F_INSERT, /* ^Z */ 600 V_CMD_MODE, /* ^[ */ /* [ Esc ] key */ 601 F_TTY_QUIT, /* ^\ */ 602 F_INSERT, /* ^] */ 603 F_INSERT, /* ^^ */ 604 F_INSERT, /* ^_ */ 605 #else /* !KSHVI */ 606 F_UNASSIGNED, /* ^@ */ /* NOTE: These mapping do NOT */ 607 F_TOBEG, /* ^A */ /* Correspond well to the KSH */ 608 F_CHARBACK, /* ^B */ /* VI editting assignments */ 609 F_TTY_INT, /* ^C */ /* On the other hand they are */ 610 F_LIST_EOF, /* ^D */ /* convenient any many people */ 611 F_TOEND, /* ^E */ /* have gotten used to them */ 612 F_CHARFWD, /* ^F */ 613 F_LIST_GLOB, /* ^G */ 614 F_DELPREV, /* ^H */ /* BackSpace key */ 615 F_COMPLETE, /* ^I */ /* Tab Key */ 616 F_NEWLINE, /* ^J */ 617 F_KILLEND, /* ^K */ 618 F_CLEARDISP, /* ^L */ 619 F_NEWLINE, /* ^M */ 620 F_DOWN_HIST, /* ^N */ 621 F_TTY_FLUSHO, /* ^O */ 622 F_UP_HIST, /* ^P */ 623 F_TTY_STARTO, /* ^Q */ 624 F_REDISP, /* ^R */ 625 F_TTY_STOPO, /* ^S */ 626 F_CHARSWITCH, /* ^T */ 627 F_KILLBEG, /* ^U */ 628 F_QUOTE, /* ^V */ 629 F_DELWORDPREV, /* ^W */ 630 F_EXPAND, /* ^X */ 631 F_TTY_DSUSP, /* ^Y */ 632 F_TTY_TSUSP, /* ^Z */ 633 V_CMD_MODE, /* ^[ */ 634 F_TTY_QUIT, /* ^\ */ 635 F_UNASSIGNED, /* ^] */ 636 F_UNASSIGNED, /* ^^ */ 637 F_UNASSIGNED, /* ^_ */ 638 #endif /* KSHVI */ 639 F_INSERT, /* SPACE */ 640 F_INSERT, /* ! */ 641 F_INSERT, /* " */ 642 F_INSERT, /* # */ 643 F_INSERT, /* $ */ 644 F_INSERT, /* % */ 645 F_INSERT, /* & */ 646 F_INSERT, /* ' */ 647 F_INSERT, /* ( */ 648 F_INSERT, /* ) */ 649 F_INSERT, /* * */ 650 F_INSERT, /* + */ 651 F_INSERT, /* , */ 652 F_INSERT, /* - */ 653 F_INSERT, /* . */ 654 F_INSERT, /* / */ 655 F_INSERT, /* 0 */ 656 F_INSERT, /* 1 */ 657 F_INSERT, /* 2 */ 658 F_INSERT, /* 3 */ 659 F_INSERT, /* 4 */ 660 F_INSERT, /* 5 */ 661 F_INSERT, /* 6 */ 662 F_INSERT, /* 7 */ 663 F_INSERT, /* 8 */ 664 F_INSERT, /* 9 */ 665 F_INSERT, /* : */ 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_INSERT, /* _ */ 703 F_INSERT, /* ` */ 704 F_INSERT, /* a */ 705 F_INSERT, /* b */ 706 F_INSERT, /* c */ 707 F_INSERT, /* d */ 708 F_INSERT, /* e */ 709 F_INSERT, /* f */ 710 F_INSERT, /* g */ 711 F_INSERT, /* h */ 712 F_INSERT, /* i */ 713 F_INSERT, /* j */ 714 F_INSERT, /* k */ 715 F_INSERT, /* l */ 716 F_INSERT, /* m */ 717 F_INSERT, /* n */ 718 F_INSERT, /* o */ 719 F_INSERT, /* p */ 720 F_INSERT, /* q */ 721 F_INSERT, /* r */ 722 F_INSERT, /* s */ 723 F_INSERT, /* t */ 724 F_INSERT, /* u */ 725 F_INSERT, /* v */ 726 F_INSERT, /* w */ 727 F_INSERT, /* x */ 728 F_INSERT, /* y */ 729 F_INSERT, /* z */ 730 F_INSERT, /* { */ 731 F_INSERT, /* | */ 732 F_INSERT, /* } */ 733 F_INSERT, /* ~ */ 734 F_DELPREV, /* ^? */ 735 F_UNASSIGNED, /* M-^@ */ 736 F_UNASSIGNED, /* M-^A */ 737 F_UNASSIGNED, /* M-^B */ 738 F_UNASSIGNED, /* M-^C */ 739 F_UNASSIGNED, /* M-^D */ 740 F_UNASSIGNED, /* M-^E */ 741 F_UNASSIGNED, /* M-^F */ 742 F_UNASSIGNED, /* M-^G */ 743 F_UNASSIGNED, /* M-^H */ 744 F_UNASSIGNED, /* M-^I */ 745 F_UNASSIGNED, /* M-^J */ 746 F_UNASSIGNED, /* M-^K */ 747 F_UNASSIGNED, /* M-^L */ 748 F_UNASSIGNED, /* M-^M */ 749 F_UNASSIGNED, /* M-^N */ 750 F_UNASSIGNED, /* M-^O */ 751 F_UNASSIGNED, /* M-^P */ 752 F_UNASSIGNED, /* M-^Q */ 753 F_UNASSIGNED, /* M-^R */ 754 F_UNASSIGNED, /* M-^S */ 755 F_UNASSIGNED, /* M-^T */ 756 F_UNASSIGNED, /* M-^U */ 757 F_UNASSIGNED, /* M-^V */ 758 F_UNASSIGNED, /* M-^W */ 759 F_UNASSIGNED, /* M-^X */ 760 F_UNASSIGNED, /* M-^Y */ 761 F_UNASSIGNED, /* M-^Z */ 762 F_UNASSIGNED, /* M-^[ */ 763 F_UNASSIGNED, /* M-^\ */ 764 F_UNASSIGNED, /* M-^] */ 765 F_UNASSIGNED, /* M-^^ */ 766 F_UNASSIGNED, /* M-^_ */ 767 F_UNASSIGNED, /* M-SPACE */ 768 F_UNASSIGNED, /* M-! */ 769 F_UNASSIGNED, /* M-" */ 770 F_UNASSIGNED, /* M-# */ 771 F_UNASSIGNED, /* M-$ */ 772 F_UNASSIGNED, /* M-% */ 773 F_UNASSIGNED, /* M-& */ 774 F_UNASSIGNED, /* M-' */ 775 F_UNASSIGNED, /* M-( */ 776 F_UNASSIGNED, /* M-) */ 777 F_UNASSIGNED, /* M-* */ 778 F_UNASSIGNED, /* M-+ */ 779 F_UNASSIGNED, /* M-, */ 780 F_UNASSIGNED, /* M-- */ 781 F_UNASSIGNED, /* M-. */ 782 F_UNASSIGNED, /* M-/ */ 783 F_UNASSIGNED, /* M-0 */ 784 F_UNASSIGNED, /* M-1 */ 785 F_UNASSIGNED, /* M-2 */ 786 F_UNASSIGNED, /* M-3 */ 787 F_UNASSIGNED, /* M-4 */ 788 F_UNASSIGNED, /* M-5 */ 789 F_UNASSIGNED, /* M-6 */ 790 F_UNASSIGNED, /* M-7 */ 791 F_UNASSIGNED, /* M-8 */ 792 F_UNASSIGNED, /* M-9 */ 793 F_UNASSIGNED, /* M-: */ 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 F_UNASSIGNED, /* M-` */ 832 F_UNASSIGNED, /* M-a */ 833 F_UNASSIGNED, /* M-b */ 834 F_UNASSIGNED, /* M-c */ 835 F_UNASSIGNED, /* M-d */ 836 F_UNASSIGNED, /* M-e */ 837 F_UNASSIGNED, /* M-f */ 838 F_UNASSIGNED, /* M-g */ 839 F_UNASSIGNED, /* M-h */ 840 F_UNASSIGNED, /* M-i */ 841 F_UNASSIGNED, /* M-j */ 842 F_UNASSIGNED, /* M-k */ 843 F_UNASSIGNED, /* M-l */ 844 F_UNASSIGNED, /* M-m */ 845 F_UNASSIGNED, /* M-n */ 846 F_UNASSIGNED, /* M-o */ 847 F_UNASSIGNED, /* M-p */ 848 F_UNASSIGNED, /* M-q */ 849 F_UNASSIGNED, /* M-r */ 850 F_UNASSIGNED, /* M-s */ 851 F_UNASSIGNED, /* M-t */ 852 F_UNASSIGNED, /* M-u */ 853 F_UNASSIGNED, /* M-v */ 854 F_UNASSIGNED, /* M-w */ 855 F_UNASSIGNED, /* M-x */ 856 F_UNASSIGNED, /* M-y */ 857 F_UNASSIGNED, /* M-z */ 858 F_UNASSIGNED, /* M-{ */ 859 F_UNASSIGNED, /* M-| */ 860 F_UNASSIGNED, /* M-} */ 861 F_UNASSIGNED, /* M-~ */ 862 F_UNASSIGNED /* M-^? */ 863 }; 864 865 KEYCMD CcViCmdMap[] = { 866 F_UNASSIGNED, /* ^@ */ 867 F_TOBEG, /* ^A */ 868 F_UNASSIGNED, /* ^B */ 869 F_TTY_INT, /* ^C */ 870 F_LIST_CHOICES, /* ^D */ 871 F_TOEND, /* ^E */ 872 F_UNASSIGNED, /* ^F */ 873 F_LIST_GLOB, /* ^G */ 874 F_CHARBACK, /* ^H */ 875 V_CM_COMPLETE, /* ^I */ 876 F_NEWLINE, /* ^J */ 877 F_KILLEND, /* ^K */ 878 F_CLEARDISP, /* ^L */ 879 F_NEWLINE, /* ^M */ 880 F_DOWN_HIST, /* ^N */ 881 F_TTY_FLUSHO, /* ^O */ 882 F_UP_HIST, /* ^P */ 883 F_TTY_STARTO, /* ^Q */ 884 F_REDISP, /* ^R */ 885 F_TTY_STOPO, /* ^S */ 886 F_UNASSIGNED, /* ^T */ 887 F_KILLBEG, /* ^U */ 888 F_UNASSIGNED, /* ^V */ 889 F_DELWORDPREV, /* ^W */ 890 F_EXPAND, /* ^X */ 891 F_UNASSIGNED, /* ^Y */ 892 F_UNASSIGNED, /* ^Z */ 893 F_METANEXT, /* ^[ */ 894 F_TTY_QUIT, /* ^\ */ 895 F_UNASSIGNED, /* ^] */ 896 F_UNASSIGNED, /* ^^ */ 897 F_UNASSIGNED, /* ^_ */ 898 F_CHARFWD, /* SPACE */ 899 F_EXPAND_HISTORY, /* ! */ 900 F_UNASSIGNED, /* " */ 901 F_UNASSIGNED, /* # */ 902 F_TOEND, /* $ */ 903 F_UNASSIGNED, /* % */ 904 F_UNASSIGNED, /* & */ 905 F_UNASSIGNED, /* ' */ 906 F_UNASSIGNED, /* ( */ 907 F_UNASSIGNED, /* ) */ 908 F_EXPAND_GLOB, /* * */ 909 F_DOWN_HIST, /* + */ 910 V_RCHAR_BACK, /* , */ 911 F_UP_HIST, /* - */ 912 F_UNASSIGNED, /* . */ 913 V_DSH_META, /* / */ 914 V_ZERO, /* 0 */ 915 F_ARGDIGIT, /* 1 */ 916 F_ARGDIGIT, /* 2 */ 917 F_ARGDIGIT, /* 3 */ 918 F_ARGDIGIT, /* 4 */ 919 F_ARGDIGIT, /* 5 */ 920 F_ARGDIGIT, /* 6 */ 921 F_ARGDIGIT, /* 7 */ 922 F_ARGDIGIT, /* 8 */ 923 F_ARGDIGIT, /* 9 */ 924 F_UNASSIGNED, /* : */ 925 V_RCHAR_FWD, /* ; */ 926 F_UNASSIGNED, /* < */ 927 F_UNASSIGNED, /* = */ 928 F_UNASSIGNED, /* > */ 929 V_USH_META, /* ? */ 930 F_UNASSIGNED, /* @ */ 931 V_ADDEND, /* A */ 932 V_WORDBACK, /* B */ 933 V_CHGTOEND, /* C */ 934 F_KILLEND, /* D */ 935 V_ENDWORD, /* E */ 936 V_CHAR_BACK, /* F */ 937 F_UNASSIGNED, /* G */ 938 F_UNASSIGNED, /* H */ 939 V_INSBEG, /* I */ 940 F_DOWN_SEARCH_HIST, /* J */ 941 F_UP_SEARCH_HIST, /* K */ 942 F_UNASSIGNED, /* L */ 943 F_UNASSIGNED, /* M */ 944 V_RSRCH_BACK, /* N */ 945 F_XKEY, /* O */ 946 F_UNASSIGNED, /* P */ 947 F_UNASSIGNED, /* Q */ 948 V_REPLMODE, /* R */ 949 V_SUBSTLINE, /* S */ 950 V_CHARTO_BACK, /* T */ 951 F_UNASSIGNED, /* U */ 952 F_EXPAND_VARS, /* V */ 953 V_WORDFWD, /* W */ 954 F_DELPREV, /* X */ 955 F_UNASSIGNED, /* Y */ 956 F_UNASSIGNED, /* Z */ 957 F_XKEY, /* [ */ 958 F_UNASSIGNED, /* \ */ 959 F_UNASSIGNED, /* ] */ 960 F_TOBEG, /* ^ */ 961 F_UNASSIGNED, /* _ */ 962 F_UNASSIGNED, /* ` */ 963 V_ADD, /* a */ 964 F_WORDBACK, /* b */ 965 V_CHGMETA, /* c */ 966 V_DELMETA, /* d */ 967 V_EWORD, /* e */ 968 V_CHAR_FWD, /* f */ 969 F_UNASSIGNED, /* g */ 970 F_CHARBACK, /* h */ 971 V_INSERT, /* i */ 972 F_DOWN_HIST, /* j */ 973 F_UP_HIST, /* k */ 974 F_CHARFWD, /* l */ 975 F_UNASSIGNED, /* m */ 976 V_RSRCH_FWD, /* n */ 977 F_UNASSIGNED, /* o */ 978 F_UNASSIGNED, /* p */ 979 F_UNASSIGNED, /* q */ 980 V_REPLONE, /* r */ 981 V_SUBSTCHAR, /* s */ 982 V_CHARTO_FWD, /* t */ 983 V_UNDO, /* u */ 984 F_EXPAND_VARS, /* v */ 985 V_WORDBEGNEXT, /* w */ 986 F_DELNEXT_EOF, /* x */ 987 F_UNASSIGNED, /* y */ 988 F_UNASSIGNED, /* z */ 989 F_UNASSIGNED, /* { */ 990 F_UNASSIGNED, /* | */ 991 F_UNASSIGNED, /* } */ 992 V_CHGCASE, /* ~ */ 993 F_DELPREV, /* ^? */ 994 F_UNASSIGNED, /* M-^@ */ 995 F_UNASSIGNED, /* M-^A */ 996 F_UNASSIGNED, /* M-^B */ 997 F_UNASSIGNED, /* M-^C */ 998 F_UNASSIGNED, /* M-^D */ 999 F_UNASSIGNED, /* M-^E */ 1000 F_UNASSIGNED, /* M-^F */ 1001 F_UNASSIGNED, /* M-^G */ 1002 F_UNASSIGNED, /* M-^H */ 1003 F_UNASSIGNED, /* M-^I */ 1004 F_UNASSIGNED, /* M-^J */ 1005 F_UNASSIGNED, /* M-^K */ 1006 F_UNASSIGNED, /* M-^L */ 1007 F_UNASSIGNED, /* M-^M */ 1008 F_UNASSIGNED, /* M-^N */ 1009 F_UNASSIGNED, /* M-^O */ 1010 F_UNASSIGNED, /* M-^P */ 1011 F_UNASSIGNED, /* M-^Q */ 1012 F_UNASSIGNED, /* M-^R */ 1013 F_UNASSIGNED, /* M-^S */ 1014 F_UNASSIGNED, /* M-^T */ 1015 F_UNASSIGNED, /* M-^U */ 1016 F_UNASSIGNED, /* M-^V */ 1017 F_UNASSIGNED, /* M-^W */ 1018 F_UNASSIGNED, /* M-^X */ 1019 F_UNASSIGNED, /* M-^Y */ 1020 F_UNASSIGNED, /* M-^Z */ 1021 F_UNASSIGNED, /* M-^[ */ 1022 F_UNASSIGNED, /* M-^\ */ 1023 F_UNASSIGNED, /* M-^] */ 1024 F_UNASSIGNED, /* M-^^ */ 1025 F_UNASSIGNED, /* M-^_ */ 1026 F_UNASSIGNED, /* M-SPACE */ 1027 F_UNASSIGNED, /* M-! */ 1028 F_UNASSIGNED, /* M-" */ 1029 F_UNASSIGNED, /* M-# */ 1030 F_UNASSIGNED, /* M-$ */ 1031 F_UNASSIGNED, /* M-% */ 1032 F_UNASSIGNED, /* M-& */ 1033 F_UNASSIGNED, /* M-' */ 1034 F_UNASSIGNED, /* M-( */ 1035 F_UNASSIGNED, /* M-) */ 1036 F_UNASSIGNED, /* M-* */ 1037 F_UNASSIGNED, /* M-+ */ 1038 F_UNASSIGNED, /* M-, */ 1039 F_UNASSIGNED, /* M-- */ 1040 F_UNASSIGNED, /* M-. */ 1041 F_UNASSIGNED, /* M-/ */ 1042 F_UNASSIGNED, /* M-0 */ 1043 F_UNASSIGNED, /* M-1 */ 1044 F_UNASSIGNED, /* M-2 */ 1045 F_UNASSIGNED, /* M-3 */ 1046 F_UNASSIGNED, /* M-4 */ 1047 F_UNASSIGNED, /* M-5 */ 1048 F_UNASSIGNED, /* M-6 */ 1049 F_UNASSIGNED, /* M-7 */ 1050 F_UNASSIGNED, /* M-8 */ 1051 F_UNASSIGNED, /* M-9 */ 1052 F_UNASSIGNED, /* M-: */ 1053 F_UNASSIGNED, /* M-; */ 1054 F_UNASSIGNED, /* M-< */ 1055 F_UNASSIGNED, /* M-= */ 1056 F_UNASSIGNED, /* M-> */ 1057 F_HELPME, /* 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_XKEY, /* M-O *//* extended key esc PWP Mar 88 */ 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_XKEY, /* M-[ *//* extended key esc -mf Oct 87 */ 1086 F_UNASSIGNED, /* M-\ */ 1087 F_UNASSIGNED, /* M-] */ 1088 F_UNASSIGNED, /* M-^ */ 1089 F_UNASSIGNED, /* M-_ */ 1090 F_UNASSIGNED, /* M-` */ 1091 F_UNASSIGNED, /* M-a */ 1092 F_UNASSIGNED, /* M-b */ 1093 F_UNASSIGNED, /* M-c */ 1094 F_UNASSIGNED, /* M-d */ 1095 F_UNASSIGNED, /* M-e */ 1096 F_UNASSIGNED, /* M-f */ 1097 F_UNASSIGNED, /* M-g */ 1098 F_UNASSIGNED, /* M-h */ 1099 F_UNASSIGNED, /* M-i */ 1100 F_UNASSIGNED, /* M-j */ 1101 F_UNASSIGNED, /* M-k */ 1102 F_UNASSIGNED, /* M-l */ 1103 F_UNASSIGNED, /* M-m */ 1104 F_UNASSIGNED, /* M-n */ 1105 F_UNASSIGNED, /* M-o */ 1106 F_UNASSIGNED, /* M-p */ 1107 F_UNASSIGNED, /* M-q */ 1108 F_UNASSIGNED, /* M-r */ 1109 F_UNASSIGNED, /* M-s */ 1110 F_UNASSIGNED, /* M-t */ 1111 F_UNASSIGNED, /* M-u */ 1112 F_UNASSIGNED, /* M-v */ 1113 F_UNASSIGNED, /* M-w */ 1114 F_UNASSIGNED, /* M-x */ 1115 F_UNASSIGNED, /* M-y */ 1116 F_UNASSIGNED, /* M-z */ 1117 F_UNASSIGNED, /* M-{ */ 1118 F_UNASSIGNED, /* M-| */ 1119 F_UNASSIGNED, /* M-} */ 1120 F_UNASSIGNED, /* M-~ */ 1121 F_UNASSIGNED /* M-^? */ 1122 }; 1123 #endif /* WINNT_NATIVE */ 1124 1125 1126 void 1127 editinit(void) 1128 { 1129 struct KeyFuncs *f; 1130 1131 #if defined(NLS_CATALOGS) || defined(WINNT_NATIVE) 1132 int i; 1133 1134 for (i = 0; i < F_NUM_FUNCNAMES; i++) 1135 xfree((ptr_t)(intptr_t)FuncNames[i].desc); 1136 #endif 1137 1138 f = FuncNames; 1139 f->name = "backward-char"; 1140 f->func = F_CHARBACK; 1141 f->desc = CSAVS(3, 1, "Move back a character"); 1142 1143 f++; 1144 f->name = "backward-delete-char"; 1145 f->func = F_DELPREV; 1146 f->desc = CSAVS(3, 2, "Delete the character behind cursor"); 1147 1148 f++; 1149 f->name = "backward-delete-word"; 1150 f->func = F_DELWORDPREV; 1151 f->desc = CSAVS(3, 3, 1152 "Cut from beginning of current word to cursor - saved in cut buffer"); 1153 1154 f++; 1155 f->name = "backward-kill-line"; 1156 f->func = F_KILLBEG; 1157 f->desc = CSAVS(3, 4, 1158 "Cut from beginning of line to cursor - save in cut buffer"); 1159 1160 f++; 1161 f->name = "backward-word"; 1162 f->func = F_WORDBACK; 1163 f->desc = CSAVS(3, 5, "Move to beginning of current word"); 1164 1165 f++; 1166 f->name = "beginning-of-line"; 1167 f->func = F_TOBEG; 1168 f->desc = CSAVS(3, 6, "Move to beginning of line"); 1169 1170 f++; 1171 f->name = "capitalize-word"; 1172 f->func = F_CASECAPITAL; 1173 f->desc = CSAVS(3, 7, 1174 "Capitalize the characters from cursor to end of current word"); 1175 1176 f++; 1177 f->name = "change-case"; 1178 f->func = V_CHGCASE; 1179 f->desc = CSAVS(3, 8, 1180 "Vi change case of character under cursor and advance one character"); 1181 1182 f++; 1183 f->name = "change-till-end-of-line"; 1184 f->func = V_CHGTOEND; /* backward compat. */ 1185 f->desc = CSAVS(3, 9, "Vi change to end of line"); 1186 1187 f++; 1188 f->name = "clear-screen"; 1189 f->func = F_CLEARDISP; 1190 f->desc = CSAVS(3, 10, "Clear screen leaving current line on top"); 1191 1192 f++; 1193 f->name = "complete-word"; 1194 f->func = F_COMPLETE; 1195 f->desc = CSAVS(3, 11, "Complete current word"); 1196 1197 f++; 1198 f->name = "complete-word-fwd"; 1199 f->func = F_COMPLETE_FWD; 1200 f->desc = CSAVS(3, 12, "Tab forward through files"); 1201 1202 f++; 1203 f->name = "complete-word-back"; 1204 f->func = F_COMPLETE_BACK; 1205 f->desc = CSAVS(3, 13, "Tab backward through files"); 1206 1207 f++; 1208 f->name = "complete-word-raw"; 1209 f->func = F_COMPLETE_ALL; 1210 f->desc = CSAVS(3, 14, 1211 "Complete current word ignoring programmable completions"); 1212 1213 f++; 1214 f->name = "copy-prev-word"; 1215 f->func = F_COPYPREV; 1216 f->desc = CSAVS(3, 15, "Copy current word to cursor"); 1217 1218 f++; 1219 f->name = "copy-region-as-kill"; 1220 f->func = F_COPYREGION; 1221 f->desc = CSAVS(3, 16, "Copy area between mark and cursor to cut buffer"); 1222 1223 f++; 1224 f->name = "dabbrev-expand"; 1225 f->func = F_DABBREV_EXPAND; 1226 f->desc = CSAVS(3, 17, 1227 "Expand to preceding word for which this is a prefix"); 1228 1229 f++; 1230 f->name = "delete-char"; 1231 f->func = F_DELNEXT; 1232 f->desc = CSAVS(3, 18, "Delete character under cursor"); 1233 1234 f++; 1235 f->name = "delete-char-or-eof"; 1236 f->func = F_DELNEXT_EOF; 1237 f->desc = CSAVS(3, 19, 1238 "Delete character under cursor or signal end of file on an empty line"); 1239 1240 f++; 1241 f->name = "delete-char-or-list"; 1242 f->func = F_DELNEXT_LIST; 1243 f->desc = CSAVS(3, 20, 1244 "Delete character under cursor or list completions if at end of line"); 1245 1246 f++; 1247 f->name = "delete-char-or-list-or-eof"; 1248 f->func = F_DELNEXT_LIST_EOF; 1249 f->desc = CSAVS(3, 21, 1250 "Delete character under cursor, list completions or signal end of file"); 1251 1252 f++; 1253 f->name = "delete-word"; 1254 f->func = F_DELWORDNEXT; 1255 f->desc = CSAVS(3, 22, 1256 "Cut from cursor to end of current word - save in cut buffer"); 1257 1258 f++; 1259 f->name = "digit"; 1260 f->func = F_DIGIT; 1261 f->desc = CSAVS(3, 23, "Adds to argument if started or enters digit"); 1262 1263 f++; 1264 f->name = "digit-argument"; 1265 f->func = F_ARGDIGIT; 1266 f->desc = CSAVS(3, 24, "Digit that starts argument"); 1267 1268 f++; 1269 f->name = "down-history"; 1270 f->func = F_DOWN_HIST; 1271 f->desc = CSAVS(3, 25, "Move to next history line"); 1272 1273 f++; 1274 f->name = "downcase-word"; 1275 f->func = F_CASELOWER; 1276 f->desc = CSAVS(3, 26, 1277 "Lowercase the characters from cursor to end of current word"); 1278 1279 f++; 1280 f->name = "end-of-file"; 1281 f->func = F_SEND_EOF; 1282 f->desc = CSAVS(3, 27, "Indicate end of file"); 1283 1284 f++; 1285 f->name = "end-of-line"; 1286 f->func = F_TOEND; 1287 f->desc = CSAVS(3, 28, "Move cursor to end of line"); 1288 1289 f++; 1290 f->name = "exchange-point-and-mark"; 1291 f->func = F_EXCHANGE_MARK; 1292 f->desc = CSAVS(3, 29, "Exchange the cursor and mark"); 1293 1294 f++; 1295 f->name = "expand-glob"; 1296 f->func = F_EXPAND_GLOB; 1297 f->desc = CSAVS(3, 30, "Expand file name wildcards"); 1298 1299 f++; 1300 f->name = "expand-history"; 1301 f->func = F_EXPAND_HISTORY; 1302 f->desc = CSAVS(3, 31, "Expand history escapes"); 1303 1304 f++; 1305 f->name = "expand-line"; 1306 f->func = F_EXPAND; 1307 f->desc = CSAVS(3, 32, "Expand the history escapes in a line"); 1308 1309 f++; 1310 f->name = "expand-variables"; 1311 f->func = F_EXPAND_VARS; 1312 f->desc = CSAVS(3, 33, "Expand variables"); 1313 1314 f++; 1315 f->name = "forward-char"; 1316 f->func = F_CHARFWD; 1317 f->desc = CSAVS(3, 34, "Move forward one character"); 1318 1319 f++; 1320 f->name = "forward-word"; 1321 f->func = F_WORDFWD; 1322 f->desc = CSAVS(3, 35, "Move forward to end of current word"); 1323 1324 f++; 1325 f->name = "gosmacs-transpose-chars"; 1326 f->func = F_GCHARSWITCH; 1327 f->desc = CSAVS(3, 36, "Exchange the two characters before the cursor"); 1328 1329 f++; 1330 f->name = "history-search-backward"; 1331 f->func = F_UP_SEARCH_HIST; 1332 f->desc = CSAVS(3, 37, 1333 "Search in history backward for line beginning as current"); 1334 1335 f++; 1336 f->name = "history-search-forward"; 1337 f->func = F_DOWN_SEARCH_HIST; 1338 f->desc = CSAVS(3, 38, 1339 "Search in history forward for line beginning as current"); 1340 1341 f++; 1342 f->name = "insert-last-word"; 1343 f->func = F_LAST_ITEM; 1344 f->desc = CSAVS(3, 39, "Insert last item of previous command"); 1345 1346 f++; 1347 f->name = "i-search-fwd"; 1348 f->func = F_INC_FWD; 1349 f->desc = CSAVS(3, 40, "Incremental search forward"); 1350 1351 f++; 1352 f->name = "i-search-back"; 1353 f->func = F_INC_BACK; 1354 f->desc = CSAVS(3, 41, "Incremental search backward"); 1355 1356 f++; 1357 f->name = "keyboard-quit"; 1358 f->func = F_STARTOVER; 1359 f->desc = CSAVS(3, 42, "Clear line"); 1360 1361 f++; 1362 f->name = "kill-line"; 1363 f->func = F_KILLEND; 1364 f->desc = CSAVS(3, 43, "Cut to end of line and save in cut buffer"); 1365 1366 f++; 1367 f->name = "kill-region"; 1368 f->func = F_KILLREGION; 1369 f->desc = CSAVS(3, 44, 1370 "Cut area between mark and cursor and save in cut buffer"); 1371 1372 f++; 1373 f->name = "kill-whole-line"; 1374 f->func = F_KILLALL; 1375 f->desc = CSAVS(3, 45, "Cut the entire line and save in cut buffer"); 1376 1377 f++; 1378 f->name = "list-choices"; 1379 f->func = F_LIST_CHOICES; 1380 f->desc = CSAVS(3, 46, "List choices for completion"); 1381 1382 f++; 1383 f->name = "list-choices-raw"; 1384 f->func = F_LIST_ALL; 1385 f->desc = CSAVS(3, 47, 1386 "List choices for completion overriding programmable completion"); 1387 1388 f++; 1389 f->name = "list-glob"; 1390 f->func = F_LIST_GLOB; 1391 f->desc = CSAVS(3, 48, "List file name wildcard matches"); 1392 1393 f++; 1394 f->name = "list-or-eof"; 1395 f->func = F_LIST_EOF; 1396 f->desc = CSAVS(3, 49, 1397 "List choices for completion or indicate end of file if empty line"); 1398 1399 f++; 1400 f->name = "load-average"; 1401 f->func = F_LOAD_AVERAGE; 1402 f->desc = CSAVS(3, 50, "Display load average and current process status"); 1403 1404 f++; 1405 f->name = "magic-space"; 1406 f->func = F_MAGIC_SPACE; 1407 f->desc = CSAVS(3, 51, "Expand history escapes and insert a space"); 1408 1409 f++; 1410 f->name = "newline"; 1411 f->func = F_NEWLINE; 1412 f->desc = CSAVS(3, 52, "Execute command"); 1413 1414 f++; 1415 f->name = "newline-and-hold"; 1416 f->func = F_NEWLINE_HOLD; 1417 f->desc = CSAVS(3, 122, "Execute command and keep current line"); 1418 1419 f++; 1420 f->name = "newline-and-down-history"; 1421 f->func = F_NEWLINE_DOWN_HIST; 1422 f->desc = CSAVS(3, 123, "Execute command and move to next history line"); 1423 1424 f++; 1425 f->name = "normalize-path"; 1426 f->func = F_PATH_NORM; 1427 f->desc = CSAVS(3, 53, 1428 "Expand pathnames, eliminating leading .'s and ..'s"); 1429 1430 f++; 1431 f->name = "normalize-command"; 1432 f->func = F_COMMAND_NORM; 1433 f->desc = CSAVS(3, 54, 1434 "Expand commands to the resulting pathname or alias"); 1435 1436 f++; 1437 f->name = "overwrite-mode"; 1438 f->func = F_INSOVR; 1439 f->desc = CSAVS(3, 55, 1440 "Switch from insert to overwrite mode or vice versa"); 1441 1442 f++; 1443 f->name = "prefix-meta"; 1444 f->func = F_METANEXT; 1445 f->desc = CSAVS(3, 56, "Add 8th bit to next character typed"); 1446 1447 f++; 1448 f->name = "quoted-insert"; 1449 f->func = F_QUOTE; 1450 f->desc = CSAVS(3, 57, "Add the next character typed to the line verbatim"); 1451 1452 f++; 1453 f->name = "redisplay"; 1454 f->func = F_REDISP; 1455 f->desc = CSAVS(3, 58, "Redisplay everything"); 1456 1457 f++; 1458 f->name = "run-fg-editor"; 1459 f->func = F_RUN_FG_EDITOR; 1460 f->desc = CSAVS(3, 59, "Restart stopped editor"); 1461 1462 f++; 1463 f->name = "run-help"; 1464 f->func = F_HELPME; 1465 f->desc = CSAVS(3, 60, "Look for help on current command"); 1466 1467 f++; 1468 f->name = "self-insert-command"; 1469 f->func = F_INSERT; 1470 f->desc = CSAVS(3, 61, "This character is added to the line"); 1471 1472 f++; 1473 f->name = "sequence-lead-in"; 1474 f->func = F_XKEY; 1475 f->desc = CSAVS(3, 62, 1476 "This character is the first in a character sequence"); 1477 1478 f++; 1479 f->name = "set-mark-command"; 1480 f->func = F_SET_MARK; 1481 f->desc = CSAVS(3, 63, "Set the mark at cursor"); 1482 1483 f++; 1484 f->name = "spell-word"; 1485 f->func = F_CORRECT; 1486 f->desc = CSAVS(3, 64, "Correct the spelling of current word"); 1487 1488 f++; 1489 f->name = "spell-line"; 1490 f->func = F_CORRECT_L; 1491 f->desc = CSAVS(3, 65, "Correct the spelling of entire line"); 1492 1493 f++; 1494 f->name = "stuff-char"; 1495 f->func = F_STUFF_CHAR; 1496 f->desc = CSAVS(3, 66, "Send character to tty in cooked mode"); 1497 1498 f++; 1499 f->name = "toggle-literal-history"; 1500 f->func = F_TOGGLE_HIST; 1501 f->desc = CSAVS(3, 67, 1502 "Toggle between literal and lexical current history line"); 1503 1504 f++; 1505 f->name = "transpose-chars"; 1506 f->func = F_CHARSWITCH; 1507 f->desc = CSAVS(3, 68, 1508 "Exchange the character to the left of the cursor with the one under"); 1509 1510 f++; 1511 f->name = "transpose-gosling"; 1512 f->func = F_GCHARSWITCH; 1513 f->desc = CSAVS(3, 69, "Exchange the two characters before the cursor"); 1514 1515 f++; 1516 f->name = "tty-dsusp"; 1517 f->func = F_TTY_DSUSP; 1518 f->desc = CSAVS(3, 70, "Tty delayed suspend character"); 1519 1520 f++; 1521 f->name = "tty-flush-output"; 1522 f->func = F_TTY_FLUSHO; 1523 f->desc = CSAVS(3, 71, "Tty flush output character"); 1524 1525 f++; 1526 f->name = "tty-sigintr"; 1527 f->func = F_TTY_INT; 1528 f->desc = CSAVS(3, 72, "Tty interrupt character"); 1529 1530 f++; 1531 f->name = "tty-sigquit"; 1532 f->func = F_TTY_QUIT; 1533 f->desc = CSAVS(3, 73, "Tty quit character"); 1534 1535 f++; 1536 f->name = "tty-sigtsusp"; 1537 f->func = F_TTY_TSUSP; 1538 f->desc = CSAVS(3, 74, "Tty suspend character"); 1539 1540 f++; 1541 f->name = "tty-start-output"; 1542 f->func = F_TTY_STARTO; 1543 f->desc = CSAVS(3, 75, "Tty allow output character"); 1544 1545 f++; 1546 f->name = "tty-stop-output"; 1547 f->func = F_TTY_STOPO; 1548 f->desc = CSAVS(3, 76, "Tty disallow output character"); 1549 1550 f++; 1551 f->name = "undefined-key"; 1552 f->func = F_UNASSIGNED; 1553 f->desc = CSAVS(3, 77, "Indicates unbound character"); 1554 1555 f++; 1556 f->name = "universal-argument"; 1557 f->func = F_ARGFOUR; 1558 f->desc = CSAVS(3, 78, "Emacs universal argument (argument times 4)"); 1559 1560 f++; 1561 f->name = "up-history"; 1562 f->func = F_UP_HIST; 1563 f->desc = CSAVS(3, 79, "Move to previous history line"); 1564 1565 f++; 1566 f->name = "upcase-word"; 1567 f->func = F_CASEUPPER; 1568 f->desc = CSAVS(3, 80, 1569 "Uppercase the characters from cursor to end of current word"); 1570 1571 f++; 1572 f->name = "vi-beginning-of-next-word"; 1573 f->func = V_WORDBEGNEXT; 1574 f->desc = CSAVS(3, 81, "Vi goto the beginning of next word"); 1575 1576 f++; 1577 f->name = "vi-add"; 1578 f->func = V_ADD; 1579 f->desc = CSAVS(3, 82, "Vi enter insert mode after the cursor"); 1580 1581 f++; 1582 f->name = "vi-add-at-eol"; 1583 f->func = V_ADDEND; 1584 f->desc = CSAVS(3, 83, "Vi enter insert mode at end of line"); 1585 1586 f++; 1587 f->name = "vi-chg-case"; 1588 f->func = V_CHGCASE; 1589 f->desc = CSAVS(3, 84, 1590 "Vi change case of character under cursor and advance one character"); 1591 1592 f++; 1593 f->name = "vi-chg-meta"; 1594 f->func = V_CHGMETA; 1595 f->desc = CSAVS(3, 85, "Vi change prefix command"); 1596 1597 f++; 1598 f->name = "vi-chg-to-eol"; 1599 f->func = V_CHGTOEND; 1600 f->desc = CSAVS(3, 86, "Vi change to end of line"); 1601 1602 f++; 1603 f->name = "vi-cmd-mode"; 1604 f->func = V_CMD_MODE; 1605 f->desc = CSAVS(3, 87, 1606 "Enter vi command mode (use alternative key bindings)"); 1607 1608 f++; 1609 f->name = "vi-cmd-mode-complete"; 1610 f->func = V_CM_COMPLETE; 1611 f->desc = CSAVS(3, 88, "Vi command mode complete current word"); 1612 1613 f++; 1614 f->name = "vi-delprev"; 1615 f->func = V_DELPREV; 1616 f->desc = CSAVS(3, 89, "Vi move to previous character (backspace)"); 1617 1618 f++; 1619 f->name = "vi-delmeta"; 1620 f->func = V_DELMETA; 1621 f->desc = CSAVS(3, 90, "Vi delete prefix command"); 1622 1623 f++; 1624 f->name = "vi-endword"; 1625 f->func = V_ENDWORD; 1626 f->desc = CSAVS(3, 91, 1627 "Vi move to the end of the current space delimited word"); 1628 1629 f++; 1630 f->name = "vi-eword"; 1631 f->func = V_EWORD; 1632 f->desc = CSAVS(3, 92, "Vi move to the end of the current word"); 1633 1634 f++; 1635 f->name = "vi-char-back"; 1636 f->func = V_CHAR_BACK; 1637 f->desc = CSAVS(3, 93, "Vi move to the character specified backward"); 1638 1639 f++; 1640 f->name = "vi-char-fwd"; 1641 f->func = V_CHAR_FWD; 1642 f->desc = CSAVS(3, 94, "Vi move to the character specified forward"); 1643 1644 f++; 1645 f->name = "vi-charto-back"; 1646 f->func = V_CHARTO_BACK; 1647 f->desc = CSAVS(3, 95, "Vi move up to the character specified backward"); 1648 1649 f++; 1650 f->name = "vi-charto-fwd"; 1651 f->func = V_CHARTO_FWD; 1652 f->desc = CSAVS(3, 96, "Vi move up to the character specified forward"); 1653 1654 f++; 1655 f->name = "vi-insert"; 1656 f->func = V_INSERT; 1657 f->desc = CSAVS(3, 97, "Enter vi insert mode"); 1658 1659 f++; 1660 f->name = "vi-insert-at-bol"; 1661 f->func = V_INSBEG; 1662 f->desc = CSAVS(3, 98, "Enter vi insert mode at beginning of line"); 1663 1664 f++; 1665 f->name = "vi-repeat-char-fwd"; 1666 f->func = V_RCHAR_FWD; 1667 f->desc = CSAVS(3, 99, 1668 "Vi repeat current character search in the same search direction"); 1669 1670 f++; 1671 f->name = "vi-repeat-char-back"; 1672 f->func = V_RCHAR_BACK; 1673 f->desc = CSAVS(3, 100, 1674 "Vi repeat current character search in the opposite search direction"); 1675 1676 f++; 1677 f->name = "vi-repeat-search-fwd"; 1678 f->func = V_RSRCH_FWD; 1679 f->desc = CSAVS(3, 101, 1680 "Vi repeat current search in the same search direction"); 1681 1682 f++; 1683 f->name = "vi-repeat-search-back"; 1684 f->func = V_RSRCH_BACK; 1685 f->desc = CSAVS(3, 102, 1686 "Vi repeat current search in the opposite search direction"); 1687 1688 f++; 1689 f->name = "vi-replace-char"; 1690 f->func = V_REPLONE; 1691 f->desc = CSAVS(3, 103, 1692 "Vi replace character under the cursor with the next character typed"); 1693 1694 f++; 1695 f->name = "vi-replace-mode"; 1696 f->func = V_REPLMODE; 1697 f->desc = CSAVS(3, 104, "Vi replace mode"); 1698 1699 f++; 1700 f->name = "vi-search-back"; 1701 f->func = V_USH_META; 1702 f->desc = CSAVS(3, 105, "Vi search history backward"); 1703 1704 f++; 1705 f->name = "vi-search-fwd"; 1706 f->func = V_DSH_META; 1707 f->desc = CSAVS(3, 106, "Vi search history forward"); 1708 1709 f++; 1710 f->name = "vi-substitute-char"; 1711 f->func = V_SUBSTCHAR; 1712 f->desc = CSAVS(3, 107, 1713 "Vi replace character under the cursor and enter insert mode"); 1714 1715 f++; 1716 f->name = "vi-substitute-line"; 1717 f->func = V_SUBSTLINE; 1718 f->desc = CSAVS(3, 108, "Vi replace entire line"); 1719 1720 f++; 1721 f->name = "vi-word-back"; 1722 f->func = V_WORDBACK; 1723 f->desc = CSAVS(3, 109, "Vi move to the previous word"); 1724 1725 f++; 1726 f->name = "vi-word-fwd"; 1727 f->func = V_WORDFWD; 1728 f->desc = CSAVS(3, 110, "Vi move to the next word"); 1729 1730 f++; 1731 f->name = "vi-undo"; 1732 f->func = V_UNDO; 1733 f->desc = CSAVS(3, 111, "Vi undo last change"); 1734 1735 f++; 1736 f->name = "vi-zero"; 1737 f->func = V_ZERO; 1738 f->desc = CSAVS(3, 112, "Vi goto the beginning of line"); 1739 1740 f++; 1741 f->name = "which-command"; 1742 f->func = F_WHICH; 1743 f->desc = CSAVS(3, 113, "Perform which of current command"); 1744 1745 f++; 1746 f->name = "yank"; 1747 f->func = F_YANK_KILL; 1748 f->desc = CSAVS(3, 114, "Paste cut buffer at cursor position"); 1749 1750 f++; 1751 f->name = "yank-pop"; 1752 f->func = F_YANK_POP; 1753 f->desc = CSAVS(3, 115, 1754 "Replace just-yanked text with yank from earlier kill"); 1755 1756 f++; 1757 f->name = "e_copy_to_clipboard"; 1758 f->func = F_COPY_CLIP; 1759 f->desc = CSAVS(3, 116, 1760 "(WIN32 only) Copy cut buffer to system clipboard"); 1761 1762 f++; 1763 f->name = "e_paste_from_clipboard"; 1764 f->func = F_PASTE_CLIP; 1765 f->desc = CSAVS(3, 117, 1766 "(WIN32 only) Paste clipboard buffer at cursor position"); 1767 1768 f++; 1769 f->name = "e_dosify_next"; 1770 f->func = F_DOSIFY_NEXT; 1771 f->desc = CSAVS(3, 118, 1772 "(WIN32 only) Convert each '/' in next word to '\\\\'"); 1773 1774 f++; 1775 f->name = "e_dosify_prev"; 1776 f->func = F_DOSIFY_PREV; 1777 f->desc = CSAVS(3, 119, 1778 "(WIN32 only) Convert each '/' in previous word to '\\\\'"); 1779 1780 f++; 1781 f->name = "e_page_up"; 1782 f->func = F_PAGE_UP; 1783 f->desc = CSAVS(3, 120, "(WIN32 only) Page visible console window up"); 1784 1785 f++; 1786 f->name = "e_page_down"; 1787 f->func = F_PAGE_DOWN; 1788 f->desc = CSAVS(3, 121, "(WIN32 only) Page visible console window down"); 1789 1790 f++; 1791 f->name = NULL; 1792 f->func = 0; 1793 f->desc = NULL; 1794 1795 f++; 1796 if (f - FuncNames != F_NUM_FUNCNAMES) 1797 abort(); 1798 } 1799 1800 #ifdef DEBUG_EDIT 1801 void 1802 CheckMaps(void) 1803 { /* check the size of the key maps */ 1804 size_t c1 = NT_NUM_KEYS * sizeof(KEYCMD); 1805 1806 if (sizeof(CcKeyMap) != c1) 1807 xprintf("CcKeyMap should be %u entries, but is %zu.\r\n", 1808 NT_NUM_KEYS, sizeof(CcKeyMap) / sizeof(KEYCMD)); 1809 1810 if (sizeof(CcAltMap) != c1) 1811 xprintf("CcAltMap should be %u entries, but is %zu.\r\n", 1812 NT_NUM_KEYS, sizeof(CcAltMap) / sizeof(KEYCMD)); 1813 1814 if (sizeof(CcEmacsMap) != c1) 1815 xprintf("CcEmacsMap should be %u entries, but is %zu.\r\n", 1816 NT_NUM_KEYS, sizeof(CcEmacsMap) / sizeof(KEYCMD)); 1817 1818 if (sizeof(CcViMap) != c1) 1819 xprintf("CcViMap should be %u entries, but is %zu.\r\n", 1820 NT_NUM_KEYS, sizeof(CcViMap) / sizeof(KEYCMD)); 1821 1822 if (sizeof(CcViCmdMap) != c1) 1823 xprintf("CcViCmdMap should be %u entries, but is %zu.\r\n", 1824 NT_NUM_KEYS, sizeof(CcViCmdMap) / sizeof(KEYCMD)); 1825 } 1826 1827 #endif 1828 1829 int MapsAreInited = 0; 1830 int NLSMapsAreInited = 0; 1831 int NoNLSRebind; 1832 1833 void 1834 ed_InitNLSMaps(void) 1835 { 1836 int i; 1837 1838 if (AsciiOnly) 1839 return; 1840 if (NoNLSRebind) 1841 return; 1842 for (i = 0200; i <= 0377; i++) { 1843 if (Isprint(CTL_ESC(i))) { 1844 CcKeyMap[CTL_ESC(i)] = F_INSERT; 1845 } 1846 } 1847 NLSMapsAreInited = 1; 1848 } 1849 1850 static void 1851 ed_InitMetaBindings(void) 1852 { 1853 Char buf[3]; 1854 int i; 1855 CStr cstr; 1856 KEYCMD *map; 1857 1858 map = CcKeyMap; 1859 for (i = 0; i <= 0377 && CcKeyMap[CTL_ESC(i)] != F_METANEXT; i++) 1860 continue; 1861 if (i > 0377) { 1862 for (i = 0; i <= 0377 && CcAltMap[CTL_ESC(i)] != F_METANEXT; i++) 1863 continue; 1864 if (i > 0377) { 1865 i = '\033'; 1866 if (VImode) 1867 map = CcAltMap; 1868 } 1869 else { 1870 map = CcAltMap; 1871 } 1872 } 1873 buf[0] = (Char)CTL_ESC(i); 1874 buf[2] = 0; 1875 cstr.buf = buf; 1876 cstr.len = 2; 1877 for (i = 0200; i <= 0377; i++) { 1878 if (map[CTL_ESC(i)] != F_INSERT && map[CTL_ESC(i)] != F_UNASSIGNED && map[CTL_ESC(i)] != F_XKEY) { 1879 buf[1] = CTL_ESC(i & ASCII); 1880 AddXkey(&cstr, XmapCmd((int) map[CTL_ESC(i)]), XK_CMD); 1881 } 1882 } 1883 map[buf[0]] = F_XKEY; 1884 } 1885 1886 void 1887 ed_InitVIMaps(void) 1888 { 1889 int i; 1890 1891 VImode = 1; 1892 setNS(STRvimode); 1893 update_wordchars(); 1894 1895 ResetXmap(); 1896 for (i = 0; i < NT_NUM_KEYS; i++) { 1897 CcKeyMap[i] = CcViMap[i]; 1898 CcAltMap[i] = CcViCmdMap[i]; 1899 } 1900 ed_InitMetaBindings(); 1901 ed_InitNLSMaps(); 1902 ResetArrowKeys(); 1903 BindArrowKeys(); 1904 } 1905 1906 void 1907 ed_InitEmacsMaps(void) 1908 { 1909 int i; 1910 Char buf[3]; 1911 CStr cstr; 1912 cstr.buf = buf; 1913 cstr.len = 2; 1914 1915 VImode = 0; 1916 if (adrof(STRvimode)) 1917 unsetv(STRvimode); 1918 update_wordchars(); 1919 1920 ResetXmap(); 1921 for (i = 0; i < NT_NUM_KEYS; i++) { 1922 CcKeyMap[i] = CcEmacsMap[i]; 1923 CcAltMap[i] = F_UNASSIGNED; 1924 } 1925 ed_InitMetaBindings(); 1926 ed_InitNLSMaps(); 1927 buf[0] = CTL_ESC('\030'); 1928 buf[2] = 0; 1929 buf[1] = CTL_ESC('\030'); 1930 AddXkey(&cstr, XmapCmd(F_EXCHANGE_MARK), XK_CMD); 1931 buf[1] = '*'; 1932 AddXkey(&cstr, XmapCmd(F_EXPAND_GLOB), XK_CMD); 1933 buf[1] = '$'; 1934 AddXkey(&cstr, XmapCmd(F_EXPAND_VARS), XK_CMD); 1935 buf[1] = 'G'; 1936 AddXkey(&cstr, XmapCmd(F_LIST_GLOB), XK_CMD); 1937 buf[1] = 'g'; 1938 AddXkey(&cstr, XmapCmd(F_LIST_GLOB), XK_CMD); 1939 buf[1] = 'n'; 1940 AddXkey(&cstr, XmapCmd(F_PATH_NORM), XK_CMD); 1941 buf[1] = 'N'; 1942 AddXkey(&cstr, XmapCmd(F_PATH_NORM), XK_CMD); 1943 buf[1] = '?'; 1944 AddXkey(&cstr, XmapCmd(F_COMMAND_NORM), XK_CMD); 1945 buf[1] = '\t'; 1946 AddXkey(&cstr, XmapCmd(F_COMPLETE_ALL), XK_CMD); 1947 buf[1] = CTL_ESC('\004'); /* ^D */ 1948 AddXkey(&cstr, XmapCmd(F_LIST_ALL), XK_CMD); 1949 ResetArrowKeys(); 1950 BindArrowKeys(); 1951 } 1952 1953 void 1954 ed_InitMaps(void) 1955 { 1956 if (MapsAreInited) 1957 return; 1958 #ifndef IS_ASCII 1959 /* This machine has an EBCDIC charset. The assumptions made for the 1960 * initialized keymaps therefore don't hold, since they are based on 1961 * ASCII (or ISO8859-1). 1962 * Here, we do a one-time transformation to EBCDIC environment 1963 * for the key initializations. 1964 */ 1965 { 1966 KEYCMD temp[NT_NUM_KEYS]; 1967 static KEYCMD *const list[3] = { CcEmacsMap, CcViMap, CcViCmdMap }; 1968 int i, table; 1969 1970 for (table=0; table<3; ++table) 1971 { 1972 /* copy ASCII ordered map to temp table */ 1973 for (i = 0; i < NT_NUM_KEYS; i++) { 1974 temp[i] = list[table][i]; 1975 } 1976 /* write back as EBCDIC ordered map */ 1977 for (i = 0; i < NT_NUM_KEYS; i++) { 1978 list[table][_toebcdic[i]] = temp[i]; 1979 } 1980 } 1981 } 1982 #endif /* !IS_ASCII */ 1983 1984 #ifdef VIDEFAULT 1985 ed_InitVIMaps(); 1986 #else 1987 ed_InitEmacsMaps(); 1988 #endif 1989 1990 MapsAreInited = 1; 1991 } 1992