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

Re: completion for dotdirs/symlinks to directories



On 2002-08-27 at 14:34 -0700, Eric.D.Friedman@xxxxxxxxxxxxxx wrote:
> My .zshrc currently uses the following set for completing "cd" and friends:
> 
> # cd/pushd only directories or symbolic links to directories
> compctl -g '*(-/)' cd chdir dirs pushd
> # skips CVS when changing directories
> # compctl -g '*~(*/)#CVS(/)' cd
> compctl -g '*(-/)' -g '*~(*/)#CVS(/)' cd chdir dirs pushd

Doesn't the second uncommented one replace the first one?

> (1) I can't get completions for directories that start with a "."  ; and

'D' glob modifier, as you noticed.

> (2) symlinks to directories do not work.

'-', as you noticed.

> I'm using zsh-4.0.2 on solaris.

Thanks -- I see too many reports where that basic info isn't included.
It's not needed in this case, but better to have five words too many
than to miss a vital clue.  :^)

> I tried putting "D" in the first completion rule [ as in -g "$(D-/)" ] but
> that didn't work out.

$(...) is command substitution -- the POSIX form of `...`, with
different rules on escaping metacharacters.

> Can anyone set me straight?

How about:
 compctl -g '*~CVS(D-/)' cd chdir dirs pushd

Anything except CVS, and then modifier flags.
Works here (4.0.2/OpenBSD).
-- 
Democracy is three wolves and a sheep voting on what's for dinner.

Attachment: pgpBPbeQbeyAQ.pgp
Description: PGP signature



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