zshrc 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. if [ -n "$APPSHOME" ] ; then
  18. export DOTZSHDIR="$APPSHOME/.zsh.d"
  19. else
  20. export DOTZSHDIR="$HOME/.zsh.d"
  21. fi
  22. # checking events on system (users login/logout, etc...)
  23. watch=(notme)
  24. LOGCHECK=5
  25. WATCHFMT="[%T] %n has %a %l from %M"
  26. # overide insecure stuff with compinit while using 'sudo zsh'
  27. # my functions (don't forget to modify fpath before call compinit !!)
  28. [ -z "$SUDO_USER" -a $UID != 0 ] && fpath=($DOTZSHDIR/functions.d $fpath)
  29. autoload -U zutil
  30. autoload -U compinit
  31. autoload -U complist
  32. compinit
  33. # override default umask
  34. umask 0022
  35. # sourcing resource files
  36. for f in $DOTZSHDIR/config.d/*.zsh; do
  37. [ -r "$f" ] && source $f
  38. done
  39. # per OS resource file
  40. local os=$(uname)
  41. [ -r "$DOTZSHDIR/os.d/${os}.zsh" ] && source "$DOTZSHDIR/os.d/${os}.zsh"
  42. # using 'sudo zsh'
  43. if [ "$SUDO_USER" -a $UID = 0 ]; then
  44. # define root history path
  45. export HISTFILE="$DOTZSHDIR/history/history_root"
  46. # ugly hack : reset some file perms to normal to avoid warnings
  47. chmod 0644 ~/.zcompdump
  48. chown $SUDO_USER:$SUDO_USER ~/.zcompdump
  49. fi
  50. # sourcing extra file
  51. [ -r "$DOTZSHDIR/extra.zsh" ] && source "$DOTZSHDIR/extra.zsh"