Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: persistant Directory history?
- X-seq: zsh-users 10950
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: William Scott <wgscott@xxxxxxxxxxxxxxxxxx>
- Subject: Re: persistant Directory history?
- Date: Tue, 7 Nov 2006 08:18:00 +0000
- Cc: chesss <testingagain@xxxxxxxxx>, zsh-users@xxxxxxxxxx
- In-reply-to: <Pine.OSX.4.61.0611061617370.1112@xxxxxxxxxxxxxxx>
- Mail-followup-to: William Scott <wgscott@xxxxxxxxxxxxxxxxxx>, chesss <testingagain@xxxxxxxxx>, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <5db995410611060845y53f673e6je029a9c60659f116@xxxxxxxxxxxxxx> <20061106174053.GA4323@sc> <5db995410611061314l26e089b8wb214da46064c8235@xxxxxxxxxxxxxx> <20061106215051.GB4323@sc> <Pine.OSX.4.61.0611061617370.1112@xxxxxxxxxxxxxxx>
- Sender: Stephane Chazelas <stephane_chazelas@xxxxxxxx>
On Mon, Nov 06, 2006 at 04:19:27PM -0800, William Scott wrote:
>
> >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.
>
>
> Sorry to hijack, but is there a simple way to have a shared directory
> stack between several terminal sessions? I hacked together something that
> works, but I have a bad feeling that I reinvented the wheel (and never
> quite made it round).
[...]
Maybe something like:
SAVED_DIRSTACK=~/.zsh-dir-stack-shared
get_saved_dirstack() {
[[ -r $SAVED_DIRSTACK ]] &&
. $SAVED_DIRSTACK
}
save_dirstack() {
print -r "dirstack=(${(@qq)dirstack})" > $SAVED_DIRSTACK
}
functions[preexec]+='
get_saved_dirstack'
functions[chpwd]+='
save_dirstack'
(untested).
--
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author