Test the correct parameter for non-emptiness
[grml-etc-core.git] / etc / zsh / zshrc
index 1aa7376..1ffc6f2 100644 (file)
@@ -615,13 +615,11 @@ isdarwin && xsource /sw/bin/init.sh
 # load our function and completion directories
 for fdir in /usr/share/grml/zsh/completion /usr/share/grml/zsh/functions; do
     fpath=( ${fdir} ${fdir}/**/*(/N) ${fpath} )
-    if [[ ${fdir} == '/usr/share/grml/zsh/functions' ]] ; then
-        for func in ${fdir}/**/[^_]*[^~](N.) ; do
-            zrcautoload ${func:t}
-        done
-    fi
 done
-unset fdir func
+typeset -aU ffiles
+ffiles=(/usr/share/grml/zsh/functions/**/[^_]*[^~](N.:t))
+(( ${#ffiles} > 0 )) && autoload -U "${ffiles[@]}"
+unset -v fdir ffiles
 
 # support colors in less
 export LESS_TERMCAP_mb=$'\E[01;31m'
@@ -1566,7 +1564,7 @@ alias url-quote='autoload -U url-quote-magic ; zle -N self-insert url-quote-magi
 
 #m# k ESC-h Call \kbd{run-help} for the 1st word on the command line
 alias run-help >&/dev/null && unalias run-help
-for rh in run-help{,-git,-svk,-svn}; do
+for rh in run-help{,-git,-ip,-openssl,-p4,-sudo,-svk,-svn}; do
     zrcautoload $rh
 done; unset rh
 
@@ -2824,8 +2822,8 @@ function sll () {
     fi
 
     local file jumpd curdir
-    local -i RTN LINODE i
-    local -a SEENINODES
+    local -i 10 RTN LINODE i
+    local -a    SEENINODES
     curdir="${PWD}"
     RTN=0
 
@@ -2838,8 +2836,8 @@ function sll () {
                 LINODE=$(zstat -L +inode "${file}")
                 for i in ${SEENINODES} ; do
                     if (( ${i} == ${LINODE} )) ; then
-                        builtin cd "${curdir}"
-                        print "link loop detected, aborting!"
+                        builtin cd -q "${curdir}"
+                        print 'link loop detected, aborting!'
                         return 2
                     fi
                 done
@@ -2849,7 +2847,7 @@ function sll () {
             file="${file:t}"
 
             if [[ -d ${jumpd} ]] ; then
-                builtin cd "${jumpd}"  || RTN=1
+                builtin cd -q "${jumpd}"  || RTN=1
             fi
             file=$(readlink "$file")
 
@@ -2857,7 +2855,7 @@ function sll () {
             file="${file:t}"
 
             if [[ -d ${jumpd} ]] ; then
-                builtin cd "${jumpd}"  || RTN=1
+                builtin cd -q "${jumpd}"  || RTN=1
             fi
 
             ls -l "${PWD}/${file}"     || RTN=1
@@ -2866,7 +2864,7 @@ function sll () {
         if (( ${#} >= 1 )) ; then
             print ""
         fi
-        builtin cd "${curdir}"
+        builtin cd -q "${curdir}"
     done
     return ${RTN}
 }
@@ -3126,7 +3124,7 @@ function ssl-cert-info () {
 }
 
 # make sure our environment is clean regarding colors
-builtin unset -v BLUE RED GREEN CYAN YELLOW MAGENTA WHITE
+builtin unset -v BLUE RED GREEN CYAN YELLOW MAGENTA WHITE NO_COLOR
 
 # "persistent history"
 # just write important commands you always need to $GRML_IMPORTANT_COMMANDS