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

Re: [zsh 4.0.1 bug] filename completion

Vincent Lefevre wrote:

> On 26 Jun, Andrej Borsenkow <Andrej.Borsenkow@xxxxxxxxxxxxxx> wrote:
> > It is. It makes no difference if one is named directory and other a file as
> > long as 'cd soft' works. And 'soft' *is* exact match for 'soft'.
> OK, you're right. But then, "cd so" should complete to "cd soft" (and
> not "cd software"), then give the choice between "soft" (because it
> is a named directory) and "software" (directory in the cwd). [...]

That's what my patch does.

> BTW, can I define an alias "c." in such a way that it behaves as if
> cdpath were (.), or as "cd ./"?

Something like this:

  c.() {
    setopt localoptions nocdablevars # if you want that...
    local CDPATH
    cd $*

(Or just use a function that sticks a `./' or `$PWD/' in front of the
first argument and then calls cd if that's enough for you.)

Completion for that:

  compdef c.=cd

This says that arguments for `c.' are to be completed as for `cd'.

  zstyle ':completion:*:*:c.:*' tag-order local-directories

And this says that you want only local directories (those in `.') to be
completed for `c.'.


Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx

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