Adding an EX-command (in the c sources)
The new EX-command needs to be added to
ex_cmds.h
:
EXCMD(CMD_myexcmd, "myexcmd", ex_myexcmd,
EX_EXTRA|EX_NOTRLCOM|EX_SBOXOK|EX_CMDWIN,
ADDR_NONE),
The C function that handles the command needs to be put into a source file (for example
eval.c
):
void
ex_myexcmd(exarg_T *eap) {
…
}
The function definition needts to be added to a .pro
file (stored below src/proto
), for example into src/proto/eval.pro
.
void ex_myexcmd(exarg_T *eap);
Note, apparently, the *.pro
files are auto-generated. I have not yet found out, when this takes place or how I can trigger such an autogeneration.
make cmdidxs
See also
cmdnames
(in the same source file) is an array that stores the specifics of all ex-commands.
A command can be execute verbosely with
:verbose command …
.