home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / v / vim_src.zip / CMDTAB.TAB < prev    next >
Text File  |  1993-01-12  |  4KB  |  124 lines

  1. /* vi:ts=4
  2.  *
  3.  * VIM - Vi IMitation
  4.  *
  5.  * Code Contributions By:    Bram Moolenaar            mool@oce.nl
  6.  *                            Tim Thompson            twitch!tjt
  7.  *                            Tony Andrews            onecom!wldrdg!tony 
  8.  *                            G. R. (Fred) Walter        watmath!watcgl!grwalter 
  9.  */
  10.  
  11. /*
  12.  * |This file is read by mkcmdtab to produce cmdtab.h.
  13.  *
  14.  * The bars are used to recognize file positions. Do not insert/delete them.|
  15.  */
  16.  
  17. #define RANGE    0x01            /* allow a linespecs */
  18. #define BANG    0x02            /* allow a ! after the command name */
  19. #define EXTRA    0x04            /* allow extra args after command name */
  20. #define XFILE    0x08            /* expand wildcards in extra part */
  21. #define NOSPC    0x10            /* no spaces allowed in the extra part */
  22. #define    DFLALL    0x20            /* default file range is 1,$ */
  23. #define NODFL    0x40            /* do not default to the current file name */
  24. #define NEEDARG    0x80            /* argument required */
  25. #define TRLBAR    0x100            /* check for trailing vertical bar */
  26. #define REGSTR    0x200            /* allow "x for register designation */
  27. #define COUNT    0x400            /* allow count in argument */
  28. #define NOTRLCOM 0x800            /* no trailing comment allowed */
  29. #define ZEROR    0x1000            /* zero line number allowed */
  30. #define FILES    (XFILE + EXTRA)    /* multiple extra files allowed */
  31. #define WORD1    (EXTRA + NOSPC)    /* one extra word allowed */
  32. #define FILE1    (FILES + NOSPC)    /* 1 file allowed, defaults to current file */
  33. #define NAMEDF    (FILE1 + NODFL)    /* 1 file allowed, defaults to "" */
  34. #define NAMEDFS    (FILES + NODFL)    /* multiple files allowed, default is "" */
  35.  
  36. /*
  37.  * This array maps ex command names to command codes. The order in which
  38.  * command names are listed below is significant -- ambiguous abbreviations
  39.  * are always resolved to be the first possible match (e.g. "r" is taken
  40.  * to mean "read", not "rewind", because "read" comes before "rewind").
  41.  * Not supported commands are included to avoid ambiguities.
  42.  */
  43. static struct
  44. {
  45.     char    *cmd_name;    /* name of the command */
  46.     short     cmd_argt;    /* command line arguments permitted/needed/used */
  47. } cmdnames[] =
  48. {
  49. |    {"append",        BANG+RANGE+TRLBAR},            /* not supported */
  50.     {"abbreviate",    EXTRA+TRLBAR+NOTRLCOM},        /* not supported */
  51.     {"args",        TRLBAR},
  52.     {"change",        BANG+RANGE+COUNT+TRLBAR},    /* not supported */
  53.     {"cd",            NAMEDF+TRLBAR},
  54.     {"cc",            TRLBAR+WORD1+BANG},
  55.     {"cf",            TRLBAR+FILE1+BANG},
  56.     {"cl",            TRLBAR},
  57.     {"cn",            TRLBAR+BANG},
  58.     {"cp",            TRLBAR+BANG},
  59.     {"cq",            TRLBAR+BANG},
  60.     {"copy",        RANGE+EXTRA+TRLBAR},
  61.     {"chdir",        NAMEDF+TRLBAR},
  62.     {"delete",        RANGE+REGSTR+COUNT+TRLBAR},
  63.     {"display",        TRLBAR},
  64.     {"digraph",        EXTRA+TRLBAR},
  65.     {"edit",        BANG+FILE1+TRLBAR},
  66.     {"ex",            BANG+FILE1+TRLBAR},
  67.     {"file",        FILE1+TRLBAR},
  68.     {"files",        TRLBAR},
  69.     {"global",        RANGE+BANG+EXTRA+DFLALL},
  70.     {"help",        TRLBAR},
  71.     {"insert",        BANG+RANGE+TRLBAR},            /* not supported */
  72.     {"join",        RANGE+COUNT+TRLBAR},
  73.     {"jumps",        TRLBAR},
  74.     {"k",            RANGE+WORD1+TRLBAR},
  75.     {"list",        RANGE+COUNT+TRLBAR},        /* not supported */
  76.     {"move",        RANGE+EXTRA+TRLBAR},
  77.     {"mark",        RANGE+WORD1+TRLBAR},
  78.     {"marks",        TRLBAR},
  79.     {"map",            BANG+EXTRA+TRLBAR+NOTRLCOM},
  80.     {"mkexrc",        BANG+FILE1+TRLBAR},
  81.     {"next",        RANGE+BANG+NAMEDFS+TRLBAR},
  82.     {"number",        RANGE+COUNT+TRLBAR},        /* not supported */
  83.     {"Next",        RANGE+BANG+TRLBAR},
  84.     {"print",        RANGE+COUNT+TRLBAR},
  85.     {"pop",            RANGE+TRLBAR+ZEROR},
  86.     {"put",            RANGE+BANG+REGSTR+TRLBAR},
  87.     {"previous",    RANGE+BANG+TRLBAR},
  88.     {"quit",        BANG+TRLBAR},
  89.     {"read",        RANGE+NAMEDF+NEEDARG+TRLBAR+ZEROR},
  90.     {"rewind",        BANG+TRLBAR},
  91.     {"recover",        FILE1+TRLBAR},                /* not supported */
  92.     {"substitute",    RANGE+EXTRA},
  93.     {"set",            EXTRA+TRLBAR},
  94.     {"setkeymap",    NAMEDF+TRLBAR},
  95.     {"shell",        TRLBAR},
  96.     {"source",        NAMEDF+NEEDARG+TRLBAR},
  97.     {"stop",        TRLBAR+BANG},
  98.     {"t",            RANGE+EXTRA+TRLBAR},
  99.     {"tag",            RANGE+BANG+WORD1+TRLBAR+ZEROR},
  100.     {"tags",        TRLBAR},
  101.     {"undo",        TRLBAR},
  102.     {"unabbreviate", EXTRA+TRLBAR},                /* not supported */
  103.     {"unmap",        BANG+EXTRA+TRLBAR},
  104.     {"vglobal",        RANGE+EXTRA+DFLALL},
  105.     {"version",        TRLBAR},
  106.     {"visual",        RANGE+BANG+FILE1+TRLBAR},
  107.     {"write",        RANGE+BANG+FILE1+DFLALL+TRLBAR},
  108.     {"wnext",        RANGE+BANG+FILE1+TRLBAR},
  109.     {"winsize",        EXTRA+NEEDARG+TRLBAR},
  110.     {"wq",            BANG+FILE1+DFLALL+TRLBAR},
  111.     {"xit",            BANG+FILE1+DFLALL+TRLBAR},
  112.     {"yank",        RANGE+REGSTR+COUNT+TRLBAR},
  113.     {"z",            RANGE+COUNT+TRLBAR},        /* not supported */
  114.     {"@",            RANGE+EXTRA+TRLBAR},
  115.     {"!",            RANGE+NAMEDFS},
  116.     {"<",            RANGE+COUNT+TRLBAR},
  117.     {">",            RANGE+COUNT+TRLBAR},
  118.     {"=",            RANGE+TRLBAR},
  119.     {"&",            RANGE+EXTRA},
  120.     {"~",            RANGE+TRLBAR}                /* not supported */
  121. |
  122. };
  123. |
  124.