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

Re: AUTO_CD



Dave Yost <Dave@xxxxxxxx>:
> At 11:49 PM +0400 2006-10-06, Andrey Borzenkov wrote:
> >-----BEGIN PGP SIGNED MESSAGE-----
> >Hash: SHA1
> >
> >On Friday 06 October 2006 22:35, Dave Yost wrote:
> >> Hi.
> >>
> >> There should be a way to get something like AUTO_CD but that does a pushd.
> >>
> >
> >What about 'setopt autopushd'?
> 
> Man zshall doesn't contain the string autopushd anywhere.  I presume
> you mean AUTO_PUSHD, which (as I read it) makes all cd commands act
> like pushd.  This is different from what I'm asking, though AUTO_PUSHD
> is the name you would expect my request would use.

% man 1 zshoptions
[snip]
SPECIFYING OPTIONS
       Options are primarily referred to by name.  These names are case insen-
       sitive and underscores are ignored.  For example, `allexport' is equiv-
       alent to `A__lleXP_ort'.
[snap]


If I understand your question correctly, this is what you want:

[snip]
zsh% dirs -v
0       ~
zsh% setopt autocd
zsh% setopt autopushd     
zsh% /bin
zsh% /usr/local 
zsh% /home/ftp
zsh% ~
zsh% dirs -v         
0       ~
1       /home/ftp
2       /usr/local
3       /bin
[snap]

A autocd that does pushd.

Regards, Frank



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