home *** CD-ROM | disk | FTP | other *** search
- /* vi:ts=4
- *
- * VIM - Vi IMproved
- *
- * Code Contributions By: Bram Moolenaar mool@oce.nl
- * Tim Thompson twitch!tjt
- * Tony Andrews onecom!wldrdg!tony
- * G. R. (Fred) Walter watmath!watcgl!grwalter
- */
-
- /*
- * |This file is read by mkcmdtab to produce cmdtab.h.
- *
- * The bars are used to recognize file positions. Do not insert/delete them.|
- */
-
- #define RANGE 0x01 /* allow a linespecs */
- #define BANG 0x02 /* allow a ! after the command name */
- #define EXTRA 0x04 /* allow extra args after command name */
- #define XFILE 0x08 /* expand wildcards in extra part */
- #define NOSPC 0x10 /* no spaces allowed in the extra part */
- #define DFLALL 0x20 /* default file range is 1,$ */
- #define NODFL 0x40 /* do not default to the current file name */
- #define NEEDARG 0x80 /* argument required */
- #define TRLBAR 0x100 /* check for trailing vertical bar */
- #define REGSTR 0x200 /* allow "x for register designation */
- #define COUNT 0x400 /* allow count in argument */
- #define NOTRLCOM 0x800 /* no trailing comment allowed */
- #define ZEROR 0x1000 /* zero line number allowed */
- #define USECTRLV 0x2000 /* do not remove CTRL-V from argument */
- #define FILES (XFILE + EXTRA) /* multiple extra files allowed */
- #define WORD1 (EXTRA + NOSPC) /* one extra word allowed */
- #define FILE1 (FILES + NOSPC) /* 1 file allowed, defaults to current file */
- #define NAMEDF (FILE1 + NODFL) /* 1 file allowed, defaults to "" */
- #define NAMEDFS (FILES + NODFL) /* multiple files allowed, default is "" */
-
- /*
- * This array maps ex command names to command codes. The order in which
- * command names are listed below is significant -- ambiguous abbreviations
- * are always resolved to be the first possible match (e.g. "r" is taken
- * to mean "read", not "rewind", because "read" comes before "rewind").
- * Not supported commands are included to avoid ambiguities.
- */
- static struct
- {
- char *cmd_name; /* name of the command */
- short cmd_argt; /* command line arguments permitted/needed/used */
- } cmdnames[] =
- {
- | {"append", BANG+RANGE+TRLBAR}, /* not supported */
- {"abbreviate", EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
- {"args", TRLBAR},
- {"change", BANG+RANGE+COUNT+TRLBAR}, /* not supported */
- {"cabbrev", EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
- {"cc", TRLBAR+WORD1+BANG},
- {"cd", NAMEDF+TRLBAR},
- {"center", TRLBAR+RANGE+EXTRA},
- {"cf", TRLBAR+FILE1+BANG},
- {"chdir", NAMEDF+TRLBAR},
- {"cl", TRLBAR},
- {"cmap", BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
- {"cn", TRLBAR+BANG},
- {"cnoremap", BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
- {"cnoreabbrev", EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
- {"copy", RANGE+EXTRA+TRLBAR},
- {"cp", TRLBAR+BANG},
- {"cq", TRLBAR+BANG},
- {"cunmap", BANG+EXTRA+TRLBAR+USECTRLV},
- {"cunabbrev", EXTRA+TRLBAR+USECTRLV},
- {"delete", RANGE+REGSTR+COUNT+TRLBAR},
- {"display", TRLBAR},
- {"digraphs", EXTRA+TRLBAR},
- {"edit", BANG+FILE1+TRLBAR},
- {"ex", BANG+FILE1+TRLBAR},
- {"file", FILE1+TRLBAR},
- {"files", TRLBAR},
- {"global", RANGE+BANG+EXTRA+DFLALL},
- {"help", TRLBAR},
- {"insert", BANG+RANGE+TRLBAR}, /* not supported */
- {"iabbrev", EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
- {"imap", BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
- {"inoremap", BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
- {"inoreabbrev", EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
- {"iunmap", BANG+EXTRA+TRLBAR+USECTRLV},
- {"iunabbrev", EXTRA+TRLBAR+USECTRLV},
- {"join", RANGE+COUNT+TRLBAR},
- {"jumps", TRLBAR},
- {"k", RANGE+WORD1+TRLBAR},
- {"list", RANGE+COUNT+TRLBAR},
- {"left", TRLBAR+RANGE+EXTRA},
- {"move", RANGE+EXTRA+TRLBAR},
- {"mark", RANGE+WORD1+TRLBAR},
- {"marks", TRLBAR},
- {"map", BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
- {"make", NEEDARG+EXTRA+TRLBAR+XFILE},
- {"mkexrc", BANG+FILE1+TRLBAR},
- {"mkvimrc", BANG+FILE1+TRLBAR},
- {"next", RANGE+BANG+NAMEDFS+TRLBAR},
- {"number", RANGE+COUNT+TRLBAR},
- {"noremap", BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
- {"noreabbrev", EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
- {"Next", RANGE+BANG+TRLBAR},
- {"print", RANGE+COUNT+TRLBAR},
- {"pop", RANGE+TRLBAR+ZEROR},
- {"put", RANGE+BANG+REGSTR+TRLBAR},
- {"previous", RANGE+BANG+TRLBAR},
- {"pwd", TRLBAR},
- {"quit", BANG+TRLBAR},
- {"read", RANGE+NAMEDF+NEEDARG+TRLBAR+ZEROR},
- {"rewind", BANG+TRLBAR},
- {"recover", FILE1+TRLBAR}, /* not supported */
- {"redo", TRLBAR},
- {"right", TRLBAR+RANGE+EXTRA},
- {"substitute", RANGE+EXTRA},
- {"suspend", TRLBAR+BANG},
- {"set", EXTRA+TRLBAR},
- {"setkeymap", NAMEDF+TRLBAR},
- {"shell", TRLBAR},
- {"source", NAMEDF+NEEDARG+TRLBAR},
- {"stop", TRLBAR+BANG},
- {"t", RANGE+EXTRA+TRLBAR},
- {"tag", RANGE+BANG+WORD1+TRLBAR+ZEROR},
- {"tags", TRLBAR},
- {"undo", TRLBAR},
- {"unabbreviate", EXTRA+TRLBAR+USECTRLV},
- {"unmap", BANG+EXTRA+TRLBAR+USECTRLV},
- {"vglobal", RANGE+EXTRA+DFLALL},
- {"version", TRLBAR},
- {"visual", RANGE+BANG+FILE1+TRLBAR},
- {"write", RANGE+BANG+FILE1+DFLALL+TRLBAR},
- {"wnext", RANGE+BANG+FILE1+TRLBAR},
- {"winsize", EXTRA+NEEDARG+TRLBAR},
- {"wq", BANG+FILE1+DFLALL+TRLBAR},
- {"xit", BANG+FILE1+DFLALL+TRLBAR},
- {"yank", RANGE+REGSTR+COUNT+TRLBAR},
- {"z", RANGE+COUNT+TRLBAR}, /* not supported */
- {"@", RANGE+EXTRA+TRLBAR},
- {"!", RANGE+NAMEDFS},
- {"<", RANGE+COUNT+TRLBAR},
- {">", RANGE+COUNT+TRLBAR},
- {"=", RANGE+TRLBAR},
- {"&", RANGE+EXTRA},
- {"~", RANGE+TRLBAR} /* not supported */
- |
- };
- |
-