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

Re: Adding array content to cd completion



Le Wednesday 15 November 2006, à 00:09:38AM -0500, Jean-Rene a écrit : 
> I have an array of directories I frequently visit.
> I would like the completion of "cd" to include
> those directories, as a separate group.
> 
> I put the following in my .zshrc. It works but is
> ugly and crude. There must be a better way to do
> it.
> 
> ---------------%<----------------
> mycompletion() {
>    _cd
>    compadd -X Jumps -a jumplist
> }
> compdef mycompletion cd
> ---------------%<----------------
> 
> Suggestions?

Is it "named directories" you are looking for ?                                                                                              
ex : I have :                                                                                                                                
hash -d doc="/usr/share/doc"                                                                                                                 
in my .zshrc, and cd ~doc always puts me to /usr/share/doc                                                                                   
Take also a look at CDABLE_VARS option                                                                                                              
                                                                                                                                             
It's not exactly what you are asking, but may be it could help.                                                                              
                                                                                                                                             
arno. 

Attachment: signature.asc
Description: Digital signature



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