0

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:

  1. 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.
  2. 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 command xyz. I cannot understand the remaining syntax.
Ankur
  • 2,792
  • 3
  • 23
  • 26

0 Answers0