zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <Peter.Stephenson@csr.com>
To: ZSH Users Mailing List <zsh-users@zsh.org>
Subject: Re: Completion of autocd Doesn't Show all the Possible Matches
Date: Tue, 18 Oct 2011 12:16:44 +0100	[thread overview]
Message-ID: <20111018121644.25f70d71@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <20111018105038.GA30470@circle.home>

On Tue, 18 Oct 2011 12:50:38 +0200
Bastien Dejean <nihilhill@gmail.com> 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


  reply	other threads:[~2011-10-18 11:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-14 13:15 Bastien Dejean
2011-10-14 16:32 ` Bart Schaefer
2011-10-18 10:50   ` Bastien Dejean
2011-10-18 11:16     ` Peter Stephenson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-10-14  9:50 Bastien Dejean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111018121644.25f70d71@pwslap01u.europe.root.pri \
    --to=peter.stephenson@csr.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).