Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Problem with fake-files style and cd
- X-seq: zsh-users 13858
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-users <zsh-users@xxxxxxxxxx>
- Subject: Re: Problem with fake-files style and cd
- Date: Sun, 15 Feb 2009 00:35:30 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=0L6NhI+BQmnOWT2wTYx9PLJkTUKw1Sq3h5UckbEp0lQ=; b=QMetkFB04TLKhdG13v1K4dNcIAsZ8bRrBxdSb/uBfyXDnnloIvgAIkuNEnz6ZASkdW th7Ixm64nRHYHeHZBwilPuCJEqshZDIeUMVhHZcNtKzyFkjyo0Bbqjg7X23l/TXRPqCD 56oWQyUUn+VRHTji5t741Kyp2aDQfX1i0YBJ4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=X65nQqgB/YD9cuyI9Kx1Hx5rRttlohgf1jESQ/ywUqJ1WGB9vql0YuqVN4LE33EnA2 KW230mLY83FMETj3aUW+d/snZvZKXYOo7M6lv9hEialLf8yQ0T/EB6rD7nbYMKDddQNN XwuNFQh1BZ2lEYnWkmg8yuX69GtncKEJgk4mU=
- In-reply-to: <090214152621.ZM15489@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <mikachu@xxxxxxxxx> <237967ef0902140622s7389d2c8h5a0c786dcf207422@xxxxxxxxxxxxxx> <200902141801.n1EI1E2l003603@xxxxxxxxxxxxxxxxxxx> <237967ef0902141019t30118690m30116c9413015d96@xxxxxxxxxxxxxx> <090214111316.ZM15188@xxxxxxxxxxxxxxxxxxxxxx> <237967ef0902141141y609b61d3i154546f6f6886c65@xxxxxxxxxxxxxx> <090214133904.ZM15383@xxxxxxxxxxxxxxxxxxxxxx> <237967ef0902141409o3a0c30a1mfbae985453403342@xxxxxxxxxxxxxx> <090214152621.ZM15489@xxxxxxxxxxxxxxxxxxxxxx>
2009/2/15 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>:
> On Feb 14, 11:09pm, Mikael Magnusson wrote:
> }
> } > zstyle -e :completion::complete:cd::path-directories ignored-patterns \
> } > 'reply=( *(/) )'
> } >
> } > This says that when completing in the cdpath, ignore any name that matches
> } > the name of a directory in the current directory.
> }
> } while the above appears to work, it really doesn't:
> } % mkdir path/code/foo
> } % cd code/<tab>
> } ---- local directory
> } foo/
> } ---- directory in cdpath
> } bar/ foo/
> }
> } Presumably this is because *(/) (which I changed to *(-/) (not in the
> } above testcase though)) only matches one segment and that *(/) is run
> } in $PWD, not $PWD/$PREFIX?
>
> Yep, true. Try it this way:
>
> zstyle -e :completion::complete:cd::path-directories ignored-patterns \
> 'reply=( ${PREFIX}*(-/) )'
>
> You might need to fool around with that a bit; for example, if you don't
> use the _expand completer you may want ${~PREFIX}*(-/) instead. There
> may also be tricky bits with IPREFIX, QIPREFIX, and special cases for
> completing in the middle of a word instead of at the end.
Aha, I didn't expect my wild guess to even have the correct variable
name :). If it breaks though, the worst that could happen is that I
get a duplicate entry in the listing though?
Thanks! I'll try this for a while and see what happens.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author