I have written a simple completion script for a command
cheat so that when using
cheat at a prompt zsh will autocomplete arguments.
(obviously) this needed to be setup in a compinit / compsys compatible way:
#compdef cheat [bulk of code...] # make call into compsys to provide completion! _describe 'values' comp_cands_arr
avail the script to zsh through
fpath=(~/system/dev_resources/zsh_comp $fpath) autoload -U ~/system/dev_resources/zsh_comp/*(:t)
The completion script works fine - no problems.
Now I simply want to reference and configure this completion script through the
The COMPLETION SYSTEM CONFIGURATION section in zsh compsys documentation tells us:
When completion is attempted somewhere on the command line the completion system begins building the context [...]
The fields are always in the order
[completer] The completer currently active, the name of the function without the leading underscore and with other underscores converted to hyphens. A ‘completer’ is in overall control of how completion is to be performed;
My question is, is my zsh completion script
_cheat considered a "completer" in the context string? i.e. would this be correct/applicable?
It seems to be applicable, but at the same time the
_cheat script is not a formally defined as a shell function, its just a loose collection of commands...