From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6153 invoked by alias); 18 Sep 2011 14:08:48 -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: 16383 Received: (qmail 2948 invoked from network); 18 Sep 2011 14:08:37 -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=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.216.178 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Pe/eF4wjl2Mv+xne3DfCm0JKdkQGONjLlz3Ko9F3c9E=; b=OmynEU/2fY7dMIb5cSKKHxyaB3UbWN+CIgb2cn2d+20BdxeNJ0Al6r2wJC6xiI++nT pEOtdD8nf72J3Oyv8wDdDXjK9MAabZoGiBMW291JW8Ulxstn/H35DcadCxH9yjAVgq9M nwWccz+zL7JOKP95AigLz8UOhmXoUPpvsYsD4= MIME-Version: 1.0 In-Reply-To: References: <110913074320.ZM14249@torch.brasslantern.com> Date: Sun, 18 Sep 2011 16:08:29 +0200 Message-ID: Subject: Re: Completion lists From: Mikael Magnusson To: "Yuri D'Elia" , Zsh Users Content-Type: text/plain; charset=UTF-8 [you forgot to reply to all] On 18 September 2011 16:03, Yuri D'Elia wrote: > On Sun, 18 Sep 2011 15:48:39 +0200, Mikael Magnusson wrote: >>> >>> % ls ///list >>> etc/ lib/ usr/ >>> >>> but it's also pure chance, since PREFIX in this case seems to be >>> "///list" which >>> doesn't pass the "! -d" test (which is done for simple directories). I >>> tried to >>> write better code to handle this case, but "$compstate" doesn't seem to >>> put >>> anything meaningful (I was expecting insert_positions to be set to >>> something!). >>> >>> Also, I could avoid the test entirely if I could set a different function >>> when >>> completing arguments instead of files. How can I do this? >> >> [...] >>> >>> zstyle -e ':completion:*' list-colors highlight-comp >> >> Here you can use something like ":completion:*:files:" instead, i >> don't know off hand what the exact value you want is, bindkey some key >> to _complete_help and check. Or maybe you want to make it match >> against _files rather than the specific tag. > > I guess I want to match set a different functions depending whether I'm > completing on _files or _arguments, but I'm unsure how to do that. > > $ vi ./d^xh > tags in context :completion::complete:vi:: > all-files (_files _default (eval)) > > Doing > > zstyle -e ':completion:*:files:' list-colors .. > > doesn't do what I mean. As you can see, the tag here is "all-files", not "files". You also need another * after the last :, I see that I missed that, sorry. I think you can put either all-files or _files and it might work. Note that if you set the list-dirs-first style, you'll get other-files and directories instead of all-files. -- Mikael Magnusson