zshrc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. # special case
  26. [ "$os" = "GNU/kFreeBSD" ] && os="Linux"
  27. [ -r "$DOTZSHDIR/os.d/${os}.zsh" ] && source "$DOTZSHDIR/os.d/${os}.zsh"
  28. # sourcing config files
  29. for f in $DOTZSHDIR/config.d/*.zsh; do
  30. [ -r "$f" ] && source $f
  31. done
  32. # using 'sudo zsh'
  33. if [ "$SUDO_USER" -a $UID = 0 ]; then
  34. # define root history path
  35. export HISTFILE="$DOTZSHDIR/history/history_root"
  36. # ugly hack : reset some file perms to normal to avoid warnings
  37. chmod 0644 ~/.zcompdump
  38. chown $SUDO_USER:$SUDO_USER ~/.zcompdump
  39. fi
  40. # sourcing extra file
  41. [ -r "$DOTZSHDIR/extra.zsh" ] && source "$DOTZSHDIR/extra.zsh"