问题
I would like to enable zsh to autocomplete modules for yast2 (an OpenSuSE control panel), but it seems to already have some things defined. I can run
compctl -k "(hello world)" nonexistantprogram
just fine, but
compctl -k "(hello world)" yast2
doesn't work at all. Some things for yast2 seem to be already defined, namely the "-" options: --fullscreen, --geometry, --list [submodules], etc.
Even if for those who don't use OpenSuSE: Are there any flags to compctl to make it override previous settings? Thanks very much in advance.
回答1:
Most likely, your system is using the newer compsys system rather than the older compctl system. See man zshcompsys and man zshcompwid (and man zshcompctl).
The completion function for yast2 is probably in this file (or similar path):
/usr/share/zsh/functions/Completion/Linux/_yast
来源:https://stackoverflow.com/questions/1635922/how-does-one-override-an-existing-zsh-keyboard-completion