I want to know which function zsh is using for tab completion of a command.
For many commands (make
, ls
, cd
…) I can apparently guess _<COMMANDNAME>
, but I might actually have overriden this setting with compdef _mycd cd
.
The reasons why I want to know this are two:
_nice
, with the exception that I might not rely on shift; CURRENT--; _normal
)The current completion rules are stored in $_comps
.
So one can display the completion rule for cd
with echo $_comps[cd]
and display the actual function definition with functions $_comps[cd]
.