Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: cd ..<tab>?
- X-seq: zsh-users 4655
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx, Dennis Haney <davh@xxxxxxx>
- Subject: Re: cd ..<tab>?
- Date: Tue, 5 Feb 2002 17:46:35 +0000
- In-reply-to: <3C60140C.6020006@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20020129102017.E3A633FC1B@xxxxxxxxxxxxxxxxxx> <15446.30464.872842.207355@xxxxxxxxxxxxxxxxxx> <3C572BEB.2030001@xxxxxxx> <020129171248.ZM11938@xxxxxxxxxxxxxxxxxxxxxxx> <3C60140C.6020006@xxxxxxx>
On Feb 5, 6:19pm, Dennis Haney wrote:
}
} Bart Schaefer wrote:
}
} >>Is there a way to make this work properly with setopt GLOB_DOTS?
} >
} >Just make the style more specific:
} >
} > zstyle ':completion:*:(cd|chdir|pushd|popd):*' special-dirs ..
} >
} How is that going to help me?
Apparently I misunderstood the question. It'll help by making ".." not
be completed for commands other than "cd" et al., which was the only
way I could think of (at the time) that GLOB_DOTS could be involved.
} >You might also check the documentation for the ignore-parents style.
} >
} ignore-parent works the wrong way...
Aha.
} It want to ignore '..' when it is a stupid choice.
} eg.
} mkdir Z
} cd Z/[tab]
} should NOT complete to 'cd Z/../'
} (unless CHASE_DOTS is on and 'cd Z/..' will be different from 'cd .')
This is a case where you need 'zstyle -e'. You want the special-dirs
style to be non-empty only in certain circumstances.
This completes `..' only if the prefix is either empty, or has a leading
`.' and contains no slashes:
zstyle -e ':completion:*' special-dirs \
'[[ $PREFIX = (|.[^/]#) ]] && reply=(..)'
To find out that `Z/..' is not the same directory as `.' requires a bit
of extra work, which I don't have time to do just now, but you can see
how you'd just insert that into the conditions under which the reply
array is set by the style.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author