3 # Make the dirstack more persistant
5 # Add dirpersist to $plugins in ~/.zshrc to load
8 # $zdirstore is the file used to persist the stack
11 dirpersistinstall
() {
12 if grep 'dirpersiststore' ~
/.zlogout
> /dev
/null
; then
14 if read -q \?"Would you like to set up your .zlogout file for use with dirspersist? (y/n) "; then
15 echo "# Store dirs stack\n# See $ZSH/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~
/.zlogout
17 echo "If you don't want this message to appear, remove dirspersist from \$plugins"
23 dirs -p | perl
-e 'foreach (reverse <STDIN>) {chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"}' > $zdirstore
26 dirpersistrestore
() {
27 if [ -f $zdirstore ]; then
33 setopt autopushd pushdminus pushdsilent pushdtohome pushdignoredups
38 # Make popd changes permanent without having to wait for logout
39 alias popd="popd;dirpersiststore"