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

Completion of cd type functions?



Hi,

I just switched from tcsh to zsh.

In tcsh I frequently defined aliases to cd directly to various directories and 
used completion to move further from these directories:

Example:

alias cxxsrc 'cd ~/development/source/cxx/\!*'
complete cxxsrc "p@1@D:$HOME/development/source/cxx@"

This way I can just type cxxsrc from anywhere and have it complete only with 
directories in $HOME/development/source/cxx.

Can I do this somehow in zsh (simply)?  This seems pretty basic (it isn't even a
FAQ) but I can't figure it out. I got it to sort of work using a function that 
invokes "find" but it is deadly slow.

As far as I understand it I create a function:
cxxsrc() { cd $HOME/development/source/cxx/$* }
but the completion part eludes me.

Unfortunately the lete2ctl script fails when I try to run it so I can't get all 
my nifty tcsh completions translated automatically.


Thanks

Gurutej Khalsa




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