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

Re: How do I get completion to only match certain types of files



Gregory Gerard wrote on Sun September 28, at 22:31 -0700:
> I would like to restrict the 'cd' command so that it can only
> complete directories (or shell variables).  Other file types (like
> links, devices, etc.) would be gravy, but not necessary.  I could do
> the restriction in tcsh, but tcsh has other problems that caused me
> to switch to zsh.
> 
> While browsing the man page, I saw I could restrict to named
> directories, but that's not really a help.
> 
> Am I missing something in the docs?

I have in my .zshrc:
compctl -g '*(-/)' + -g '.*(-/)' + -k '(..)' cd rmdir

This works well for me, but YMMV.

cheers
,dunc
-- 
Duncan Sargeant  -  metacitizen  -  http://www.ucc.gu.uwa.edu.au/~dunc/
For brevity is very good,
Where we are, or are not understood.  -  Samuel Butler, Hudibras.



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