ex_cmds.h
上传用户:gddssl
上传日期:2007-01-06
资源大小:1003k
文件大小:20k
源码类别:

编辑器/阅读器

开发平台:

DOS

  1. /* vi:set ts=8 sts=4 sw=4:
  2.  *
  3.  * VIM - Vi IMproved by Bram Moolenaar
  4.  *
  5.  * Do ":help uganda"  in Vim to read copying and usage conditions.
  6.  * Do ":help credits" in Vim to see a list of people who contributed.
  7.  */
  8. /*
  9.  * This file defines the Ex commands.
  10.  * When DO_DECLARE_EXCMD is defined, the table with ex command names and
  11.  * options results.
  12.  * When DO_DECLARE_EXCMD is NOT defined, the enum with all the Ex commands
  13.  * results.
  14.  * This clever trick was invented by Ron Aaron.
  15.  */
  16. /*
  17.  * When adding an Ex command:
  18.  * 1. Add an entry in the table below.
  19.  * 2. Add a "case: CMD_xxx" in ex_docmd.c.
  20.  * 3. Add a line in ../doc/index.txt.
  21.  * 4. Add documentation in ../doc/xxx.txt.  Add a tag for both the short and
  22.  *    long name of the command.
  23.  */
  24. #undef EXCMD     /* just in case */
  25. #ifdef DO_DECLARE_EXCMD
  26. # define EXCMD(a, b, c)  {(char_u *)b, c}
  27. #else
  28. # define EXCMD(a, b, c)  a
  29. #endif
  30. #ifdef RANGE
  31. # undef RANGE /* SASC on Amiga defines it */
  32. #endif
  33. #define RANGE    0x01 /* allow a linespecs */
  34. #define BANG    0x02 /* allow a ! after the command name */
  35. #define EXTRA    0x04 /* allow extra args after command name */
  36. #define XFILE    0x08 /* expand wildcards in extra part */
  37. #define NOSPC    0x10 /* no spaces allowed in the extra part */
  38. #define DFLALL    0x20 /* default file range is 1,$ */
  39. #define NODFL    0x40 /* do not default to the current file name */
  40. #define NEEDARG    0x80 /* argument required */
  41. #define TRLBAR   0x100 /* check for trailing vertical bar */
  42. #define REGSTR   0x200 /* allow "x for register designation */
  43. #define COUNT   0x400 /* allow count in argument, after command */
  44. #define NOTRLCOM  0x800 /* no trailing comment allowed */
  45. #define ZEROR  0x1000 /* zero line number allowed */
  46. #define USECTRLV 0x2000 /* do not remove CTRL-V from argument */
  47. #define NOTADR  0x4000 /* number before command is not an address */
  48. #define EDITCMD  0x8000 /* has "+command" argument */
  49. #define BUFNAME 0x10000 /* accepts buffer name */
  50. #define FILES (XFILE + EXTRA) /* multiple extra files allowed */
  51. #define WORD1 (EXTRA + NOSPC) /* one extra word allowed */
  52. #define FILE1 (FILES + NOSPC) /* 1 file allowed, defaults to current file */
  53. #define NAMEDF (FILE1 + NODFL) /* 1 file allowed, defaults to "" */
  54. #define NAMEDFS (FILES + NODFL) /* multiple files allowed, default is "" */
  55. /*
  56.  * This array maps ex command names to command codes. The order in which
  57.  * command names are listed below is significant -- ambiguous abbreviations
  58.  * are always resolved to be the first possible match (e.g. "r" is taken
  59.  * to mean "read", not "rewind", because "read" comes before "rewind").
  60.  * Not supported commands are included to avoid ambiguities.
  61.  */
  62. #ifdef DO_DECLARE_EXCMD
  63. static struct cmdname
  64. {
  65.     char_u  *cmd_name; /* name of the command */
  66.     long_u   cmd_argt; /* command line arguments permitted/needed/used */
  67. } cmdnames[] =
  68. #else
  69. enum CMD_index
  70. #endif
  71. {
  72.     EXCMD(CMD_append, "append", BANG+RANGE+ZEROR+TRLBAR),
  73.     EXCMD(CMD_all, "all", RANGE+NOTADR+COUNT+TRLBAR),
  74.     EXCMD(CMD_abbreviate,"abbreviate", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  75.     EXCMD(CMD_abclear, "abclear", TRLBAR),
  76.     EXCMD(CMD_amenu, "amenu", RANGE+NOTADR+ZEROR+EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  77.     EXCMD(CMD_anoremenu,"anoremenu", RANGE+NOTADR+ZEROR+EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  78.     EXCMD(CMD_args, "args", BANG+NAMEDFS+EDITCMD+TRLBAR),
  79.     EXCMD(CMD_argument, "argument", BANG+RANGE+NOTADR+COUNT+EXTRA+EDITCMD+TRLBAR),
  80.     EXCMD(CMD_ascii, "ascii", TRLBAR),
  81.     EXCMD(CMD_autocmd, "autocmd", BANG+EXTRA+NOTRLCOM+USECTRLV),
  82.     EXCMD(CMD_augroup, "augroup", WORD1+TRLBAR),
  83.     EXCMD(CMD_aunmenu, "aunmenu", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  84.     EXCMD(CMD_buffer, "buffer", BANG+RANGE+NOTADR+BUFNAME+COUNT+EXTRA+TRLBAR),
  85.     EXCMD(CMD_ball, "ball", RANGE+NOTADR+COUNT+TRLBAR),
  86.     EXCMD(CMD_badd, "badd", NEEDARG+FILE1+EDITCMD+TRLBAR),
  87.     EXCMD(CMD_bdelete, "bdelete", BANG+RANGE+NOTADR+BUFNAME+COUNT+EXTRA+TRLBAR),
  88.     EXCMD(CMD_behave, "behave", NEEDARG+WORD1+TRLBAR),
  89.     EXCMD(CMD_blast, "blast", BANG+RANGE+TRLBAR),
  90.     EXCMD(CMD_bmodified,"bmodified", BANG+RANGE+NOTADR+COUNT+TRLBAR),
  91.     EXCMD(CMD_bnext, "bnext", BANG+RANGE+NOTADR+COUNT+TRLBAR),
  92.     EXCMD(CMD_bNext, "bNext", BANG+RANGE+NOTADR+COUNT+TRLBAR),
  93.     EXCMD(CMD_bprevious,"bprevious", BANG+RANGE+NOTADR+COUNT+TRLBAR),
  94.     EXCMD(CMD_brewind, "brewind", BANG+RANGE+TRLBAR),
  95.     EXCMD(CMD_break, "break", TRLBAR),
  96.     EXCMD(CMD_browse, "browse", NEEDARG+EXTRA+NOTRLCOM),
  97.     EXCMD(CMD_buffers, "buffers", TRLBAR),
  98.     EXCMD(CMD_bunload, "bunload", BANG+RANGE+NOTADR+BUFNAME+COUNT+EXTRA+TRLBAR),
  99.     EXCMD(CMD_change, "change", BANG+RANGE+COUNT+TRLBAR),
  100.     EXCMD(CMD_cabbrev, "cabbrev", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  101.     EXCMD(CMD_cabclear, "cabclear", TRLBAR),
  102.     EXCMD(CMD_call, "call", RANGE+NEEDARG+EXTRA+NOTRLCOM),
  103.     EXCMD(CMD_cc, "cc", RANGE+NOTADR+COUNT+TRLBAR+BANG),
  104.     EXCMD(CMD_cd, "cd", NAMEDF+TRLBAR),
  105.     EXCMD(CMD_center, "center", TRLBAR+RANGE+EXTRA),
  106.     EXCMD(CMD_cfile, "cfile", TRLBAR+FILE1+BANG),
  107.     EXCMD(CMD_chdir, "chdir", NAMEDF+TRLBAR),
  108.     EXCMD(CMD_checkpath,"checkpath", TRLBAR+BANG),
  109.     EXCMD(CMD_clist, "clist", TRLBAR+BANG),
  110.     EXCMD(CMD_close, "close", BANG+TRLBAR),
  111.     EXCMD(CMD_clast, "clast", RANGE+NOTADR+COUNT+TRLBAR+BANG),
  112.     EXCMD(CMD_cmap, "cmap", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  113.     EXCMD(CMD_cmapclear,"cmapclear", TRLBAR),
  114.     EXCMD(CMD_cmenu, "cmenu", RANGE+NOTADR+ZEROR+EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  115.     EXCMD(CMD_cnext, "cnext", RANGE+NOTADR+COUNT+TRLBAR+BANG),
  116.     EXCMD(CMD_cNext, "cNext", RANGE+NOTADR+COUNT+TRLBAR+BANG),
  117.     EXCMD(CMD_cnewer, "cnewer", RANGE+NOTADR+COUNT+TRLBAR),
  118.     EXCMD(CMD_cnoremap, "cnoremap", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  119.     EXCMD(CMD_cnoremenu,"cnoremenu", RANGE+NOTADR+ZEROR+EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  120.     EXCMD(CMD_cnoreabbrev,"cnoreabbrev",EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  121.     EXCMD(CMD_copy, "copy", RANGE+EXTRA+TRLBAR),
  122.     EXCMD(CMD_colder, "colder", RANGE+NOTADR+COUNT+TRLBAR),
  123.     EXCMD(CMD_command, "command", EXTRA+BANG+NOTRLCOM+USECTRLV),
  124.     EXCMD(CMD_comclear, "comclear", TRLBAR),
  125.     EXCMD(CMD_continue, "continue", TRLBAR),
  126.     EXCMD(CMD_confirm,  "confirm", NEEDARG+EXTRA+NOTRLCOM),
  127.     EXCMD(CMD_cprevious,"cprevious", RANGE+NOTADR+COUNT+TRLBAR+BANG),
  128.     EXCMD(CMD_cquit, "cquit", TRLBAR+BANG),
  129.     EXCMD(CMD_crewind, "crewind", RANGE+NOTADR+COUNT+TRLBAR+BANG),
  130.     EXCMD(CMD_cscope,   "cscope",       EXTRA+NOTRLCOM),
  131.     EXCMD(CMD_cstag, "cstag", BANG+TRLBAR+WORD1),
  132.     EXCMD(CMD_cunmap, "cunmap", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  133.     EXCMD(CMD_cunmenu, "cunmenu", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  134.     EXCMD(CMD_cunabbrev,"cunabbrev", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  135.     EXCMD(CMD_delete, "delete", RANGE+REGSTR+COUNT+TRLBAR),
  136.     EXCMD(CMD_delcommand,"delcommand", NEEDARG+WORD1+TRLBAR),
  137.     EXCMD(CMD_delfunction,"delfunction",NEEDARG+WORD1+TRLBAR),
  138.     EXCMD(CMD_display, "display", EXTRA+NOTRLCOM+TRLBAR),
  139.     EXCMD(CMD_digraphs, "digraphs", EXTRA+TRLBAR),
  140.     EXCMD(CMD_djump, "djump", BANG+RANGE+DFLALL+EXTRA),
  141.     EXCMD(CMD_dlist, "dlist", BANG+RANGE+DFLALL+EXTRA),
  142.     EXCMD(CMD_doautocmd,"doautocmd", EXTRA+TRLBAR),
  143.     EXCMD(CMD_doautoall,"doautoall", EXTRA+TRLBAR),
  144.     EXCMD(CMD_dsearch, "dsearch", BANG+RANGE+DFLALL+EXTRA),
  145.     EXCMD(CMD_dsplit, "dsplit", BANG+RANGE+DFLALL+EXTRA),
  146.     EXCMD(CMD_edit, "edit", BANG+FILE1+EDITCMD+TRLBAR),
  147.     EXCMD(CMD_echo, "echo", EXTRA+NOTRLCOM),
  148.     EXCMD(CMD_echohl, "echohl", EXTRA+TRLBAR),
  149.     EXCMD(CMD_echon, "echon", EXTRA+NOTRLCOM),
  150.     EXCMD(CMD_else, "else", TRLBAR),
  151.     EXCMD(CMD_elseif, "elseif", EXTRA+NOTRLCOM),
  152.     EXCMD(CMD_endif, "endif", TRLBAR),
  153.     EXCMD(CMD_endfunction,"endfunction",TRLBAR),
  154.     EXCMD(CMD_endwhile, "endwhile", TRLBAR),
  155.     EXCMD(CMD_ex, "ex", BANG+FILE1+EDITCMD+TRLBAR),
  156.     EXCMD(CMD_execute, "execute", EXTRA+NOTRLCOM),
  157.     EXCMD(CMD_exit, "exit", RANGE+BANG+FILE1+DFLALL+TRLBAR),
  158.     EXCMD(CMD_file, "file", BANG+FILE1+TRLBAR),
  159.     EXCMD(CMD_files, "files", TRLBAR),
  160.     EXCMD(CMD_fixdel, "fixdel", TRLBAR),
  161.     EXCMD(CMD_function, "function", EXTRA+BANG),
  162.     EXCMD(CMD_global, "global", RANGE+BANG+EXTRA+DFLALL),
  163.     EXCMD(CMD_grep, "grep", NEEDARG+EXTRA+TRLBAR+XFILE),
  164.     EXCMD(CMD_gui, "gui", BANG+NAMEDFS+EDITCMD+TRLBAR),
  165.     EXCMD(CMD_gvim, "gvim", BANG+NAMEDFS+EDITCMD+TRLBAR),
  166.     EXCMD(CMD_help, "help", EXTRA+NOTRLCOM),
  167.     EXCMD(CMD_highlight,"highlight", BANG+EXTRA+TRLBAR),
  168.     EXCMD(CMD_hide, "hide", BANG+TRLBAR),
  169.     EXCMD(CMD_insert, "insert", BANG+RANGE+TRLBAR),
  170.     EXCMD(CMD_iabbrev, "iabbrev", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  171.     EXCMD(CMD_iabclear, "iabclear", TRLBAR),
  172.     EXCMD(CMD_if, "if", EXTRA+NOTRLCOM),
  173.     EXCMD(CMD_ijump, "ijump", BANG+RANGE+DFLALL+EXTRA),
  174.     EXCMD(CMD_ilist, "ilist", BANG+RANGE+DFLALL+EXTRA),
  175.     EXCMD(CMD_imap, "imap", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  176.     EXCMD(CMD_imapclear,"imapclear", TRLBAR),
  177.     EXCMD(CMD_imenu, "imenu", RANGE+NOTADR+ZEROR+EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  178.     EXCMD(CMD_inoremap, "inoremap", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  179.     EXCMD(CMD_inoremenu,"inoremenu", RANGE+NOTADR+ZEROR+EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  180.     EXCMD(CMD_inoreabbrev,"inoreabbrev",EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  181.     EXCMD(CMD_intro, "intro", TRLBAR),
  182.     EXCMD(CMD_isearch, "isearch", BANG+RANGE+DFLALL+EXTRA),
  183.     EXCMD(CMD_isplit, "isplit", BANG+RANGE+DFLALL+EXTRA),
  184.     EXCMD(CMD_iunmap, "iunmap", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  185.     EXCMD(CMD_iunmenu, "iunmenu", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  186.     EXCMD(CMD_iunabbrev,"iunabbrev", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  187.     EXCMD(CMD_join, "join", BANG+RANGE+COUNT+TRLBAR),
  188.     EXCMD(CMD_jumps, "jumps", TRLBAR),
  189.     EXCMD(CMD_k, "k", RANGE+WORD1+TRLBAR),
  190.     EXCMD(CMD_list, "list", RANGE+COUNT+TRLBAR),
  191.     EXCMD(CMD_last, "last", EXTRA+BANG+EDITCMD+TRLBAR),
  192.     EXCMD(CMD_left, "left", TRLBAR+RANGE+EXTRA),
  193.     EXCMD(CMD_let, "let", EXTRA+NOTRLCOM),
  194.     EXCMD(CMD_ls, "ls", TRLBAR),
  195.     EXCMD(CMD_move, "move", RANGE+EXTRA+TRLBAR),
  196.     EXCMD(CMD_mark, "mark", RANGE+WORD1+TRLBAR),
  197.     EXCMD(CMD_marks, "marks", EXTRA+TRLBAR),
  198.     EXCMD(CMD_map, "map", BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  199.     EXCMD(CMD_mapclear, "mapclear", BANG+TRLBAR),
  200.     EXCMD(CMD_make, "make", NEEDARG+EXTRA+TRLBAR+XFILE),
  201.     EXCMD(CMD_menu, "menu", RANGE+NOTADR+ZEROR+BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  202.     EXCMD(CMD_mkexrc, "mkexrc", BANG+FILE1+TRLBAR),
  203.     EXCMD(CMD_mksession,"mksession", BANG+FILE1+TRLBAR),
  204.     EXCMD(CMD_mkvimrc, "mkvimrc", BANG+FILE1+TRLBAR),
  205.     EXCMD(CMD_mfstat, "mfstat", TRLBAR), /* for debugging */
  206.     EXCMD(CMD_mode, "mode", WORD1+TRLBAR),
  207.     EXCMD(CMD_next, "next", RANGE+NOTADR+BANG+NAMEDFS+EDITCMD+TRLBAR),
  208.     EXCMD(CMD_new, "new", BANG+FILE1+RANGE+NOTADR+EDITCMD+TRLBAR),
  209.     EXCMD(CMD_nmap, "nmap", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  210.     EXCMD(CMD_nmapclear,"nmapclear", TRLBAR),
  211.     EXCMD(CMD_nmenu, "nmenu", RANGE+NOTADR+ZEROR+EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  212.     EXCMD(CMD_nnoremap, "nnoremap", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  213.     EXCMD(CMD_nnoremenu,"nnoremenu", RANGE+NOTADR+ZEROR+EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  214.     EXCMD(CMD_number, "number", RANGE+COUNT+TRLBAR),
  215.     EXCMD(CMD_noremap, "noremap", BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  216.     EXCMD(CMD_nohlsearch,"nohlsearch", TRLBAR),
  217.     EXCMD(CMD_noremenu, "noremenu", RANGE+NOTADR+ZEROR+BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  218.     EXCMD(CMD_noreabbrev,"noreabbrev", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  219.     EXCMD(CMD_normal, "normal", RANGE+BANG+EXTRA+NEEDARG+NOTRLCOM+USECTRLV),
  220.     EXCMD(CMD_nunmap, "nunmap", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  221.     EXCMD(CMD_nunmenu, "nunmenu", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  222.     EXCMD(CMD_open, "open", TRLBAR), /* not supported */
  223.     EXCMD(CMD_only, "only", BANG+TRLBAR),
  224.     EXCMD(CMD_omap, "omap", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  225.     EXCMD(CMD_omapclear,"omapclear", TRLBAR),
  226.     EXCMD(CMD_omenu, "omenu", RANGE+NOTADR+ZEROR+EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  227.     EXCMD(CMD_onoremap, "onoremap", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  228.     EXCMD(CMD_onoremenu,"onoremenu", RANGE+NOTADR+ZEROR+EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  229.     EXCMD(CMD_ounmap, "ounmap", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  230.     EXCMD(CMD_ounmenu, "ounmenu", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  231.     EXCMD(CMD_print, "print", RANGE+COUNT+TRLBAR),
  232.     EXCMD(CMD_perl, "perl", RANGE|EXTRA|DFLALL|NEEDARG),
  233.     EXCMD(CMD_perldo, "perldo", RANGE|EXTRA|DFLALL|NEEDARG),
  234.     EXCMD(CMD_pop, "pop", RANGE+NOTADR+BANG+COUNT+TRLBAR+ZEROR),
  235.     EXCMD(CMD_put, "put", RANGE+BANG+REGSTR+TRLBAR+ZEROR),
  236.     EXCMD(CMD_preserve, "preserve", TRLBAR),
  237.     EXCMD(CMD_previous, "previous", EXTRA+RANGE+NOTADR+COUNT+BANG+EDITCMD+TRLBAR),
  238.     EXCMD(CMD_promptfind, "promptfind", EXTRA+NOTRLCOM),
  239.     EXCMD(CMD_promptrepl, "promptrepl", EXTRA+NOTRLCOM),
  240.     EXCMD(CMD_pwd, "pwd", TRLBAR),
  241.     EXCMD(CMD_python, "python", RANGE+EXTRA+NEEDARG),
  242.     EXCMD(CMD_pyfile, "pyfile", RANGE+FILE1+NEEDARG),
  243.     EXCMD(CMD_quit, "quit", BANG+TRLBAR),
  244.     EXCMD(CMD_qall, "qall", BANG+TRLBAR),
  245.     EXCMD(CMD_read, "read", BANG+RANGE+NAMEDF+TRLBAR+ZEROR),
  246.     EXCMD(CMD_rewind, "rewind", EXTRA+BANG+EDITCMD+TRLBAR),
  247.     EXCMD(CMD_recover, "recover", BANG+FILE1+TRLBAR),
  248.     EXCMD(CMD_redo, "redo", TRLBAR),
  249.     EXCMD(CMD_redir, "redir", BANG+FILES+TRLBAR),
  250.     EXCMD(CMD_registers,"registers", EXTRA+NOTRLCOM+TRLBAR),
  251.     EXCMD(CMD_resize, "resize", TRLBAR+WORD1),
  252.     EXCMD(CMD_retab, "retab", TRLBAR+RANGE+DFLALL+BANG+WORD1),
  253.     EXCMD(CMD_return, "return", EXTRA+NOTRLCOM),
  254.     EXCMD(CMD_right, "right", TRLBAR+RANGE+EXTRA),
  255.     EXCMD(CMD_rviminfo, "rviminfo", BANG+FILE1+TRLBAR),
  256.     EXCMD(CMD_substitute,"substitute", RANGE+EXTRA),
  257.     EXCMD(CMD_sargument,"sargument", BANG+RANGE+NOTADR+COUNT+EXTRA+EDITCMD+TRLBAR),
  258.     EXCMD(CMD_sall, "sall", RANGE+NOTADR+COUNT+TRLBAR),
  259.     EXCMD(CMD_sbuffer, "sbuffer", BANG+RANGE+NOTADR+BUFNAME+COUNT+EXTRA+TRLBAR),
  260.     EXCMD(CMD_sball, "sball", RANGE+NOTADR+COUNT+TRLBAR),
  261.     EXCMD(CMD_sblast, "sblast", TRLBAR),
  262.     EXCMD(CMD_sbmodified,"sbmodified", RANGE+NOTADR+COUNT+TRLBAR),
  263.     EXCMD(CMD_sbnext, "sbnext", RANGE+NOTADR+COUNT+TRLBAR),
  264.     EXCMD(CMD_sbNext, "sbNext", RANGE+NOTADR+COUNT+TRLBAR),
  265.     EXCMD(CMD_sbprevious,"sbprevious", RANGE+NOTADR+COUNT+TRLBAR),
  266.     EXCMD(CMD_sbrewind, "sbrewind", TRLBAR),
  267.     EXCMD(CMD_suspend, "suspend", TRLBAR+BANG),
  268.     EXCMD(CMD_set, "set", EXTRA+TRLBAR),
  269.     EXCMD(CMD_shell, "shell", TRLBAR),
  270. #ifdef USE_GUI_WIN32
  271.     EXCMD(CMD_simalt, "simalt", NEEDARG+WORD1+TRLBAR),
  272. #endif
  273.     EXCMD(CMD_sleep, "sleep", RANGE+COUNT+NOTADR+EXTRA+TRLBAR),
  274.     EXCMD(CMD_smagic, "smagic", RANGE+EXTRA),
  275.     EXCMD(CMD_source, "source", BANG+NAMEDF+TRLBAR),
  276.     EXCMD(CMD_split, "split", BANG+FILE1+RANGE+NOTADR+EDITCMD+TRLBAR),
  277.     EXCMD(CMD_snext, "snext", RANGE+NOTADR+BANG+NAMEDFS+EDITCMD+TRLBAR),
  278.     EXCMD(CMD_sniff, "sniff", EXTRA+TRLBAR),
  279.     EXCMD(CMD_snomagic, "snomagic", RANGE+EXTRA),
  280.     EXCMD(CMD_sNext, "sNext", EXTRA+RANGE+NOTADR+COUNT+BANG+EDITCMD+TRLBAR),
  281.     EXCMD(CMD_sprevious,"sprevious", EXTRA+RANGE+NOTADR+COUNT+BANG+EDITCMD+TRLBAR),
  282.     EXCMD(CMD_srewind, "srewind", EXTRA+BANG+EDITCMD+TRLBAR),
  283.     EXCMD(CMD_slast, "slast", EXTRA+BANG+EDITCMD+TRLBAR),
  284.     EXCMD(CMD_stop, "stop", TRLBAR+BANG),
  285.     EXCMD(CMD_stag, "stag", RANGE+NOTADR+BANG+WORD1+TRLBAR+ZEROR),
  286.     EXCMD(CMD_stjump, "stjump", BANG+TRLBAR+WORD1),
  287.     EXCMD(CMD_stselect, "stselect", BANG+TRLBAR+WORD1),
  288.     EXCMD(CMD_sunhide, "sunhide", RANGE+NOTADR+COUNT+TRLBAR),
  289.     EXCMD(CMD_sview, "sview", NEEDARG+RANGE+BANG+FILE1+EDITCMD+TRLBAR),
  290.     EXCMD(CMD_swapname, "swapname", TRLBAR),
  291.     EXCMD(CMD_syntax, "syntax", EXTRA+NOTRLCOM),
  292.     EXCMD(CMD_t, "t", RANGE+EXTRA+TRLBAR),
  293.     EXCMD(CMD_tag, "tag", RANGE+NOTADR+BANG+WORD1+TRLBAR+ZEROR),
  294.     EXCMD(CMD_tags, "tags", TRLBAR),
  295.     EXCMD(CMD_tcl, "tcl", RANGE+EXTRA+NEEDARG),
  296.     EXCMD(CMD_tcldo, "tcldo", RANGE+EXTRA+NEEDARG),
  297.     EXCMD(CMD_tclfile, "tclfile", RANGE+FILE1+NEEDARG),
  298.     EXCMD(CMD_tearoff, "tearoff", NEEDARG+EXTRA+TRLBAR+NOTRLCOM),
  299.     EXCMD(CMD_tjump, "tjump", BANG+TRLBAR+WORD1),
  300.     EXCMD(CMD_tlast, "tlast", BANG+TRLBAR),
  301.     EXCMD(CMD_tmenu, "tmenu", RANGE+NOTADR+ZEROR+EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  302.     EXCMD(CMD_tnext, "tnext", RANGE+NOTADR+BANG+TRLBAR+ZEROR),
  303.     EXCMD(CMD_tNext, "tNext", RANGE+NOTADR+BANG+TRLBAR+ZEROR),
  304.     EXCMD(CMD_tprevious,"tprevious", RANGE+NOTADR+BANG+TRLBAR+ZEROR),
  305.     EXCMD(CMD_trewind, "trewind", RANGE+NOTADR+BANG+TRLBAR+ZEROR),
  306.     EXCMD(CMD_tselect, "tselect", BANG+TRLBAR+WORD1),
  307.     EXCMD(CMD_tunmenu, "tunmenu", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  308.     EXCMD(CMD_undo, "undo", TRLBAR),
  309.     EXCMD(CMD_unabbreviate,"unabbreviate",EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  310.     EXCMD(CMD_unhide, "unhide", RANGE+NOTADR+COUNT+TRLBAR),
  311.     EXCMD(CMD_unlet, "unlet", BANG+EXTRA+NEEDARG+TRLBAR),
  312.     EXCMD(CMD_unmap, "unmap", BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  313.     EXCMD(CMD_unmenu, "unmenu", BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  314.     EXCMD(CMD_update, "update", RANGE+BANG+FILE1+DFLALL+TRLBAR),
  315.     EXCMD(CMD_vglobal, "vglobal", RANGE+EXTRA+DFLALL),
  316.     EXCMD(CMD_version, "version", EXTRA+TRLBAR),
  317.     EXCMD(CMD_visual, "visual", RANGE+BANG+FILE1+EDITCMD+TRLBAR),
  318.     EXCMD(CMD_view, "view", RANGE+BANG+FILE1+EDITCMD+TRLBAR),
  319.     EXCMD(CMD_vmap, "vmap", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  320.     EXCMD(CMD_vmapclear,"vmapclear", TRLBAR),
  321.     EXCMD(CMD_vmenu, "vmenu", RANGE+NOTADR+ZEROR+EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  322.     EXCMD(CMD_vnoremap, "vnoremap", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  323.     EXCMD(CMD_vnoremenu,"vnoremenu", RANGE+NOTADR+ZEROR+EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  324.     EXCMD(CMD_vunmap, "vunmap", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  325.     EXCMD(CMD_vunmenu, "vunmenu", EXTRA+TRLBAR+NOTRLCOM+USECTRLV),
  326.     EXCMD(CMD_write, "write", RANGE+BANG+FILE1+DFLALL+TRLBAR),
  327.     EXCMD(CMD_while, "while", EXTRA+NOTRLCOM),
  328.     EXCMD(CMD_wnext, "wnext", RANGE+NOTADR+BANG+FILE1+TRLBAR),
  329.     EXCMD(CMD_wNext, "wNext", RANGE+NOTADR+BANG+FILE1+TRLBAR),
  330.     EXCMD(CMD_wprevious,"wprevious", RANGE+NOTADR+BANG+FILE1+TRLBAR),
  331.     EXCMD(CMD_winsize, "winsize", EXTRA+NEEDARG+TRLBAR),
  332.     EXCMD(CMD_wq, "wq", RANGE+BANG+FILE1+DFLALL+TRLBAR),
  333.     EXCMD(CMD_wall, "wall", BANG+TRLBAR),
  334.     EXCMD(CMD_wqall, "wqall", BANG+FILE1+DFLALL+TRLBAR),
  335.     EXCMD(CMD_wviminfo, "wviminfo", BANG+FILE1+TRLBAR),
  336.     EXCMD(CMD_xit, "xit", RANGE+BANG+FILE1+DFLALL+TRLBAR),
  337.     EXCMD(CMD_xall, "xall", BANG+TRLBAR),
  338.     EXCMD(CMD_yank, "yank", RANGE+REGSTR+COUNT+TRLBAR),
  339.     EXCMD(CMD_z, "z", RANGE+EXTRA+TRLBAR),
  340.     EXCMD(CMD_Next, "Next", EXTRA+RANGE+NOTADR+COUNT+BANG+EDITCMD+TRLBAR),
  341.     EXCMD(CMD_Print, "Print", RANGE+COUNT+TRLBAR),
  342.     EXCMD(CMD_at, "@", RANGE+EXTRA+TRLBAR),
  343.     EXCMD(CMD_star, "*", RANGE+EXTRA+TRLBAR),
  344.     EXCMD(CMD_pound, "#", RANGE+COUNT+TRLBAR),
  345.     EXCMD(CMD_bang, "!", RANGE+BANG+NAMEDFS),
  346.     EXCMD(CMD_lshift, "<", RANGE+COUNT+TRLBAR),
  347.     EXCMD(CMD_rshift, ">", RANGE+COUNT+TRLBAR),
  348.     EXCMD(CMD_equal, "=", RANGE+TRLBAR),
  349.     EXCMD(CMD_and, "&", RANGE+EXTRA),
  350.     EXCMD(CMD_tilde, "~", RANGE+EXTRA),
  351. #ifndef DO_DECLARE_EXCMD
  352. #ifdef USER_COMMANDS
  353.     CMD_SIZE, /* MUST be after all real commands! */
  354.     CMD_USER = -1 /* User-defined command */
  355. #else
  356.     CMD_SIZE /* MUST be the last one! */
  357. #endif
  358. #endif
  359. };
  360. #ifndef DO_DECLARE_EXCMD
  361. typedef enum CMD_index CMDIDX;
  362. /*
  363.  * Arguments used for Ex commands.
  364.  */
  365. typedef struct exarg
  366. {
  367.     char_u *arg;     /* argument of the command */
  368.     char_u *nextcmd;   /* next command (NULL if none) */
  369.     char_u *cmd;     /* the name of the command (except for :make) */
  370.     CMDIDX cmdidx;     /* the index for the command */
  371.     long argt;     /* flags for the command */
  372.     int skip;     /* don't execute the command, only parse it */
  373.     int forceit;    /* TRUE if ! present */
  374.     int addr_count; /* the number of addresses given */
  375.     linenr_t line1;     /* the first line number */
  376.     linenr_t line2;     /* the second line number or count */
  377.     char_u *do_ecmd_cmd; /* +command argument to be used in edited file */
  378.     linenr_t do_ecmd_lnum; /* the line number in an edited file */
  379.     int append;     /* TRUE with ":w >>file" command */
  380.     int usefilter;  /* TRUE with ":w !command" and ":r!command" */
  381.     int amount;     /* number of '>' or '<' for shift command */
  382.     int regname;    /* register name (NUL if none) */
  383. #ifdef USER_COMMANDS
  384.     int useridx;    /* user command index */
  385. #endif
  386. } EXARG;
  387. #endif