zshrc 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #
  2. # Zsh configuration file
  3. # Since 2006, kolter <kolter@openics.org>
  4. #
  5. # This file is distributed in the hope that it will be useful,
  6. # but WITHOUT ANY WARRANTY
  7. #
  8. # redefine PATH
  9. export PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin:/usr/games
  10. # define personal zsh config directory
  11. export DOTZSHDIR="$HOME/.zsh.d"
  12. # overide insecure stuff with compinit while using 'sudo zsh'
  13. # my functions (don't forget to modify fpath before call compinit !!)
  14. [ -z "$SUDO_USER" -a $UID != 0 ] && fpath=($DOTZSHDIR/functions.d $fpath)
  15. autoload -U zutil
  16. autoload -U compinit
  17. autoload -U complist
  18. compinit
  19. # include custom functions
  20. for f in $DOTZSHDIR/lib.d/*.zsh; do
  21. [ -r "$f" ] && source $f
  22. done
  23. # per OS resource file
  24. local os=$(uname)
  25. [ -r "$DOTZSHDIR/os.d/${os}.zsh" ] && source "$DOTZSHDIR/os.d/${os}.zsh"
  26. # sourcing config files
  27. for f in $DOTZSHDIR/config.d/*.zsh; do
  28. [ -r "$f" ] && source $f
  29. done
  30. # using 'sudo zsh'
  31. if [ "$SUDO_USER" -a $UID = 0 ]; then
  32. # define root history path
  33. export HISTFILE="$DOTZSHDIR/history/history_root"
  34. # ugly hack : reset some file perms to normal to avoid warnings
  35. chmod 0644 ~/.zcompdump
  36. chown $SUDO_USER:$SUDO_USER ~/.zcompdump
  37. fi
  38. # sourcing extra file
  39. [ -r "$DOTZSHDIR/extra.zsh" ] && source "$DOTZSHDIR/extra.zsh"