Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Completion of autocd Doesn't Show all the Possible Matches



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



Messages sorted by: Reverse Date, Date, Thread, Author