X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=addc8e6fbfc1135eabc32a90760dba20e84af4ed;hb=2bc1a7520ac89e8d72fc88a114f5040c066125f5;hp=55715d82de50dabd5462958cde18b48be77d9f71;hpb=140a5435230cc9e9d86b21d09f9110d9d1bf6873;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 55715d8..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 @@ -396,8 +406,8 @@ fi # precmd () { setopt promptsubst; [[ -o interactive ]] && jobs -l; - is4 && ! [[ -n "$NOPRECMD" ]] && precmd () { - (( NOPRECMD > 0 )) && return 0 + is4 && [[ -z $NOPRECMD ]] && precmd () { + [[ -n $NOPRECMD ]] && return 0 # just use DONTSETRPROMPT=1 to be able to overwrite RPROMPT if [[ -z ${DONTSETRPROMPT} ]] ; then if [ -n "$BATTERY" ] ; then @@ -419,8 +429,8 @@ fi # chpwd () => a function which is executed whenever the directory is changed # preexec() => a function running before every command - is4 && ! [[ -n "$NOPRECMD" ]] && preexec () { - (( NOPRECMD > 0 )) && return 0 + is4 && [[ -z $NOPRECMD ]] && preexec () { + [[ -n $NOPRECMD ]] && return 0 # set hostname if not running on host with name 'grml' local HOSTNAME=$(hostname) if [[ "$HOSTNAME" != grml ]] ; then