.zshenv 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. ################################################################################
  2. # $PATH and similar
  3. ################################################################################
  4. export GOPATH="$HOME/.go"
  5. # Add to path without duplicates
  6. function add_to_path {
  7. if [[ ! ":$PATH:" == *":$1:"* ]]; then
  8. if [ "$2" = true ] ; then
  9. PATH=":$1:$PATH:"
  10. else
  11. PATH="$PATH:$1:"
  12. fi
  13. PATH=${PATH/::/:/.}
  14. if [[ "$PATH" == ":"* ]]; then
  15. PATH="${PATH:1}"
  16. fi
  17. if [[ "$PATH" == *":" ]]; then
  18. PATH="${PATH::-1}"
  19. fi
  20. fi
  21. }
  22. add_to_path "/usr/local/bin/" true
  23. add_to_path "/opt/homebrew/sbin" true
  24. add_to_path "/opt/homebrew/bin" true
  25. # Additional Homebrew items that aren't linked by default
  26. add_to_path "/opt/homebrew/opt/ruby/bin"
  27. add_to_path "/opt/homebrew/opt/libpq/bin"
  28. add_to_path "${HOME}/.scripts"
  29. add_to_path "${GOPATH}/bin"
  30. add_to_path "${HOME}/.gem/bin"
  31. add_to_path "${HOME}/.cargo/bin"
  32. add_to_path "${HOME}/.poetry/bin"
  33. add_to_path "${HOME}/.rvm/bin"
  34. export PATH
  35. ################################################################################
  36. # Miscellaneous configuration options
  37. ################################################################################
  38. export HOMEBREW_NO_ANALYTICS=1
  39. ################################################################################
  40. # Color palette and dark mode
  41. ################################################################################
  42. source $XDG_CONFIG_HOME/jonathandarker/palette.sh
  43. export LIGHTMODE_TOGGLE_FLAG_FILE="$XDG_RUNTIME_DIR/lightmode.toggled.flag"
  44. if [ -f $LIGHTMODE_TOGGLE_FLAG_FILE ]; then
  45. export JONATHANDARKER_COLOR_BG="$JONATHANDARKER_COLOR_15"
  46. export JONATHANDARKER_COLOR_BA="$JONATHANDARKER_COLOR_07"
  47. export JONATHANDARKER_COLOR_FG="$JONATHANDARKER_COLOR_00"
  48. export JONATHANDARKER_COLOR_FA="$JONATHANDARKER_COLOR_08"
  49. fi
  50. ################################################################################
  51. # Ports
  52. ################################################################################
  53. export SURFINGKEYS_SETTINGS_SERVER_PORT="21212"
  54. ################################################################################
  55. # Aliases
  56. ################################################################################
  57. alias n="nvim"
  58. alias lg="lazygit"
  59. alias ld="lazydocker"
  60. # git
  61. alias g="git"
  62. alias gs="git s"
  63. alias gl="git l"
  64. # ls
  65. alias ls="lsd -a"
  66. alias la="lsd -la"
  67. # clear
  68. alias c="clear && NEW_LINE_BEFORE_PROMPT=0"
  69. alias clear="clear && NEW_LINE_BEFORE_PROMPT=0"
  70. #python
  71. alias python="python3.13"
  72. alias py="python3.13"
  73. #granted
  74. alias assume=". assume"
  75. #brew
  76. alias brewdump="(cd $XDG_CONFIG_HOME/brew/ && brew bundle dump --force --describe)"
  77. ################################################################################
  78. # nvm
  79. # Lazy-loaded, using logic from https://github.com/undg/zsh-nvm-lazy-load
  80. ################################################################################
  81. export NVM_DIR="$HOME/.nvm"
  82. load-nvm() {
  83. [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
  84. [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
  85. }
  86. nvm() { unset -f nvm; load-nvm; nvm "$@" }
  87. node() { unset -f node; load-nvm; node "$@"; }
  88. npm() { unset -f npm; load-nvm; npm "$@"; }
  89. pnpm() { unset -f pnpm; load-nvm; pnpm "$@"; }
  90. yarn() { unset -f yarn; load-nvm; yarn "$@"; }
  91. ################################################################################
  92. # Private or system-specific environment variables
  93. ################################################################################
  94. source $ZDOTDIR/.zshenv.private