I can across the following zstyle setting in a popular shared zsh configuration:
# Environment Variables
zstyle ':completion::*:(-command-|export):*' fake-parameters ${${${_comps[(I)-value-*]#*,}%%,*}:#-*-}
Source: sorin-ionescu/prezto /modules/completion/init.zsh
My questions:
- What does this accomplish? Without using this line (with mostly default zstyle settings) I still get completion for environment variable names when I type
$<Tab>
. There must be some other functionality this affords. - How does this work? According to the manpages, the
fake-parameters
style is used supply the completion system "names of parameters that might not yet be set but should be completed nonetheless". I've also discovered that_comps[xyz]
is a way to look up the completion function for a particular commandxyz
. I cannot understand the remaining syntax.