From 2bc1a7520ac89e8d72fc88a114f5040c066125f5 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sat, 16 Dec 2006 20:13:14 +0100 Subject: [PATCH] zsh: add support for global dirstack handling --- debian/changelog | 7 +++++++ etc/zsh/zshrc | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/debian/changelog b/debian/changelog index b41ed1d..6546b5a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml-etc-core (0.2.12) unstable; urgency=low + + * /etc/zsh/zshrc: add support for global dirstack handling + (Closes: issue47) + + -- Michael Prokop Sat, 16 Dec 2006 20:12:25 +0100 + grml-etc-core (0.2.11) unstable; urgency=low * Do not depend on vim or nvi only but allow use of virtual package diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 85a61fa..addc8e6 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -372,6 +372,16 @@ fi isgrmlcd && SAVEHIST=1000 || SAVEHIST=10000 # useful for setopt append_history # }}} +# dirstack handling {{{ + DIRSTACKSIZE=20 + if [[ -f ~/.zdirs ]] && [[ ${#dirstack[*]} -eq 0 ]]; then + dirstack=( ${(uf)"$(< ~/.zdirs)"} ) + # "cd -" won't work after login by just setting $OLDPWD, so + cd $dirstack[0] && cd $OLDPWD + fi + chpwd() { dirs -pl >! ~/.zdirs } +# }}} + # {{{ display battery status on right side of prompt via running 'BATTERY=1 zsh' if [ -n "$BATTERY" ] ; then if [ -x =acpi ] ; then -- 2.1.4