Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: completion display question



On Feb 5,  1:50pm, Greg Klanderman wrote:
}
} I was wondering if there's some way for completion listings to
} indicate the common portion

It'd be nice if this worked:

zstyle -e ':completion:*:*:*:*' list-colors \
  'reply=("=(#b)(${(q)compstate[unambiguous]})*=0=01;31")'

Unfortunately the list-colors style is evaluated "too early," before
the completion internals have assigned compstate[unambiguous].

So I suggest you start from the following and try tweaking the
(${(q)PREFIX}) part until you get something close enough to what
you want:

zstyle -e ':completion:*:*:*:*' list-colors \
  'reply=("=(#b)(${(q)PREFIX})*=0=01;31")'

E.g. you may want (#b)*(${(q}PREFIX:t})* or something like that, and you
may want different patterns for different contexts.

Replace "01;31" with another color spec if you don't like red.  Also (q)
may not be sufficient to quote the prefix for pattern purposes.



Messages sorted by: Reverse Date, Date, Thread, Author