0
0

.zshenv 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. ################################################################################
  2. # ZSH Configuration
  3. #
  4. # Note: in order for files in `~/.config` to be picked up, be sure to set the
  5. # global `XDG_*` and `ZDOTDIR` paths. On macOS, these are set at `/etc/zshenv`
  6. # or `~/.zshenv`), and look something like the following block:
  7. #
  8. # ```zsh
  9. # export XDG_CONFIG_HOME=$HOME/.config
  10. # export XDG_CACHE_HOME=$HOME/.cache
  11. # export XDG_DATA_HOME=$HOME/.local/share
  12. # export XDG_STATE_HOME=$HOME/.local/state
  13. # export XDG_RUNTIME_DIR=$HOME/.run
  14. # export XDG_DATA_DIRS=/usr/local/share:/usr/share
  15. # export XDG_CONFIG_DIRS=/etc/xdg
  16. # export ZDOTDIR=$XDG_CONFIG_HOME/zsh
  17. # if [ -f $ZDOTDIR/.zshenv ]; then source $ZDOTDIR/.zshenv; fi
  18. # ```
  19. #
  20. ################################################################################
  21. ################################################################################
  22. # Disable /etc/zprofile, /etc/zshrc, /etc/zlogin and /etc/zlogout
  23. ################################################################################
  24. unsetopt GLOBAL_RCS
  25. ################################################################################
  26. # $PATH and similar
  27. ################################################################################
  28. PATH="/bin:/sbin"
  29. PATH="${PATH}:/usr/local/bin"
  30. PATH="${PATH}:/opt/homebrew/sbin"
  31. PATH="${PATH}:/opt/homebrew/bin"
  32. PATH="${PATH}:/usr/bin"
  33. PATH="${PATH}:/usr/sbin"
  34. # Additional Homebrew items that aren't linked by default
  35. PATH="${PATH}:/opt/homebrew/opt/ruby/bin"
  36. PATH="${PATH}:/opt/homebrew/opt/libpq/bin"
  37. PATH="${PATH}:${HOME}/.scripts"
  38. export GOPATH="${HOME}/.go"
  39. PATH="${PATH}:${GOPATH}/bin"
  40. PATH="${PATH}:${HOME}/.gem/bin"
  41. PATH="${PATH}:${HOME}/.cargo/bin"
  42. PATH="${PATH}:${HOME}/.poetry/bin"
  43. PATH="${PATH}:${HOME}/.rvm/bin"
  44. # Run `path_helper`, and make its entries appear last, to preserve path ordering
  45. if [ -x /usr/libexec/path_helper ]; then
  46. oldpath="${PATH}"
  47. eval `/usr/libexec/path_helper -s`
  48. PATH="${oldpath}:${PATH}"
  49. fi
  50. # Remove duplicate entries
  51. typeset -U PATH
  52. export PATH
  53. ################################################################################
  54. # Miscellaneous configuration options
  55. ################################################################################
  56. export HOMEBREW_NO_ANALYTICS=1
  57. ################################################################################
  58. # Color palette and dark mode
  59. ################################################################################
  60. source $XDG_CONFIG_HOME/jonathandarker/palette.sh
  61. export LIGHTMODE_TOGGLE_FLAG_FILE="$XDG_RUNTIME_DIR/lightmode.toggled.flag"
  62. if [ -f $LIGHTMODE_TOGGLE_FLAG_FILE ]; then
  63. export JONATHANDARKER_COLOR_BG="$JONATHANDARKER_COLOR_15"
  64. export JONATHANDARKER_COLOR_BA="$JONATHANDARKER_COLOR_07"
  65. export JONATHANDARKER_COLOR_FG="$JONATHANDARKER_COLOR_00"
  66. export JONATHANDARKER_COLOR_FA="$JONATHANDARKER_COLOR_08"
  67. fi
  68. ################################################################################
  69. # Ports
  70. ################################################################################
  71. export SURFINGKEYS_SETTINGS_SERVER_PORT="21212"
  72. ################################################################################
  73. # Aliases
  74. ################################################################################
  75. alias n="nvim"
  76. alias lg="lazygit"
  77. alias ld="lazydocker"
  78. # git
  79. alias g="git"
  80. alias gs="git s"
  81. alias gl="git l"
  82. # ls
  83. alias ls="lsd -a"
  84. alias la="lsd -la"
  85. # clear
  86. alias c="clear && NEW_LINE_BEFORE_PROMPT=0"
  87. alias clear="clear && NEW_LINE_BEFORE_PROMPT=0"
  88. #python
  89. alias python="python3"
  90. alias py="python3"
  91. #granted
  92. alias assume=". assume"
  93. #brew
  94. alias brewdump="(cd $XDG_CONFIG_HOME/brew/ && brew bundle dump --force --describe)"
  95. ################################################################################
  96. # nvm
  97. # Lazy-loaded, using logic from https://github.com/undg/zsh-nvm-lazy-load
  98. ################################################################################
  99. export NVM_DIR="$HOME/.nvm"
  100. load-nvm() {
  101. [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
  102. [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
  103. }
  104. nvm() { unset -f nvm; load-nvm; nvm "$@" }
  105. node() { unset -f node; load-nvm; node "$@"; }
  106. npm() { unset -f npm; load-nvm; npm "$@"; }
  107. pnpm() { unset -f pnpm; load-nvm; pnpm "$@"; }
  108. yarn() { unset -f yarn; load-nvm; yarn "$@"; }
  109. ################################################################################
  110. # Private or system-specific environment variables
  111. ################################################################################
  112. if [ -f $ZDOTDIR/.zshenv.private ]; then
  113. source $ZDOTDIR/.zshenv.private
  114. fi