.zshrc 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. # define personal zsh config directory
  9. export ZSHDOTDIR="${HOME}/.zsh"
  10. # redefine PATH
  11. export PATH="${HOME}/bin:${HOME}/.bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
  12. # load prezto
  13. BUNDLES_ROOT="${ZSHDOTDIR}/bundles"
  14. PREZTO_INIT="${BUNDLES_ROOT}/prezto/init.zsh"
  15. if [ -f "${PREZTO_INIT}" ]; then
  16. export ZDOTDIR="${BUNDLES_ROOT}"
  17. source "${PREZTO_INIT}"
  18. unset ZDOTDIR
  19. fi
  20. unset BUNDLES_ROOT PREZTO_INIT
  21. # overide insecure stuff with compinit while using 'sudo zsh'
  22. # my functions (don't forget to modify fpath before call compinit !!)
  23. #if [ -z "$SUDO_USER" -a "$UID" != 0 ]; then
  24. # fpath=($ZSHDOTDIR/functions.d $fpath)
  25. #fi
  26. # include custom configuration
  27. for f in ${ZSHDOTDIR}/config/*.zsh; do
  28. if [[ -r "${f}" ]]; then
  29. . "${f}"
  30. fi
  31. done
  32. # using 'sudo zsh'
  33. if [ "$SUDO_USER" -a "$UID" = 0 ]; then
  34. # define root history path
  35. export HISTFILE="$ZSHDOTDIR/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