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

Re: dynamic globbing for cdpath?

On Oct 22, 12:24pm, Eric D. Friedman wrote:
} Is it possible to have an entry in cdpath that contains a shell
} globbing pattern that gets reevaulated when I press cd <TAB> ?

You're really asking two almost-unrelated questions here.

The cdpath value might be used by completion, but where it really
matters is when you type "cd somewhere<RETURN>" without completing
first.  No, it's not possible to introduce a glob into that.

What's your objection to resetting cdpath?  You could do it in your
precmd function, for example, so you never have to notice it.

As for the completion-related part of your question, you can use
the fake-files style.  Although the name of the style implies that
the files might not really be there, you can populate the value
with actual files if you want to.  Start with something like this:

zstyle -e ':completion:*' fake-files \
	'reply=($HOME/*/branches); reply=(:"${(@)reply#$HOME/}")' 

Then tweak to suit your preferred behavior.


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