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 [2015/11/28 16:48]
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 ​20151228002+# 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
 +# - 20160219: fix - fix vncviewer alias
 # - 20151128: --- - cleanup and removal of old code # - 20151128: --- - cleanup and removal of old code
 # - 20151001: fix - support new pkgsrc layout on OSX # - 20151001: fix - support new pkgsrc layout on OSX
Line 82: 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 294: 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 307: 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 
-        [ -d /​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 
-        check for obd repository (omnios) + 
-        ​export PATH=$(echo $PATH | /​bin/​sed ​-r 's#/opt/obd/​s?​bin:##​g'​) +            selective gnu / colorization 
-        export MANPATH=$(echo $MANPATH | /​bin/​sed ​-r 's#/opt/obd/share/man:##g') +            ​[ ​-/usr/gnu/​bin/​sed ​] && alias sed='/usr/gnu/bin/sed
-        [ -/opt/obd/bin ] && ​export PATH=$PATH:/opt/obd/bin +            [ -/usr/gnu/bin/diff ] && ​alias diff='/usr/gnu/bin/diff' 
-        [ -/opt/obd/sbin ] && ​[[ -n $WANT_SBIN ]] && export PATH=$PATH:/opt/obd/sbin +            [ -/usr/gnu/bin/​tar ​] && ​alias tar='/usr/gnu/bin/​tar'​ 
-        [ -/opt/obd/share/man ] && ​export MANPATH=$MANPATH:/opt/obd/share/man+            [ -/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
-        ​[ "$(which ls)" = "/usr/bin/ls" ] && ​alias ls='ls --color'​ +        ​case $(which ls) in 
- +          ​/opt/local/bin/lsalias ls='ls --color' ​;; 
-        # selective gnu / colorization +          /usr/bin/lsalias ls='ls --color'​ ;; 
-        [ "​$(which ls)" = "/usr/gnu/bin/ls" ] && ​alias ls='/​usr/​gnu/​bin/​ls --color=auto'​ +          ​/​usr/​gnu/​bin/​ls) ls='ls --color=auto' ​;; 
-        ​[ -e /usr/gnu/​bin/​grep ​] && ​alias grep='/​usr/​gnu/​bin/​grep --color=auto'​ +        ​esac 
-        [ -e /​usr/​gnu/​bin/​sed ] && ​alias sed='/​usr/​gnu/​bin/​sed'​ +        case $(which grep) in 
-        [ -e /​usr/​gnu/​bin/​diff ] && alias diff='/​usr/​gnu/​bin/​diff'​ +          ​/opt/local/bin/grepalias grep='​grep --color=auto' ​;; 
-        [ -e /​usr/​gnu/​bin/​tar ] && alias tar='/​usr/​gnu/​bin/​tar'​ +          /​usr/​gnu/​bin/​grep) alias grep='grep --color=auto' ​;; 
-        ​[ -e /​usr/​gnu/​bin/​rm ] && alias rm='/​usr/​gnu/​bin/​rm'​+        ​esac
     ;; esac     ;; esac
     case $OSTYPE in openbsd*)     case $OSTYPE in openbsd*)
Line 410: Line 425:
         ​         ​
         ## helpers ​       ​         ## helpers ​       ​
-        function ​vncviewer() {+        function ​vnc() {
             which vncviewer &> /dev/null             which vncviewer &> /dev/null
             if [ $? -eq 0 ]; then             if [ $? -eq 0 ]; then
Line 710: 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