L2 Cache

Behold the power of |!

User Tools

Site Tools


configuration:zsh

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
configuration:zsh [2016/03/20 21:28]
sjorge [.zshrc]
configuration:zsh [2017/05/01 18:31]
sjorge [.zshrc]
Line 36: Line 36:
 ## .zshrc ## .zshrc
 # by Jorge Schrauwen <​jorge@blackdot.be>​ # by Jorge Schrauwen <​jorge@blackdot.be>​
-# Version ​20160320001+# Version ​20160621001
 #         ​YYYYMMDD###​ #         ​YYYYMMDD###​
  
Line 43: Line 43:
 # #
 # Change Log # Change Log
 +# - 20170501: --- - disabled auto update
 +# - 20160621: --- - optimizations
 +# - 20160621: fix - if .aliases is missing initial exit indicator was fasle
 # - 20160320: fix - color ls on SmartOS, drop obd support # - 20160320: fix - color ls on SmartOS, drop obd support
 # - 20160219: fix - fix vncviewer alias # - 20160219: fix - fix vncviewer alias
Line 84: Line 87:
 # {{{ updater # {{{ updater
     NZSHRC="​https://​docu.blackdot.be/​getRaw.php?​onlyCode=true&​id=configuration:​zsh"​     NZSHRC="​https://​docu.blackdot.be/​getRaw.php?​onlyCode=true&​id=configuration:​zsh"​
-    CHECK_UPDATE=1 +    CHECK_UPDATE=0 
-    AUTO_UPDATE=1+    AUTO_UPDATE=0
 # }}} # }}}
  
Line 296: Line 299:
   ​   ​
         # LX BrandZ         # LX BrandZ
-        [ -d /native/​usr/​bin ​&& ​export PATH=$PATH:/​native/​usr/​bin +        ​if [ -d /native ]; then 
-        [ -d /​native/​sbin ] && [[ -n $WANT_SBIN ]] && ​export PATH=$PATH:/​native/​sbin +            ​export PATH=$PATH:/​native/​usr/​bin 
-        [ -d /​native/​usr/​sbin ] && [[ -n $WANT_SBIN ]] && ​export PATH=$PATH:/​native/​usr/​sbin+            ​if ​[ -n $WANT_SBIN ]; then 
 +                ​export PATH=$PATH:/​native/​sbin 
 +                export PATH=$PATH:/​native/​usr/​sbin 
 +            fi 
 +        fi
     ;; esac     ;; esac
     case $OSTYPE in solaris*)     case $OSTYPE in solaris*)
Line 309: Line 316:
         # add /usr/sbin if wanted         # add /usr/sbin if wanted
         [ $(echo $PATH | grep -c '/​usr/​sbin:'​) ​ -eq 0 ] && ​         [ $(echo $PATH | grep -c '/​usr/​sbin:'​) ​ -eq 0 ] && ​
-            ​[[ -n $WANT_SBIN ​]] && export PATH=$PATH:/​usr/​sbin+            [ -n $WANT_SBIN ] && export PATH=$PATH:/​usr/​sbin
  
         # check for gnu         # check for gnu
         export PATH=$(echo $PATH | /bin/sed -r '​s#:/​usr/​gnu/​s?​bin##​g'​)         export PATH=$(echo $PATH | /bin/sed -r '​s#:/​usr/​gnu/​s?​bin##​g'​)
-        [ -d /​usr/​gnu/​bin ] && export PATH=$PATH:/​usr/​gnu/​bin +        ​if [ -d /usr/gnu ]; then 
-        [ -/usr/gnu/sbin ] && [[ -n $WANT_SBIN ]] && ​export PATH=$PATH:/usr/gnu/sbin+            export PATH=$PATH:/​usr/​gnu/​bin 
 +            [ -n $WANT_SBIN ​] && export PATH=$PATH:/​usr/​gnu/​sbin 
 + 
 +            # selective gnu / colorization 
 +            [ -e /​usr/​gnu/​bin/sed ] && alias sed='/​usr/​gnu/​bin/​sed'​ 
 +            [ -/usr/gnu/bin/​diff ​] && ​alias diff='/​usr/​gnu/​bin/​diff'​ 
 +            ​-e /​usr/​gnu/​bin/​tar ] && alias tar='/​usr/​gnu/​bin/​tar'​ 
 +            ​[ -e /​usr/​gnu/​bin/​rm ​] && ​alias rm='/usr/gnu/bin/​rm'​ 
 +        fi
   ​   ​
         # check for pkgsrc (smartos)         # check for pkgsrc (smartos)
         export PATH=$(echo $PATH | /bin/sed -r '​s#/​opt/​local/​s?​bin:##​g'​)         export PATH=$(echo $PATH | /bin/sed -r '​s#/​opt/​local/​s?​bin:##​g'​)
