The name of the completion function for the command foo
is $_comps[foo]
.
To see the code of a function myfunc
, run echo -E $functions[myfunc]
, or just echo $functions[myfunc]
if you have the bsd_echo
option on, or print -rl $functions[myfunc]
. So to see the code of the completion function for the command foo
, run echo -E $functions[$_comps[foo]]
. Alternatively, run which $_comps[foo]
if the function name has no alias.
This shows the code without comments (and with normalized whitespace: it's a human-readable dump of the bytecode that zsh stores internally). If you want to see the original file defined in the code, run **[whence -v $_comps[foo]
](http://zsh.sourceforge.net/Doc/Release/Shell-Buil