/etc/zsh/zshrc: activate 'setopt pushd_ignore_dups'
[grml-etc-core.git] / etc / zsh / zshrc
index 3b6d6de..80503fa 100644 (file)
@@ -3,7 +3,7 @@
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2.
-# Latest change: Mon Jul 02 18:17:08 CEST 2007 [mika]
+# Latest change: Sam Jul 07 10:56:20 CEST 2007 [mika]
 ################################################################################
 # This file is sourced only for interactive shells. It
 # should contain commands to set up aliases, functions,
@@ -567,6 +567,7 @@ fi
   setopt auto_pushd           # make cd push the old directory onto the directory stack.
   setopt nonomatch            # try to avoid the 'zsh: no matches found...'
   setopt nobeep               # avoid "beep"ing
+  setopt pushd_ignore_dups    # don't push the same dir twice.
 
   MAILCHECK=30       # mailchecks
   REPORTTIME=5       # report about cpu-/system-/user-time of command if running longer than 5 seconds
@@ -601,7 +602,7 @@ fi
 # dirstack handling {{{
   DIRSTACKSIZE=20
   if [[ -f ~/.zdirs ]] && [[ ${#dirstack[*]} -eq 0 ]]; then
-     dirstack=( ${(uf)"$(< ~/.zdirs)"} )
+     dirstack=( ${(f)"$(< ~/.zdirs)"} )
      # "cd -" won't work after login by just setting $OLDPWD, so
      [[ -d $dirstack[0] ]] && cd $dirstack[0] && cd $OLDPWD
   fi
@@ -790,7 +791,7 @@ ${BLUE}%n${NO_COLOUR}@%m %40<...<%B%~%b%<< %# "
   alias ...='cd ../../'
 
   # generate alias named "$KERNELVERSION-reboot" so you can use boot with kexec:
-  if [ -x /sbin/kexec ] ; then
+  if [ -x /sbin/kexec -a -r /proc/cmdline ] ; then
      alias "$(uname -r)-reboot"="kexec -l --initrd=/boot/initrd.img-"$(uname -r)" --command-line=\"$(cat /proc/cmdline)\" /boot/vmlinuz-"$(uname -r)""
   fi