From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8679 invoked by alias); 13 Sep 2011 16:30:31 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16342 Received: (qmail 1898 invoked from network); 13 Sep 2011 16:30:15 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <110913092957.ZM14421@torch.brasslantern.com> Date: Tue, 13 Sep 2011 09:29:57 -0700 In-reply-to: Comments: In reply to Yuri DElia "Re: Completion lists" (Sep 13, 3:16pm) References: <110913074320.ZM14249@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Completion lists MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Sep 13, 3:16pm, Yuri DElia wrote: } } Bart Schaefer brasslantern.com> writes: } } > zstyle -e ':completion:*:default' list-colors \ } > 'reply=("=(#b)${words[CURRENT]:t}(*)=0=7")' } } Your code seem to fail badly with directories. } For instance, completing anything with "./" will incorrectly skip the } first two characters of the files themselves. It works just fine from zsh -f autoload -Uz compinit compinit -D zstyle ... and it also works with my own usual completion styles, so there's something else in your configuration that's clashing with it. [...] } While I was waiting I kept trying Always a good plan. } and came up with this: } } c='${PREFIX:+=(#b)($PREFIX:t)(?)*===$color[bold]}':'=(#b)(?)*==$color[bold]' } zstyle -e ':completion:*' list-colors "reply=(\"$c\")" Strictly speaking I think you should use =0=0=$color[bold]}, that may be why strange things are getting highlighted in some of your attempts. I get different results with =0=0= vs ===. } I'm wondering what variables could in the reply. I found $PREFIX in } other examples, and now also $words[CURRENT]. Is there a list for } these? Maybe I could make it work if I had SUFFIX/somethingelse. All the completion special variables are listed in the "Completion Special Parameters" section of the manual (info section 19.2 with the latest CVS checkout). The list-colors style is looked up several times during the course of a typical completion, so it may get evaluated late enough for the values of words / PREFIX / SUFFIX etc. to be accurate. I still think it's going to be difficult to get a single global list-colors style that covers all the cases.