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

Re: persistant Directory history?



On Tue, Nov 07, 2006 at 02:44:30AM +0530, chesss wrote:
> >I have in ~/.zshrc:
> >
> >SAVED_DIRSTACK=~/.zsh-dir-stack
> >[[ -f $SAVED_DIRSTACK ]] && . $SAVED_DIRSTACK
> >trap '
> >  print -r "dirstack=(${(@qq)dirstack})" > $SAVED_DIRSTACK
> >' EXIT
> 
> Exactly how will this work?
> What I want is a command that will show me the past directories I have
> cd'ed to. including those from past shells.

Those line just preserve the directory stack. If you've enabled
the completion system, all you need to do is type:

cd +<Tab>

and cycle through your past directories (you may need to set the
auto_pushd option as well).

See the "dirs" command, the auto_pushd option, the dirstack
array, the pushd/popd commands in zsh manual.

-- 
Stéphane



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