home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / util / vim-2.0.lha / Vim-2.0 / src / cmdtab.tab < prev    next >
Encoding:
Text File  |  1993-12-15  |  5.2 KB  |  147 lines

  1. /* vi:ts=4
  2.  *
  3.  * VIM - Vi IMproved
  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 USECTRLV 0x2000            /* do not remove CTRL-V from argument */
  31. #define FILES    (XFILE + EXTRA)    /* multiple extra files allowed */
  32. #define WORD1    (EXTRA + NOSPC)    /* one extra word allowed */
  33. #define FILE1    (FILES + NOSPC)    /* 1 file allowed, defaults to current file */
  34. #define NAMEDF    (FILE1 + NODFL)    /* 1 file allowed, defaults to "" */
  35. #define NAMEDFS    (FILES + NODFL)    /* multiple files allowed, default is "" */
  36.  
  37. /*
  38.  * This array maps ex command names to command codes. The order in which
  39.  * command names are listed below is significant -- ambiguous abbreviations
  40.  * are always resolved to be the first possible match (e.g. "r" is taken
  41.  * to mean "read", not "rewind", because "read" comes before "rewind").
  42.  * Not supported commands are included to avoid ambiguities.
  43.  */
  44. static struct
  45. {
  46.     char    *cmd_name;    /* name of the command */
  47.     short     cmd_argt;    /* command line arguments permitted/needed/used */
  48. } cmdnames[] =
  49. {
  50. |    {"append",        BANG+RANGE+TRLBAR},            /* not supported */
  51.     {"abbreviate",    EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  52.     {"args",        TRLBAR},
  53.     {"change",        BANG+RANGE+COUNT+TRLBAR},    /* not supported */
  54.     {"cabbrev",        EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  55.     {"cc",            TRLBAR+WORD1+BANG},
  56.     {"cd",            NAMEDF+TRLBAR},
  57.     {"center",        TRLBAR+RANGE+EXTRA},
  58.     {"cf",            TRLBAR+FILE1+BANG},
  59.     {"chdir",        NAMEDF+TRLBAR},
  60.     {"cl",            TRLBAR},
  61.     {"cmap",        BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  62.     {"cn",            TRLBAR+BANG},
  63.     {"cnoremap",    BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  64.     {"cnoreabbrev",    EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  65.     {"copy",        RANGE+EXTRA+TRLBAR},
  66.     {"cp",            TRLBAR+BANG},
  67.     {"cq",            TRLBAR+BANG},
  68.     {"cunmap",        BANG+EXTRA+TRLBAR+USECTRLV},
  69.     {"cunabbrev",    EXTRA+TRLBAR+USECTRLV},
  70.     {"delete",        RANGE+REGSTR+COUNT+TRLBAR},
  71.     {"display",        TRLBAR},
  72.     {"digraphs",    EXTRA+TRLBAR},
  73.     {"edit",        BANG+FILE1+TRLBAR},
  74.     {"ex",            BANG+FILE1+TRLBAR},
  75.     {"file",        FILE1+TRLBAR},
  76.     {"files",        TRLBAR},
  77.     {"global",        RANGE+BANG+EXTRA+DFLALL},
  78.     {"help",        TRLBAR},
  79.     {"insert",        BANG+RANGE+TRLBAR},            /* not supported */
  80.     {"iabbrev",        EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  81.     {"imap",        BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  82.     {"inoremap",    BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  83.     {"inoreabbrev",    EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  84.     {"iunmap",        BANG+EXTRA+TRLBAR+USECTRLV},
  85.     {"iunabbrev",    EXTRA+TRLBAR+USECTRLV},
  86.     {"join",        RANGE+COUNT+TRLBAR},
  87.     {"jumps",        TRLBAR},
  88.     {"k",            RANGE+WORD1+TRLBAR},
  89.     {"list",        RANGE+COUNT+TRLBAR},
  90.     {"left",        TRLBAR+RANGE+EXTRA},
  91.     {"move",        RANGE+EXTRA+TRLBAR},
  92.     {"mark",        RANGE+WORD1+TRLBAR},
  93.     {"marks",        TRLBAR},
  94.     {"map",            BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  95.     {"make",        NEEDARG+EXTRA+TRLBAR+XFILE},
  96.     {"mkexrc",        BANG+FILE1+TRLBAR},
  97.     {"mkvimrc",        BANG+FILE1+TRLBAR},
  98.     {"next",        RANGE+BANG+NAMEDFS+TRLBAR},
  99.     {"number",        RANGE+COUNT+TRLBAR},
  100.     {"noremap",        BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  101.     {"noreabbrev",    EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  102.     {"Next",        RANGE+BANG+TRLBAR},
  103.     {"print",        RANGE+COUNT+TRLBAR},
  104.     {"pop",            RANGE+TRLBAR+ZEROR},
  105.     {"put",            RANGE+BANG+REGSTR+TRLBAR},
  106.     {"previous",    RANGE+BANG+TRLBAR},
  107.     {"pwd",            TRLBAR},
  108.     {"quit",        BANG+TRLBAR},
  109.     {"read",        RANGE+NAMEDF+NEEDARG+TRLBAR+ZEROR},
  110.     {"rewind",        BANG+TRLBAR},
  111.     {"recover",        FILE1+TRLBAR},                /* not supported */
  112.     {"redo",        TRLBAR},
  113.     {"right",        TRLBAR+RANGE+EXTRA},
  114.     {"substitute",    RANGE+EXTRA},
  115.     {"suspend",        TRLBAR+BANG},
  116.     {"set",            EXTRA+TRLBAR},
  117.     {"setkeymap",    NAMEDF+TRLBAR},
  118.     {"shell",        TRLBAR},
  119.     {"source",        NAMEDF+NEEDARG+TRLBAR},
  120.     {"stop",        TRLBAR+BANG},
  121.     {"t",            RANGE+EXTRA+TRLBAR},
  122.     {"tag",            RANGE+BANG+WORD1+TRLBAR+ZEROR},
  123.     {"tags",        TRLBAR},
  124.     {"undo",        TRLBAR},
  125.     {"unabbreviate", EXTRA+TRLBAR+USECTRLV},
  126.     {"unmap",        BANG+EXTRA+TRLBAR+USECTRLV},
  127.     {"vglobal",        RANGE+EXTRA+DFLALL},
  128.     {"version",        TRLBAR},
  129.     {"visual",        RANGE+BANG+FILE1+TRLBAR},
  130.     {"write",        RANGE+BANG+FILE1+DFLALL+TRLBAR},
  131.     {"wnext",        RANGE+BANG+FILE1+TRLBAR},
  132.     {"winsize",        EXTRA+NEEDARG+TRLBAR},
  133.     {"wq",            BANG+FILE1+DFLALL+TRLBAR},
  134.     {"xit",            BANG+FILE1+DFLALL+TRLBAR},
  135.     {"yank",        RANGE+REGSTR+COUNT+TRLBAR},
  136.     {"z",            RANGE+COUNT+TRLBAR},        /* not supported */
  137.     {"@",            RANGE+EXTRA+TRLBAR},
  138.     {"!",            RANGE+NAMEDFS},
  139.     {"<",            RANGE+COUNT+TRLBAR},
  140.     {">",            RANGE+COUNT+TRLBAR},
  141.     {"=",            RANGE+TRLBAR},
  142.     {"&",            RANGE+EXTRA},
  143.     {"~",            RANGE+TRLBAR}                /* not supported */
  144. |
  145. };
  146. |
  147.