From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11316 invoked by alias); 15 Mar 2017 17:00:07 -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: 22576 Received: (qmail 27211 invoked from network); 15 Mar 2017 17:00:07 -0000 X-Qmail-Scanner-Diagnostics: from mail-ua0-f177.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.217.177):SA:0(0.5/5.0):. Processed in 1.248067 secs); 15 Mar 2017 17:00:07 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_SPAM,SPF_PASS, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.217.177 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=8RUskYN4tyoAOUpsYLQejZp0FXPnkaY/FmN0rfA4p2U=; b=tIdunp35o7d3ZEmH+Prt2OPdQ1MkIEp53ViSe6sinVaZDe3e0w0aMybg/uL3/+9yys ACYmqyOQXPEzlVWFSALxsXUCFtD3r87MNv2Pn+CBHrfEbfCqMdJdhWrhAGe5OtwmH8bc kliFnlLsjn96s7yZc5EVJoR+FRlkWOW+eWmXrqd7A6xe6M7sMVkB2Y5fSGV++GynivNC 277H5auoDDb36T82x9hezjrUG7pqEH3/e9E+wZ0P4Wbig/9xYw6dydF1BRrtLXw3UCJV 3Mck62+Nn07uYKn3/jW8meVVXsB6ZX4hlRoWcTUtAhyMes8nQy7mlOL7K8sM4DkT6mJR WV7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=8RUskYN4tyoAOUpsYLQejZp0FXPnkaY/FmN0rfA4p2U=; b=G3A0WiG5bOipF9br3atuT+YXliKLg4gZzqwPZzXIoJqfSqMzPRZzEpgUoX1CMnaaLU HKhApEszWg9wPMx3RIhRUWsTNoKm2nCPZ4iPelUZqCDS3djEw/vI2KHtkExX6nRKIML5 z+0elmG6NYuCTTp8fq6QdwpcqgJnSsG4my7PiETK+dR5lps9gLHttOv09lf4vQ95wCg/ UhJ/UUJJNgu9KKuPqdzqjLy8sR+A2dHhH73hq0Vi61qz624EZD2xZXxKx2UzDjZisrVZ PvtqzYvasTQupkt9Pv80pS3sl7Jw7VkxtNR/0z++r/RVxS03FIGtF1KVCC3gJO5pI0fU R0fg== X-Gm-Message-State: AFeK/H2ZrhaU5XxXYz5d0pewG4EbJ8bev3Rup8od4JmJinNoonx1dzDxEuD/uahDaja8nA== X-Received: by 10.176.3.113 with SMTP id 104mr1004476uat.45.1489597196031; Wed, 15 Mar 2017 09:59:56 -0700 (PDT) From: Bart Schaefer Message-Id: <170315100037.ZM13808@torch.brasslantern.com> Date: Wed, 15 Mar 2017 10:00:37 -0700 In-Reply-To: Comments: In reply to Jesper Nygards "Re: Completion for cd" (Mar 15, 8:22am) References: <170314120715.ZM10347@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: Completion for cd MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 15, 8:22am, Jesper Nygards wrote: } } Thanks to your help, I managed to find a working solution, changing the } critical lines to this: } zstyle ':completion:*:complete:cd:*:*' tag-order local-directories } directories - } zstyle ':completion:*:withpath:cd:*:*' tag-order path-directories } } In other words, I have added 'directories' to the first line. } } However, I still don't fully understand what is going on. I believe your style settings are wrong. You have: zstyle ':completion:*:*:cd:*:*' completer _expand _complete \ _complete:withpath _prefix _approximate _ignored zstyle ':completion:*:withpath:cd:*:*' tag-order path-directories But _complete:withpath sets the context to "completewithpath" not to "withpath" so the path-directories tag-order will never match. (This is why the example uses _complete:-foo so that the context is complete-foo with the hyphen.) In light of that -- >> I then go to '/tmp/zaa' and write 'cd ../z'. "../z" is not a prefix of a local directory, so the local-directories tag finds nothing. (Anything starting with "/" or "../" is treated as a non-local path.) So it falls on through to _approximate. When you add back "directories", _complete finds candidates in "../" and ignore-parents kicks in.