Search notes:

Vim: ex commands

:help ex-cmd-index gives a list of all the : commands (without mentioning any arguments, however).
A (repetitive) sequence of ex commands can be stored in a user defined function (and then repeatedly called).
:profile file [pattern] profiles the performance of plugins.
:vimgrep searches for a regular expression in buffers(?)

Autocommands

Vim has a list of events that can be hooked to automatically execute commands.
This feature is called autocommand.
See also :autocmd, autocmd.c

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.
src/ex_cmdidxs.h needs also to be rebuilt:
make cmdidxs

See also

src/ex_docmd.c contains functions for executing an ex command line.
Ex commands are defined in src/ex_cmds.h.
The function do_source() (src/scriptfile.c) reads a file and executes its lines as ex commands.
The struct exarg_T (ex_cmds.h) stores the arguments used for ex commands.
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 ….

Index