From 0055b01bfa961d2cdf614e7361fb6eda53118c38 Mon Sep 17 00:00:00 2001 From: Matt Cable Date: Sat, 27 Feb 2010 16:15:47 -0700 Subject: [PATCH] Initial pass at pesistant directory stack --- lib/dirspersist.zsh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lib/dirspersist.zsh diff --git a/lib/dirspersist.zsh b/lib/dirspersist.zsh new file mode 100644 index 00000000..a7c077ae --- /dev/null +++ b/lib/dirspersist.zsh @@ -0,0 +1,19 @@ +#!/bin/zsh +# +# Make the dirstack more persistant +# +# Run dirpersiststore in ~/.zlogout + +dirpersiststore () { + dirs -p | sed 's/ /\\ /g;s/^/pushd -q /;1!G;h;$!d;' > ~/.zdirstore +} + +dirpersistrestore () { + if [ -f ~/.zdirstore ]; then + source ~/.zdirstore + fi +} + +DIRSTACKSIZE=10 +setopt autopushd pushdminus pushdsilent pushdtohome pushdignoredups +dirpersistrestore \ No newline at end of file