X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=ba0df24ddcaf16a95bca5a722e49961f199bcd05;hb=fbb62ecf6accb6fc222ca2fba86730e51f34d7a3;hp=47dfa2e6033a04a9844fc448c0c73c33b804520d;hpb=4c17f24271add7f6aeb4bb27ef5c8033432eb55a;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 47dfa2e..ba0df24 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -136,6 +136,7 @@ # check for versions (compatibility reasons) if autoload is-at-least && is-at-least 2>/dev/null ; then is4() { is-at-least 4 } + is41() { is-at-least 4.1 } is42() { is-at-least 4.2 } else is4(){ @@ -450,12 +451,20 @@ fi done # autoload zsh modules when they are referenced - is4 && for opt mod in a stat \ - a zpty \ - ap zprof \ - ap mapfile ; do - zmodload -${opt} zsh/${mod} ${mod} - done ; unset opt mod + if is4 ; then + tmpargs=( + a stat + a zpty + ap zprof + ap mapfile + ) + + while (( ${#tmpargs} > 0 )) ; do + zmodload -${tmpargs[1]} zsh/${tmpargs[2]} ${tmpargs[2]} + shift 2 tmpargs + done + unset tmpargs + fi is4 && autoload -U insert-files && \ zle -N insert-files && \ @@ -698,7 +707,7 @@ fi # precmd () { setopt promptsubst; [[ -o interactive ]] && jobs -l; # make sure to use right prompt only when not running a command - is4 && setopt transient_rprompt + is41 && setopt transient_rprompt is4 && [[ -z $NOPRECMD ]] && precmd () { [[ -n $NOPRECMD ]] && return 0