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

Re: Completion for cd



On Mar 28, 12:42pm, Thorsten Haude wrote:
}
} one of the last upgrades of Zsh in Debian Sarge changed the way
} directory names for cd are completed. With the current set of
} functions, user's home directories are completed, which is a nuisance.
[...]
} 2. I would like to do the change in a way that does not interfere with
} future updates from Debian's package management system. Any ideas?

This should all be controllable by styles.

Start by typing (where "zsh% " represents your prompt);

    zsh% cd ~

Now type ctrl+x and then h.  You should see something like:

    tags in context :completion::complete:-tilde-::
	users named-directories directory-stack  (_tilde) 
	users                                    (_users _tilde)

If instead you see

    tags in context :completion::complete:cd::

(followed by some list of tags), then something is wrong, because the
"# Note we need a tilde because ..." code that you quoted should be
effectively dead now -- it's there only as a failsafe and I can't find
a way to force the _wanted call in that branch to be executed.  (Maybe
Oliver or PWS can?)

Assuming you've got the -tilde- context, you can just set the tag-order
style to omit the users tag:

    zstyle ':completion:*:complete:-tilde-:*' tag-order '! users'

Et voila.



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