zshrc 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. # editor
  9. export EDITOR="emacs"
  10. # email address
  11. export EMAIL="kolter@openics.org"
  12. # email address for anonymous ftp
  13. export EMAIL_ADDR=pwet@dev.null
  14. # redefine PATH
  15. export PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin:/usr/games
  16. # define personal zsh config directory
  17. export DOTZSHDIR="$HOME/.zsh.d"
  18. # checking events on system (users login/logout, etc...)
  19. watch=(notme)
  20. LOGCHECK=5
  21. WATCHFMT="[%T] %n has %a %l from %M"
  22. # overide insecure stuff with compinit while using 'sudo zsh'
  23. # my functions (don't forget to modify fpath before call compinit !!)
  24. [ -z "$SUDO_USER" -a $UID != 0 ] && fpath=($DOTZSHDIR/functions.d $fpath)
  25. autoload -U zutil
  26. autoload -U compinit
  27. autoload -U complist
  28. compinit
  29. # override default umask
  30. umask 0022
  31. # sourcing resource files
  32. for f in $DOTZSHDIR/config.d/*.zsh; do
  33. [ -r "$f" ] && source $f
  34. done
  35. # per OS resource file
  36. local os=$(uname)
  37. [ -r "$DOTZSHDIR/os.d/${os}.zsh" ] && source "$DOTZSHDIR/os.d/${os}.zsh"
  38. # using 'sudo zsh'
  39. if [ "$SUDO_USER" -a $UID = 0 ]; then
  40. # define root history path
  41. export HISTFILE="/root/.zsh_history"
  42. # ugly hack : reset some file perms to normal to avoid warnings
  43. chmod 0644 ~/.zcompdump
  44. chown $SUDO_USER:$SUDO_USER ~/.zcompdump
  45. fi
  46. # sourcing extra file
  47. [ -r "$DOTZSHDIR/extra.zsh" ] && source "$DOTZSHDIR/extra.zsh"