-        [ -d /opt/local/bin && ​export ​PATH=/​opt/​local/​bin:$PATH +        ​export MANPATH=$(echo $MANPATH | /bin/sed -r '​s#/​opt/​local/​man:##​g'​) 
-        [ -d /opt/local/sbin ] && [[ -n $WANT_SBIN ​]] && export PATH=/​opt/​local/​sbin:​$PATH +        if [ -d /opt/local ]; then 
-        ​[ -d /​opt/​local/​man ] && export MANPATH=/​opt/​local/​man:​$MANPATH+            ​export ​MANPATH=/​opt/​local/​man:$MANPATH 
 +            export ​PATH=/opt/local/bin:$PATH 
 +            ​[ -n $WANT_SBIN ] && export PATH=/​opt/​local/​sbin:​$PATH 
 +        ​fi
  
         # check for omniti repository (omnios)         # check for omniti repository (omnios)
         export PATH=$(echo $PATH | /bin/sed -r '​s#/​opt/​omni/​s?​bin:##​g'​)         export PATH=$(echo $PATH | /bin/sed -r '​s#/​opt/​omni/​s?​bin:##​g'​)
         export MANPATH=$(echo $MANPATH | /bin/sed -r '​s#/​opt/​omni/​share/​man:##​g'​)         export MANPATH=$(echo $MANPATH | /bin/sed -r '​s#/​opt/​omni/​share/​man:##​g'​)
-        [ -d /opt/omni/​bin ​&& export PATH=$PATH:/​opt/​omni/​bin +        ​if [ -d /opt/local ]; then 
-        [ -d /​opt/​omni/​sbin ] && [[ -n $WANT_SBIN ]] && export PATH=$PATH:/​opt/​omni/​sbin +            export MANPATH=$MANPATH:/​opt/​omni/​share/​man 
-        [ -d /​opt/​omni/​share/​man ] && ​export MANPATH=$MANPATH:/​opt/​omni/​share/​man +            export PATH=$PATH:/​opt/omni/bin 
- +            [ -n $WANT_SBIN ​] && export PATH=$PATH:/​opt/omni/sbin 
-        # check for sfw +        fi
-        ​export PATH=$(echo ​$PATH | /bin/sed -r 's#:/usr/sfw/s?bin##g') +
-        [ -d /​usr/​sfw/​bin ​] && export PATH=$PATH:/​usr/sfw/bin+
  
         # check for local         # check for local
         export PATH=$(echo $PATH | /bin/sed -r '​s#/​usr/​local/​s?​bin:##​g'​)         export PATH=$(echo $PATH | /bin/sed -r '​s#/​usr/​local/​s?​bin:##​g'​)
-        [ -d /usr/local/bin && ​export PATH=/​usr/​local/​bin:​$PATH +        ​if [ -d /usr/local ]; then 
-        [ -d /​usr/​local/​sbin ] && [[ -n $WANT_SBIN ​]] && export PATH=/​usr/​local/​sbin:​$PATH+            ​export PATH=/​usr/​local/​bin:​$PATH 
 +            [ -n $WANT_SBIN ] && export PATH=/​usr/​local/​sbin:​$PATH 
 +        fi
  
         # check for opencsw         # check for opencsw
         export PATH=$(echo $PATH | /bin/sed -r '​s#:/​opt/​csw/​s?​bin##​g'​)         export PATH=$(echo $PATH | /bin/sed -r '​s#:/​opt/​csw/​s?​bin##​g'​)
-        [ -d /opt/csw/bin && ​export PATH=$PATH:/​opt/​csw/​gnu:/​opt/​csw/​bin +        ​if [ -d /opt/csw ]; then 
-        [ -d /​opt/​csw/​sbin ] && [[ -n $WANT_SBIN ​]] && export PATH=$PATH:/​opt/​csw/​sbin+            ​export PATH=$PATH:/​opt/​csw/​gnu:/​opt/​csw/​bin 
 +            [ -n $WANT_SBIN ] && export PATH=$PATH:/​opt/​csw/​sbin 
 +        fi
  
         # colorization         # colorization
Line 353: Line 373:
           /​usr/​gnu/​bin/​grep) alias grep='​grep --color=auto'​ ;;           /​usr/​gnu/​bin/​grep) alias grep='​grep --color=auto'​ ;;
         esac         esac
- 
-        # selective gnu / colorization 
-        [ -e /​usr/​gnu/​bin/​grep ] && alias grep='/​usr/​gnu/​bin/​grep --color=auto'​ 
-        [ -e /​usr/​gnu/​bin/​sed ] && alias sed='/​usr/​gnu/​bin/​sed'​ 
-        [ -e /​usr/​gnu/​bin/​diff ] && alias diff='/​usr/​gnu/​bin/​diff'​ 
-        [ -e /​usr/​gnu/​bin/​tar ] && alias tar='/​usr/​gnu/​bin/​tar'​ 
-        [ -e /​usr/​gnu/​bin/​rm ] && alias rm='/​usr/​gnu/​bin/​rm'​ 
     ;; esac     ;; esac
     case $OSTYPE in openbsd*)     case $OSTYPE in openbsd*)
Line 712: Line 725:
  
     # include local aliases     # include local aliases
-    [[ -e ~/.aliases ]] && source ~/.aliases+    [[ -e ~/.aliases ]] && source ~/​.aliases ​|| true
 # }}} # }}}
 </​code>​ </​code>​
  
configuration/zsh.txt · Last modified: 2017/05/01 18:32 by sjorge