Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [zsh 4.0.1 bug] filename completion
- X-seq: zsh-users 3951
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: [zsh 4.0.1 bug] filename completion
- Date: Tue, 26 Jun 2001 13:18:59 +0200 (MET DST)
- In-reply-to: <4a90a3eafbvincent@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
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.'.
Bye
Sven
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author