From 658db70fd528c7b5f2b1ce8fbe7b65f00b540ab1 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Wed, 8 Jul 2009 17:14:56 +0200 Subject: [PATCH] zshrc: Include current directory in persistent dirstack When we used 'dirs -p' for that feature, $PWD was included already. It's not present in ${dirstack}, though. Now we just prepend $PWD to $dirstack when writing it to .zdirs. --- debian/changelog | 3 ++- etc/zsh/zshrc | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 30f05fd..2706b30 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,12 +12,13 @@ grml-etc-core (0.3.73) UNRELEASED; urgency=low * zshrc: Set options a lot earlier and include noshwordsplit explicitly. * zshrc: Make functions insusceptible to user option settings. * zsh: move completion.d and functions.d to usr/share + * zshrc: Include the current directory in the persistent directory stack. [ Michael Prokop ] * zshrc: add deborphan, pal and hnb to compdef _gnu_generic. Thanks for the suggestion to Carsten Hey. - -- Frank Terbeck Wed, 08 Jul 2009 13:33:56 +0200 + -- Frank Terbeck Wed, 08 Jul 2009 17:11:46 +0200 grml-etc-core (0.3.72) unstable; urgency=low diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index f7c332b..c1a619f 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -1064,10 +1064,12 @@ if [[ -f ${DIRSTACKFILE} ]] && [[ ${#dirstack[*]} -eq 0 ]] ; then fi chpwd() { + local -ax my_stack + my_stack=( ${PWD} ${dirstack} ) if is42 ; then - builtin print -l ${(u)dirstack} >! ${DIRSTACKFILE} + builtin print -l ${(u)my_stack} >! ${DIRSTACKFILE} else - uprint dirstack >! ${DIRSTACKFILE} + uprint my_stack >! ${DIRSTACKFILE} fi } -- 2.1.4