From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24143 invoked by alias); 18 Oct 2011 11:16:57 -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: 16509 Received: (qmail 25715 invoked from network); 18 Oct 2011 11:16:54 -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.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Tue, 18 Oct 2011 12:16:44 +0100 From: Peter Stephenson To: ZSH Users Mailing List Subject: Re: Completion of autocd Doesn't Show all the Possible Matches Message-ID: <20111018121644.25f70d71@pwslap01u.europe.root.pri> In-Reply-To: <20111018105038.GA30470@circle.home> References: <20111014131553.GA13057@circle.home> <111014093239.ZM10515@torch.brasslantern.com> <20111018105038.GA30470@circle.home> Organization: Cambridge Silicon Radio X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.101.11.233] X-Scanned-By: MailControl 7.6.3 (www.mailcontrol.com) on 10.71.0.138 On Tue, 18 Oct 2011 12:50:38 +0200 Bastien Dejean wrote: > How could I define a custom completion mechanism which complete only > from the set of all the directories (being direct children of the > current directory) starting with the characters typed so far? If you type ^Xh after cd you'll see something like tags in context :completion::complete:cd:: local-directories path-directories (_alternative _cd (eval)) That's telling you there are two tags valid; one for local directories, the other directions found via cdpath. So to restrict completion after cd in this way you can specify you only want local directories: zstyle ':completion:*:complete:cd:*' tag-order local-directories You can restrict other forms of completion similarly. If you want to do this for autocd I think you need to turn off path-directories in that context: zstyle ':completion:*:complete:-command-:*' tag-order '!path-directories' You still get local directories if "." is in the path because they're completed by command completion. If "." isn't in the path you may need to type "./" first. This case seems to have fallen down the holes. pws Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog