.zshenv 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # .zshenv
  2. #
  3. # Shared PATH discovery, history management, etc. across all machines.
  4. # .zshrc.local is reserved for per-machine customization.
  5. ### grml ###
  6. ## git
  7. # https://www.pedaldrivenprogramming.com/2018/09/customize-grml-zsh-config/
  8. autoload -U colors && colors
  9. zstyle ':vcs_info:*' enable git
  10. zstyle ':vcs_info:*' check-for-changes true
  11. zstyle ':vcs_info:*' unstagedstr '!'
  12. zstyle ':vcs_info:*' stagedstr '+'
  13. zstyle ':vcs_info:git*' formats "%{${fg[cyan]}%}[%{${fg[blue]}%}%b%{${fg[yellow]}%}%m%u%c%{${fg[cyan]}%}]%{$reset_color%}"
  14. ### PATH ###
  15. pathappend() {
  16. for ARG in "$@"
  17. do
  18. if [ -d "$ARG" ] && [[ ":$PATH:" != *":$ARG:"* ]]; then
  19. PATH="${PATH:+"$PATH:"}$ARG"
  20. fi
  21. done
  22. }
  23. pathappend \
  24. "$HOME/.local/bin" \
  25. "$HOME/.pyenv/bin" \
  26. "/usr/sbin" \
  27. "/usr/local/go/bin" \
  28. "$HOME/.config/emacs/bin" \
  29. "$HOME/.cargo/bin" \
  30. "$HOME/go/bin"
  31. if [ -d "$HOME/.pyenv/bin" ]; then
  32. eval "$(pyenv init -)"
  33. eval "$(pyenv virtualenv-init -)"
  34. fi
  35. if [ -d "$HOME/.bun" ]; then
  36. export BUN_INSTALL="$HOME/.bun"
  37. export PATH="$BUN_INSTALL/bin:$PATH"
  38. [ -s "/home/josh/.bun/_bun" ] && source "/home/josh/.bun/_bun"
  39. fi
  40. bindkey '^ ' autosuggest-accept
  41. ### History ###
  42. export HISTFILE=~/.histfile
  43. # Ignore duplicates in history
  44. setopt HIST_IGNORE_DUPS
  45. # Delete old recorded entry if new entry is a duplicate.
  46. setopt HIST_IGNORE_ALL_DUPS