.zshrc 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. ### Workaround for https://github.com/zplug/zplug/issues/397
  9. COMPINIT_ARGS=
  10. if [ "${UID}" = 0 ] && [ -n "${SUDO_UID}" ] ; then
  11. if ! grep -q COMPINIT_ARGS ~/.zplug/base/core/load.zsh ; then
  12. sed -i -r 's/^(\s+)compinit -d/\1compinit $COMPINIT_ARGS -d/' ~/.zplug/base/core/load.zsh
  13. fi
  14. COMPINIT_ARGS="-u"
  15. fi
  16. export COMPINIT_ARGS
  17. ###
  18. source ~/.zplug/init.zsh
  19. export ZSHDOTDIR=~/.zsh
  20. zplug "modules/archive", from:prezto
  21. zplug "modules/completion", from:prezto
  22. zplug "modules/directory", from:prezto
  23. zplug "modules/dpkg", from:prezto
  24. zplug "modules/editor", from:prezto
  25. zplug "modules/environment", from:prezto
  26. zplug "modules/terminal", from:prezto, defer:2
  27. zplug "modules/git", from:prezto
  28. zplug "modules/history", from:prezto
  29. zplug "modules/spectrum", from:prezto
  30. zplug "modules/rsync", from:prezto
  31. zplug "modules/autosuggestions", from:prezto
  32. zplug "modules/syntax-highlighting", from:prezto, defer:2
  33. zplug "modules/history-substring-search", from:prezto
  34. zplug "mafredri/zsh-async"
  35. zplug "chrissicool/zsh-256color"
  36. zplug "spaceship-prompt/spaceship-prompt", use:spaceship.zsh, from:github, as:theme
  37. if [[ -d "${ZSHDOTDIR}/config" ]]; then
  38. zplug "${ZSHDOTDIR}/config", from:local, defer:1
  39. fi
  40. if ! zplug check --verbose; then
  41. zplug install
  42. fi
  43. zplug load
  44. # Fixing zplug permissions while using 'sudo zsh'
  45. if [ "${UID}" = 0 ] && [ -n "${SUDO_UID}" ] ; then
  46. find ~/.zplug/ -not -user "${SUDO_UID}" -exec chown -R "${SUDO_UID}:${SUDO_GID}" {} \;
  47. fi