home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Shells / zsh-3.0.5-MIHS / src / Src / zle_bindings.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-28  |  21.3 KB  |  629 lines

  1. /*
  2.  * $Id: zle_bindings.c,v 2.6 1996/10/15 20:16:35 hzoli Exp $
  3.  *
  4.  * zle_bindings.c - commands and keymaps
  5.  *
  6.  * This file is part of zsh, the Z shell.
  7.  *
  8.  * Copyright (c) 1992-1996 Paul Falstad
  9.  * All rights reserved.
  10.  *
  11.  * Permission is hereby granted, without written agreement and without
  12.  * license or royalty fees, to use, copy, modify, and distribute this
  13.  * software and to distribute modified versions of this software for any
  14.  * purpose, provided that the above copyright notice and the following
  15.  * two paragraphs appear in all copies of this software.
  16.  *
  17.  * In no event shall Paul Falstad or the Zsh Development Group be liable
  18.  * to any party for direct, indirect, special, incidental, or consequential
  19.  * damages arising out of the use of this software and its documentation,
  20.  * even if Paul Falstad and the Zsh Development Group have been advised of
  21.  * the possibility of such damage.
  22.  *
  23.  * Paul Falstad and the Zsh Development Group specifically disclaim any
  24.  * warranties, including, but not limited to, the implied warranties of
  25.  * merchantability and fitness for a particular purpose.  The software
  26.  * provided hereunder is on an "as is" basis, and Paul Falstad and the
  27.  * Zsh Development Group have no obligation to provide maintenance,
  28.  * support, updates, enhancements, or modifications.
  29.  *
  30.  */
  31.  
  32. #define ZLE
  33. #include "zsh.h"
  34.  
  35. struct zlecmd zlecmds[] =
  36. {
  37.     {"accept-and-hold", acceptandhold, 0},
  38.     {"accept-and-infer-next-history", acceptandinfernexthistory, 0},
  39.     {"accept-and-menu-complete", acceptandmenucomplete, ZLE_MENUCMP},
  40.     {"accept-line", acceptline, 0},
  41.     {"accept-line-and-down-history", acceptlineanddownhistory, 0},
  42.     {"backward-char", backwardchar, ZLE_MOVEMENT},
  43.     {"backward-delete-char", backwarddeletechar, ZLE_DELETE},
  44.     {"backward-delete-word", backwarddeleteword, ZLE_DELETE},
  45.     {"backward-kill-line", backwardkillline, ZLE_KILL},
  46.     {"backward-kill-word", backwardkillword, ZLE_KILL | ZLE_DELETE},
  47.     {"backward-word", backwardword, ZLE_MOVEMENT},
  48.     {"beginning-of-buffer-or-history", beginningofbufferorhistory, ZLE_MOVEMENT},
  49.     {"beginning-of-history", beginningofhistory, 0},
  50.     {"beginning-of-line", beginningofline, ZLE_MOVEMENT},
  51.     {"beginning-of-line-hist", beginningoflinehist, ZLE_MOVEMENT},
  52.     {"capitalize-word", capitalizeword, 0},
  53.     {"clear-screen", clearscreen, ZLE_MENUCMP},
  54.     {"complete-word", completeword, ZLE_MENUCMP},
  55.     {"copy-prev-word", copyprevword, 0},
  56.     {"copy-region-as-kill", copyregionaskill, ZLE_KILL},
  57.     {"delete-char", deletechar, ZLE_DELETE},
  58.     {"delete-char-or-list", deletecharorlist, ZLE_MENUCMP},
  59.     {"delete-word", deleteword, ZLE_DELETE},
  60.     {"describe-key-briefly", describekeybriefly, ZLE_MENUCMP},
  61.     {"digit-argument", digitargument, ZLE_DIGIT | ZLE_ARG | ZLE_MENUCMP},
  62.     {"down-case-word", downcaseword, 0},
  63.     {"down-history", downhistory, 0},
  64.     {"down-line-or-history", downlineorhistory, ZLE_MOVEMENT | ZLE_LINEMOVE},
  65.     {"down-line-or-search", downlineorsearch, ZLE_MOVEMENT | ZLE_LINEMOVE | ZLE_HISTSEARCH},
  66.     {"emacs-backward-word", emacsbackwardword, ZLE_MOVEMENT},
  67.     {"emacs-forward-word", emacsforwardword, ZLE_MOVEMENT},
  68.     {"end-of-buffer-or-history", endofbufferorhistory, ZLE_MOVEMENT},
  69.     {"end-of-history", endofhistory, 0},
  70.     {"end-of-line", endofline, ZLE_MOVEMENT},
  71.     {"end-of-line-hist", endoflinehist, ZLE_MOVEMENT},
  72.     {"exchange-point-and-mark", exchangepointandmark, ZLE_MOVEMENT},
  73.     {"execute-last-named-cmd", (F) 0, 0},
  74.     {"execute-named-cmd", (F) 0, 0},
  75.     {"expand-cmd-path", expandcmdpath, 0},
  76.     {"expand-history", expandhistory, 0},
  77.     {"expand-or-complete", expandorcomplete, ZLE_MENUCMP},
  78.     {"expand-or-complete-prefix", expandorcompleteprefix, ZLE_MENUCMP},
  79.     {"expand-word", expandword, 0},
  80.     {"forward-char", forwardchar, ZLE_MOVEMENT},
  81.     {"forward-word", forwardword, ZLE_MOVEMENT},
  82.     {"get-line", getline, 0},
  83.     {"gosmacs-transpose-chars", gosmacstransposechars, 0},
  84.     {"history-beginning-search-backward", historybeginningsearchbackward, ZLE_HISTSEARCH},
  85.     {"history-beginning-search-forward", historybeginningsearchforward, ZLE_HISTSEARCH},
  86.     {"history-incremental-search-backward", historyincrementalsearchbackward, 0},
  87.     {"history-incremental-search-forward", historyincrementalsearchforward, 0},
  88.     {"history-search-backward", historysearchbackward, ZLE_HISTSEARCH},
  89.     {"history-search-forward", historysearchforward, ZLE_HISTSEARCH},
  90.     {"infer-next-history", infernexthistory, 0},
  91.     {"insert-last-word", insertlastword, ZLE_INSERT},
  92.     {"kill-buffer", killbuffer, ZLE_KILL},
  93.     {"kill-line", killline, ZLE_KILL},
  94.     {"kill-region", killregion, ZLE_KILL},
  95.     {"kill-whole-line", killwholeline, ZLE_KILL},
  96.     {"kill-word", killword, ZLE_KILL},
  97.     {"list-choices", listchoices, ZLE_MENUCMP},
  98.     {"list-expand", listexpand, ZLE_MENUCMP},
  99.     {"magic-space", magicspace, 0},
  100.     {"menu-complete", menucomplete, ZLE_MENUCMP},
  101.     {"menu-expand-or-complete", menuexpandorcomplete, ZLE_MENUCMP},
  102.     {"neg-argument", negargument, ZLE_NEGARG | ZLE_ARG | ZLE_MENUCMP},
  103.     {"overwrite-mode", overwritemode, 0},
  104.     {"pound-insert", poundinsert, 0},
  105.     {"prefix", (F) 0, 0},
  106.     {"push-input", pushinput, 0},
  107.     {"push-line", pushline, 0},
  108.     {"push-line-or-edit", pushlineoredit, 0},
  109.     {"quoted-insert", quotedinsert, ZLE_INSERT},
  110.     {"quote-line", quoteline, 0},
  111.     {"quote-region", quoteregion, 0},
  112.     {"redisplay", redisplay, ZLE_MENUCMP},
  113.     {"reverse-menu-complete", reversemenucomplete, ZLE_MENUCMP},
  114.     {"run-help", processcmd, ZLE_MENUCMP},
  115.     {"self-insert", selfinsert, ZLE_INSERT},
  116.     {"self-insert-unmeta", selfinsertunmeta, ZLE_INSERT},
  117.     {"send-break", sendbreak, 0},
  118.     {"send-string", sendstring, 0},
  119.     {"set-mark-command", setmarkcommand, ZLE_MENUCMP},
  120.     {"spell-word", spellword, 0},
  121.     {"transpose-chars", transposechars, 0},
  122.     {"transpose-words", transposewords, 0},
  123.     {"undefined-key", undefinedkey, 0},
  124.     {"undo", undo, ZLE_UNDO},
  125.     {"universal-argument", universalargument, ZLE_ARG | ZLE_MENUCMP},
  126.     {"up-case-word", upcaseword, 0},
  127.     {"up-history", uphistory, 0},
  128.     {"up-line-or-history", uplineorhistory, ZLE_LINEMOVE | ZLE_MOVEMENT},
  129.     {"up-line-or-search", uplineorsearch, ZLE_MOVEMENT | ZLE_LINEMOVE | ZLE_HISTSEARCH},
  130.     {"vi-add-eol", viaddeol, 0},
  131.     {"vi-add-next", viaddnext, 0},
  132.     {"vi-backward-blank-word", vibackwardblankword, ZLE_MOVEMENT},
  133.     {"vi-backward-char", vibackwardchar, ZLE_MOVEMENT},
  134.     {"vi-backward-delete-char", vibackwarddeletechar, ZLE_DELETE},
  135.     {"vi-backward-kill-word", vibackwardkillword, ZLE_KILL},
  136.     {"vi-backward-word", vibackwardword, ZLE_MOVEMENT},
  137.     {"vi-beginning-of-line", vibeginningofline, ZLE_MOVEMENT},
  138.     {"vi-caps-lock-panic", vicapslockpanic, 0},
  139.     {"vi-change", vichange, 0},
  140.     {"vi-change-eol", vichangeeol, 0},
  141.     {"vi-change-whole-line", vichangewholeline, 0},
  142.     {"vi-cmd-mode", vicmdmode, 0},
  143.     {"vi-delete", videlete, ZLE_KILL},
  144.     {"vi-delete-char", videletechar, ZLE_DELETE},
  145.     {"vi-digit-or-beginning-of-line", (F) 0, 0},
  146.     {"vi-down-line-or-history", vidownlineorhistory, ZLE_LINEMOVE | ZLE_MOVEMENT},
  147.     {"vi-end-of-line", viendofline, ZLE_MOVEMENT},
  148.     {"vi-fetch-history", vifetchhistory, 0},
  149.     {"vi-find-next-char", vifindnextchar, ZLE_MOVEMENT},
  150.     {"vi-find-next-char-skip", vifindnextcharskip, ZLE_MOVEMENT},
  151.     {"vi-find-prev-char", vifindprevchar, ZLE_MOVEMENT},
  152.     {"vi-find-prev-char-skip", vifindprevcharskip, ZLE_MOVEMENT},
  153.     {"vi-first-non-blank", vifirstnonblank, ZLE_MOVEMENT},
  154.     {"vi-forward-blank-word", viforwardblankword, ZLE_MOVEMENT},
  155.     {"vi-forward-blank-word-end", viforwardblankwordend, ZLE_MOVEMENT},
  156.     {"vi-forward-char", viforwardchar, ZLE_MOVEMENT},
  157.     {"vi-forward-word", viforwardword, ZLE_MOVEMENT},
  158.     {"vi-forward-word-end", viforwardwordend, ZLE_MOVEMENT},
  159.     {"vi-goto-column", vigotocolumn, ZLE_MOVEMENT},
  160.     {"vi-goto-mark", vigotomark, ZLE_MOVEMENT},
  161.     {"vi-goto-mark-line", vigotomarkline, ZLE_MOVEMENT},
  162.     {"vi-history-search-backward", vihistorysearchbackward, 0},
  163.     {"vi-history-search-forward", vihistorysearchforward, 0},
  164.     {"vi-indent", viindent, 0},
  165.     {"vi-insert", viinsert, 0},
  166.     {"vi-insert-bol", viinsertbol, 0},
  167.     {"vi-join", vijoin, 0},
  168.     {"vi-kill-eol", vikilleol, ZLE_KILL},
  169.     {"vi-kill-line", vikillline, ZLE_KILL},
  170.     {"vi-match-bracket", vimatchbracket, ZLE_MOVEMENT},
  171.     {"vi-open-line-above", viopenlineabove, 0},
  172.     {"vi-open-line-below", viopenlinebelow, 0},
  173.     {"vi-oper-swap-case", vioperswapcase, 0},
  174.     {"vi-pound-insert", vipoundinsert, 0},
  175.     {"vi-put-after", viputafter, ZLE_YANK},
  176.     {"vi-put-before", viputbefore, ZLE_YANK},
  177.     {"vi-quoted-insert", viquotedinsert, ZLE_INSERT},
  178.     {"vi-repeat-change", virepeatchange, 0},
  179.     {"vi-repeat-find", virepeatfind, ZLE_MOVEMENT},
  180.     {"vi-repeat-search", virepeatsearch, ZLE_MOVEMENT},
  181.     {"vi-replace", vireplace, 0},
  182.     {"vi-replace-chars", vireplacechars, 0},
  183.     {"vi-rev-repeat-find", virevrepeatfind, ZLE_MOVEMENT},
  184.     {"vi-rev-repeat-search", virevrepeatsearch, ZLE_MOVEMENT},
  185.     {"vi-set-buffer", visetbuffer, ZLE_ARG | ZLE_MENUCMP},
  186.     {"vi-set-mark", visetmark, ZLE_MENUCMP},
  187.     {"vi-substitute", visubstitute, 0},
  188.     {"vi-swap-case", viswapcase, 0},
  189.     {"vi-undo-change", undo, 0},
  190.     {"vi-unindent", viunindent, 0},
  191.     {"vi-up-line-or-history", viuplineorhistory, ZLE_LINEMOVE | ZLE_MOVEMENT},
  192.     {"vi-yank", viyank, 0},
  193.     {"vi-yank-eol", viyankeol, 0},
  194.     {"vi-yank-whole-line", viyankwholeline, 0},
  195.     {"where-is", whereis, ZLE_MENUCMP},
  196.     {"which-command", processcmd, ZLE_MENUCMP},
  197.     {"yank", yank, ZLE_YANK},
  198.     {"yank-pop", yankpop, ZLE_YANK},
  199.     {"", (F) 0, 0}
  200. };
  201.  
  202. int emacsbind[256] =
  203. {
  204.     /* ^@ */ z_setmarkcommand,
  205.     /* ^A */ z_beginningofline,
  206.     /* ^B */ z_backwardchar,
  207.     /* ^C */ z_undefinedkey,
  208.     /* ^D */ z_deletecharorlist,
  209.     /* ^E */ z_endofline,
  210.     /* ^F */ z_forwardchar,
  211.     /* ^G */ z_sendbreak,
  212.     /* ^H */ z_backwarddeletechar,
  213.     /* ^I */ z_expandorcomplete,
  214.     /* ^J */ z_acceptline,
  215.     /* ^K */ z_killline,
  216.     /* ^L */ z_clearscreen,
  217.     /* ^M */ z_acceptline,
  218.     /* ^N */ z_downlineorhistory,
  219.     /* ^O */ z_acceptlineanddownhistory,
  220.     /* ^P */ z_uplineorhistory,
  221.     /* ^Q */ z_pushline,
  222.     /* ^R */ z_historyincrementalsearchbackward,
  223.     /* ^S */ z_historyincrementalsearchforward,
  224.     /* ^T */ z_transposechars,
  225.     /* ^U */ z_killwholeline,
  226.     /* ^V */ z_quotedinsert,
  227.     /* ^W */ z_backwardkillword,
  228.     /* ^X */ z_prefix,
  229.     /* ^Y */ z_yank,
  230.     /* ^Z */ z_undefinedkey,
  231.     /* ^[ */ z_prefix,
  232.     /* ^\ */ z_undefinedkey,
  233.     /* ^] */ z_undefinedkey,
  234.     /* ^^ */ z_undefinedkey,
  235.     /* ^_ */ z_undo,
  236.     /*   */ z_selfinsert,
  237.     /* ! */ z_selfinsert,
  238.     /* " */ z_selfinsert,
  239.     /* # */ z_selfinsert,
  240.     /* $ */ z_selfinsert,
  241.     /* % */ z_selfinsert,
  242.     /* & */ z_selfinsert,
  243.     /* ' */ z_selfinsert,
  244.     /* ( */ z_selfinsert,
  245.     /* ) */ z_selfinsert,
  246.     /* * */ z_selfinsert,
  247.     /* + */ z_selfinsert,
  248.     /* , */ z_selfinsert,
  249.     /* - */ z_selfinsert,
  250.     /* . */ z_selfinsert,
  251.     /* / */ z_selfinsert,
  252.     /* 0 */ z_selfinsert,
  253.     /* 1 */ z_selfinsert,
  254.     /* 2 */ z_selfinsert,
  255.     /* 3 */ z_selfinsert,
  256.     /* 4 */ z_selfinsert,
  257.     /* 5 */ z_selfinsert,
  258.     /* 6 */ z_selfinsert,
  259.     /* 7 */ z_selfinsert,
  260.     /* 8 */ z_selfinsert,
  261.     /* 9 */ z_selfinsert,
  262.     /* : */ z_selfinsert,
  263.     /* ; */ z_selfinsert,
  264.     /* < */ z_selfinsert,
  265.     /* = */ z_selfinsert,
  266.     /* > */ z_selfinsert,
  267.     /* ? */ z_selfinsert,
  268.     /* @ */ z_selfinsert,
  269.     /* A */ z_selfinsert,
  270.     /* B */ z_selfinsert,
  271.     /* C */ z_selfinsert,
  272.     /* D */ z_selfinsert,
  273.     /* E */ z_selfinsert,
  274.     /* F */ z_selfinsert,
  275.     /* G */ z_selfinsert,
  276.     /* H */ z_selfinsert,
  277.     /* I */ z_selfinsert,
  278.     /* J */ z_selfinsert,
  279.     /* K */ z_selfinsert,
  280.     /* L */ z_selfinsert,
  281.     /* M */ z_selfinsert,
  282.     /* N */ z_selfinsert,
  283.     /* O */ z_selfinsert,
  284.     /* P */ z_selfinsert,
  285.     /* Q */ z_selfinsert,
  286.     /* R */ z_selfinsert,
  287.     /* S */ z_selfinsert,
  288.     /* T */ z_selfinsert,
  289.     /* U */ z_selfinsert,
  290.     /* V */ z_selfinsert,
  291.     /* W */ z_selfinsert,
  292.     /* X */ z_selfinsert,
  293.     /* Y */ z_selfinsert,
  294.     /* Z */ z_selfinsert,
  295.     /* [ */ z_selfinsert,
  296.     /* \ */ z_selfinsert,
  297.     /* ] */ z_selfinsert,
  298.     /* ^ */ z_selfinsert,
  299.     /* _ */ z_selfinsert,
  300.     /* ` */ z_selfinsert,
  301.     /* a */ z_selfinsert,
  302.     /* b */ z_selfinsert,
  303.     /* c */ z_selfinsert,
  304.     /* d */ z_selfinsert,
  305.     /* e */ z_selfinsert,
  306.     /* f */ z_selfinsert,
  307.     /* g */ z_selfinsert,
  308.     /* h */ z_selfinsert,
  309.     /* i */ z_selfinsert,
  310.     /* j */ z_selfinsert,
  311.     /* k */ z_selfinsert,
  312.     /* l */ z_selfinsert,
  313.     /* m */ z_selfinsert,
  314.     /* n */ z_selfinsert,
  315.     /* o */ z_selfinsert,
  316.     /* p */ z_selfinsert,
  317.     /* q */ z_selfinsert,
  318.     /* r */ z_selfinsert,
  319.     /* s */ z_selfinsert,
  320.     /* t */ z_selfinsert,
  321.     /* u */ z_selfinsert,
  322.     /* v */ z_selfinsert,
  323.     /* w */ z_selfinsert,
  324.     /* x */ z_selfinsert,
  325.     /* y */ z_selfinsert,
  326.     /* z */ z_selfinsert,
  327.     /* { */ z_selfinsert,
  328.     /* | */ z_selfinsert,
  329.     /* } */ z_selfinsert,
  330.     /* ~ */ z_selfinsert,
  331.     /* ^? */ z_backwarddeletechar,
  332.     /* M-^@ */ z_undefinedkey,
  333.     /* M-^A */ z_undefinedkey,
  334.     /* M-^B */ z_undefinedkey,
  335.     /* M-^C */ z_undefinedkey,
  336.     /* M-^D */ z_listchoices,
  337.     /* M-^E */ z_undefinedkey,
  338.     /* M-^F */ z_undefinedkey,
  339.     /* M-^G */ z_sendbreak,
  340.     /* M-^H */ z_backwardkillword,
  341.     /* M-^I */ z_selfinsertunmeta,
  342.     /* M-^J */ z_selfinsertunmeta,
  343.     /* M-^K */ z_undefinedkey,
  344.     /* M-^L */ z_clearscreen,
  345.     /* M-^M */ z_selfinsertunmeta,
  346.     /* M-^N */ z_undefinedkey,
  347.     /* M-^O */ z_undefinedkey,
  348.     /* M-^P */ z_undefinedkey,
  349.     /* M-^Q */ z_undefinedkey,
  350.     /* M-^R */ z_undefinedkey,
  351.     /* M-^S */ z_undefinedkey,
  352.     /* M-^T */ z_undefinedkey,
  353.     /* M-^U */ z_undefinedkey,
  354.     /* M-^V */ z_undefinedkey,
  355.     /* M-^W */ z_undefinedkey,
  356.     /* M-^X */ z_undefinedkey,
  357.     /* M-^Y */ z_undefinedkey,
  358.     /* M-^Z */ z_undefinedkey,
  359.     /* M-^[ */ z_undefinedkey,
  360.     /* M-^\ */ z_undefinedkey,
  361.     /* M-^] */ z_undefinedkey,
  362.     /* M-^^ */ z_undefinedkey,
  363.     /* M-^_ */ z_copyprevword,
  364.     /* M-  */ z_expandhistory,
  365.     /* M-! */ z_expandhistory,
  366.     /* M-" */ z_quoteregion,
  367.     /* M-# */ z_undefinedkey,
  368.     /* M-$ */ z_spellword,
  369.     /* M-% */ z_undefinedkey,
  370.     /* M-& */ z_undefinedkey,
  371.     /* M-' */ z_quoteline,
  372.     /* M-( */ z_undefinedkey,
  373.     /* M-) */ z_undefinedkey,
  374.     /* M-* */ z_undefinedkey,
  375.     /* M-+ */ z_undefinedkey,
  376.     /* M-, */ z_undefinedkey,
  377.     /* M-- */ z_negargument,
  378.     /* M-. */ z_insertlastword,
  379.     /* M-/ */ z_undefinedkey,
  380.     /* M-0 */ z_digitargument,
  381.     /* M-1 */ z_digitargument,
  382.     /* M-2 */ z_digitargument,
  383.     /* M-3 */ z_digitargument,
  384.     /* M-4 */ z_digitargument,
  385.     /* M-5 */ z_digitargument,
  386.     /* M-6 */ z_digitargument,
  387.     /* M-7 */ z_digitargument,
  388.     /* M-8 */ z_digitargument,
  389.     /* M-9 */ z_digitargument,
  390.     /* M-: */ z_undefinedkey,
  391.     /* M-; */ z_undefinedkey,
  392.     /* M-< */ z_beginningofbufferorhistory,
  393.     /* M-= */ z_undefinedkey,
  394.     /* M-> */ z_endofbufferorhistory,
  395.     /* M-? */ z_whichcommand,
  396.     /* M-@ */ z_undefinedkey,
  397.     /* M-A */ z_acceptandhold,
  398.     /* M-B */ z_backwardword,
  399.     /* M-C */ z_capitalizeword,
  400.     /* M-D */ z_killword,
  401.     /* M-E */ z_undefinedkey,
  402.     /* M-F */ z_forwardword,
  403.     /* M-G */ z_getline,
  404.     /* M-H */ z_runhelp,
  405.     /* M-I */ z_undefinedkey,
  406.     /* M-J */ z_undefinedkey,
  407.     /* M-K */ z_undefinedkey,
  408.     /* M-L */ z_downcaseword,
  409.     /* M-M */ z_undefinedkey,
  410.     /* M-N */ z_historysearchforward,
  411.     /* M-O */ z_undefinedkey,
  412.     /* M-P */ z_historysearchbackward,
  413.     /* M-Q */ z_pushline,
  414.     /* M-R */ z_undefinedkey,
  415.     /* M-S */ z_spellword,
  416.     /* M-T */ z_transposewords,
  417.     /* M-U */ z_upcaseword,
  418.     /* M-V */ z_undefinedkey,
  419.     /* M-W */ z_copyregionaskill,
  420.     /* M-X */ z_undefinedkey,
  421.     /* M-Y */ z_undefinedkey,
  422.     /* M-Z */ z_undefinedkey,
  423.     /* M-[ */ z_undefinedkey,
  424.     /* M-\ */ z_undefinedkey,
  425.     /* M-] */ z_undefinedkey,
  426.     /* M-^ */ z_undefinedkey,
  427.     /* M-_ */ z_insertlastword,
  428.     /* M-` */ z_undefinedkey,
  429.     /* M-a */ z_acceptandhold,
  430.     /* M-b */ z_backwardword,
  431.     /* M-c */ z_capitalizeword,
  432.     /* M-d */ z_killword,
  433.     /* M-e */ z_undefinedkey,
  434.     /* M-f */ z_forwardword,
  435.     /* M-g */ z_getline,
  436.     /* M-h */ z_runhelp,
  437.     /* M-i */ z_undefinedkey,
  438.     /* M-j */ z_undefinedkey,
  439.     /* M-k */ z_undefinedkey,
  440.     /* M-l */ z_downcaseword,
  441.     /* M-m */ z_undefinedkey,
  442.     /* M-n */ z_historysearchforward,
  443.     /* M-o */ z_undefinedkey,
  444.     /* M-p */ z_historysearchbackward,
  445.     /* M-q */ z_pushline,
  446.     /* M-r */ z_undefinedkey,
  447.     /* M-s */ z_spellword,
  448.     /* M-t */ z_transposewords,
  449.     /* M-u */ z_upcaseword,
  450.     /* M-v */ z_undefinedkey,
  451.     /* M-w */ z_copyregionaskill,
  452.     /* M-x */ z_executenamedcmd,
  453.     /* M-y */ z_yankpop,
  454.     /* M-z */ z_executelastnamedcmd,
  455.     /* M-{ */ z_undefinedkey,
  456.     /* M-| */ z_vigotocolumn,
  457.     /* M-} */ z_undefinedkey,
  458.     /* M-~ */ z_undefinedkey,
  459.     /* M-^? */ z_backwardkillword,
  460. };
  461.  
  462. int viinsbind[32] =
  463. {
  464.     /* ^@ */ z_undefinedkey,
  465.     /* ^A */ z_selfinsert,
  466.     /* ^B */ z_selfinsert,
  467.     /* ^C */ z_selfinsert,
  468.     /* ^D */ z_listchoices,
  469.     /* ^E */ z_selfinsert,
  470.     /* ^F */ z_selfinsert,
  471.     /* ^G */ z_listexpand,
  472.     /* ^H */ z_vibackwarddeletechar,
  473.     /* ^I */ z_expandorcomplete,
  474.     /* ^J */ z_acceptline,
  475.     /* ^K */ z_selfinsert,
  476.     /* ^L */ z_clearscreen,
  477.     /* ^M */ z_acceptline,
  478.     /* ^N */ z_selfinsert,
  479.     /* ^O */ z_selfinsert,
  480.     /* ^P */ z_selfinsert,
  481.     /* ^Q */ z_viquotedinsert,
  482.     /* ^R */ z_redisplay,
  483.     /* ^S */ z_selfinsert,
  484.     /* ^T */ z_selfinsert,
  485.     /* ^U */ z_vikillline,
  486.     /* ^V */ z_viquotedinsert,
  487.     /* ^W */ z_vibackwardkillword,
  488.     /* ^X */ z_selfinsert,
  489.     /* ^Y */ z_selfinsert,
  490.     /* ^Z */ z_selfinsert,
  491.     /* ^[ */ z_prefix,
  492.     /* ^\ */ z_selfinsert,
  493.     /* ^] */ z_selfinsert,
  494.     /* ^^ */ z_selfinsert,
  495.     /* ^_ */ z_selfinsert,
  496. };
  497.  
  498. int vicmdbind[128] =
  499. {
  500.     /* ^@ */ z_undefinedkey,
  501.     /* ^A */ z_undefinedkey,
  502.     /* ^B */ z_undefinedkey,
  503.     /* ^C */ z_undefinedkey,
  504.     /* ^D */ z_listchoices,
  505.     /* ^E */ z_undefinedkey,
  506.     /* ^F */ z_undefinedkey,
  507.     /* ^G */ z_listexpand,
  508.     /* ^H */ z_vibackwardchar,
  509.     /* ^I */ z_undefinedkey,
  510.     /* ^J */ z_acceptline,
  511.     /* ^K */ z_undefinedkey,
  512.     /* ^L */ z_clearscreen,
  513.     /* ^M */ z_acceptline,
  514.     /* ^N */ z_downhistory,
  515.     /* ^O */ z_undefinedkey,
  516.     /* ^P */ z_uphistory,
  517.     /* ^Q */ z_undefinedkey,
  518.     /* ^R */ z_redisplay,
  519.     /* ^S */ z_undefinedkey,
  520.     /* ^T */ z_undefinedkey,
  521.     /* ^U */ z_undefinedkey,
  522.     /* ^V */ z_undefinedkey,
  523.     /* ^W */ z_undefinedkey,
  524.     /* ^X */ z_undefinedkey,
  525.     /* ^Y */ z_undefinedkey,
  526.     /* ^Z */ z_undefinedkey,
  527.     /* ^[ */ z_prefix,
  528.     /* ^\ */ z_undefinedkey,
  529.     /* ^] */ z_undefinedkey,
  530.     /* ^^ */ z_undefinedkey,
  531.     /* ^_ */ z_undefinedkey,
  532.     /*   */ z_viforwardchar,
  533.     /* ! */ z_undefinedkey,
  534.     /* " */ z_visetbuffer,
  535.     /* # */ z_poundinsert,
  536.     /* $ */ z_viendofline,
  537.     /* % */ z_vimatchbracket,
  538.     /* & */ z_undefinedkey,
  539.     /* ' */ z_vigotomarkline,
  540.     /* ( */ z_undefinedkey,
  541.     /* ) */ z_undefinedkey,
  542.     /* * */ z_undefinedkey,
  543.     /* + */ z_vidownlineorhistory,
  544.     /* , */ z_virevrepeatfind,
  545.     /* - */ z_viuplineorhistory,
  546.     /* . */ z_virepeatchange,
  547.     /* / */ z_vihistorysearchbackward,
  548.     /* 0 */ z_vidigitorbeginningofline,
  549.     /* 1 */ z_digitargument,
  550.     /* 2 */ z_digitargument,
  551.     /* 3 */ z_digitargument,
  552.     /* 4 */ z_digitargument,
  553.     /* 5 */ z_digitargument,
  554.     /* 6 */ z_digitargument,
  555.     /* 7 */ z_digitargument,
  556.     /* 8 */ z_digitargument,
  557.     /* 9 */ z_digitargument,
  558.     /* : */ z_undefinedkey,
  559.     /* ; */ z_virepeatfind,
  560.     /* < */ z_viunindent,
  561.     /* = */ z_listchoices,
  562.     /* > */ z_viindent,
  563.     /* ? */ z_vihistorysearchforward,
  564.     /* @ */ z_undefinedkey,
  565.     /* A */ z_viaddeol,
  566.     /* B */ z_vibackwardblankword,
  567.     /* C */ z_vichangeeol,
  568.     /* D */ z_vikilleol,
  569.     /* E */ z_viforwardblankwordend,
  570.     /* F */ z_vifindprevchar,
  571.     /* G */ z_vifetchhistory,
  572.     /* H */ z_undefinedkey,
  573.     /* I */ z_viinsertbol,
  574.     /* J */ z_vijoin,
  575.     /* K */ z_undefinedkey,
  576.     /* L */ z_undefinedkey,
  577.     /* M */ z_undefinedkey,
  578.     /* N */ z_virevrepeatsearch,
  579.     /* O */ z_viopenlineabove,
  580.     /* P */ z_viputbefore,
  581.     /* Q */ z_undefinedkey,
  582.     /* R */ z_vireplace,
  583.     /* S */ z_vichangewholeline,
  584.     /* T */ z_vifindprevcharskip,
  585.     /* U */ z_undefinedkey,
  586.     /* V */ z_undefinedkey,
  587.     /* W */ z_viforwardblankword,
  588.     /* X */ z_vibackwarddeletechar,
  589.     /* Y */ z_viyankwholeline,
  590.     /* Z */ z_undefinedkey,
  591.     /* [ */ z_undefinedkey,
  592.     /* \ */ z_undefinedkey,
  593.     /* ] */ z_undefinedkey,
  594.     /* ^ */ z_vifirstnonblank,
  595.     /* _ */ z_undefinedkey,
  596.     /* ` */ z_vigotomark,
  597.     /* a */ z_viaddnext,
  598.     /* b */ z_vibackwardword,
  599.     /* c */ z_vichange,
  600.     /* d */ z_videlete,
  601.     /* e */ z_viforwardwordend,
  602.     /* f */ z_vifindnextchar,
  603.     /* g */ z_undefinedkey,
  604.     /* h */ z_vibackwardchar,
  605.     /* i */ z_viinsert,
  606.     /* j */ z_downlineorhistory,
  607.     /* k */ z_uplineorhistory,
  608.     /* l */ z_viforwardchar,
  609.     /* m */ z_visetmark,
  610.     /* n */ z_virepeatsearch,
  611.     /* o */ z_viopenlinebelow,
  612.     /* p */ z_viputafter,
  613.     /* q */ z_undefinedkey,
  614.     /* r */ z_vireplacechars,
  615.     /* s */ z_visubstitute,
  616.     /* t */ z_vifindnextcharskip,
  617.     /* u */ z_viundochange,
  618.     /* v */ z_undefinedkey,
  619.     /* w */ z_viforwardword,
  620.     /* x */ z_videletechar,
  621.     /* y */ z_viyank,
  622.     /* z */ z_undefinedkey,
  623.     /* { */ z_undefinedkey,
  624.     /* | */ z_vigotocolumn,
  625.     /* } */ z_undefinedkey,
  626.     /* ~ */ z_viswapcase,
  627.     /* ^? */ z_vibackwardchar,
  628. };
  629.