-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.zshenv
126 lines (110 loc) · 3.99 KB
/
.zshenv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# ---------------------------------------------
# Profile
# ---------------------------------------------
# Uncomment the line below and start a new shell. Don't forget to uncomment the
# `zprof` on .zshrc
# zmodload zsh/zprof
ZSH_DISABLE_COMPFIX=true
# set -o noclobber
# True color
export COLORTERM='truecolor'
if [ $(command -v vivid) ]; then
export LS_COLORS=$(vivid generate ayu)
fi
# ---------------------------------------------
# Environment
# ---------------------------------------------
# export ZDOTDIR="${${(%):-%N}:A:h}"
export ZDOTDIR="$HOME/.zsh"
export ZPLUG_HOME="${HOME}/.zplug"
export ZPLUG_THREADS=32
export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
export XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
export XDG_DATA_HOME=${XDG_DATA_HOME_HOME:-$HOME/.local/share}
export RUSTUP_HOME="${XDG_DATA_HOME}/rustup"
export CARGO_HOME="${XDG_DATA_HOME}/cargo"
# export ZSH=$HOME/.oh-my-zsh
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# ---------------------------------------------
# Homebrew
# ---------------------------------------------
export HOMEBREW_INSTALL_BADGE="🍄"
# M1 Macs will install to /opt/homebrew
if [[ -d /opt/homebrew ]]; then
export HOMEBREW_PREFIX=${HOMEBREW_PREFIX:-"/opt/homebrew"}
export HOMEBREW_CELLAR=${HOMEBREW_CELLAR:-"/opt/homebrew/Cellar"}
export HOMEBREW_REPOSITORY=${HOMEBREW_REPOSITORY:-"/opt/homebrew"}
fi
# Intel Macs will install to /usr/local
if [[ -d /usr/local ]]; then
export HOMEBREW_PREFIX=${HOMEBREW_PREFIX:-"/usr/local"}
export HOMEBREW_CELLAR=${HOMEBREW_CELLAR:-"/usr/local/Cellar"}
export HOMEBREW_REPOSITORY=${HOMEBREW_REPOSITORY:-"/usr/local/Homebrew"}
fi
export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_FORCE_BREWED_GIT=1
# ---------------------------------------------
# Telemetry
# ---------------------------------------------
export DO_NOT_TRACK=1
export GATSBY_TELEMETRY_DISABLED=1
# ---------------------------------------------
# Python
# ---------------------------------------------
export PYTHONSTARTUP="${HOME}/.pyrc.py"
# ---------------------------------------------
# Direnv
# ---------------------------------------------
if [ $(command -v direnv) ]; then
export NODE_VERSIONS="${HOME}/.node-versions"
export NODE_VERSION_PREFIX=""
eval "$(direnv hook zsh)"
fi
# ---------------------------------------------
# HUB
# ---------------------------------------------
if [ $(command -v hub) ]; then
eval "$(hub alias -s)"
fi
# ---------------------------------------------
# Others
# ---------------------------------------------
export BAT_CONFIG_PATH="${HOME}/.batrc"
export RIPGREP_CONFIG_PATH="${HOME}/.rgrc"
# Supress some npm ads
export ADBLOCK=1
# macOSX sdk path
export SDKROOT=$(xcrun -sdk macosx --show-sdk-path)
# ---------------------------------------------
# Environment settings
# ---------------------------------------------
export OSTYPE=$(uname -s)
export HOSTNAME=$(hostname)
export DOTFILES="${HOME}/dotfiles"
export GOPATH="${HOME}/.go"
export GOBIN="${GOPATH}/bin"
export PROJECTS="${HOME}/Projects"
export NOTES_DIR="${HOME}/Documents/notes"
export ZK_NOTEBOOK_DIR="$NOTES_DIR"
# I use a single zk notes dir, so set it and forget
export ZK_NOTEBOOK_DIR=$NOTES_DIR
export GPG_TTY=`tty`
# Always work in a tmux session if tmux is installed
if which tmux 2>&1 >/dev/null; then
if [ $TERM != "screen-256color" ] && [ $TERM != "screen" ]; then
tmux attach -t hack || tmux new -s hack; exit
fi
fi
# Ensure that a non-login, non-interactive shell has a defined environment.
# (Only once) if it was not sourced before, becuase .zshenv is always sourced
if [[ ( "$SHLVL" -eq 1 && ! -o LOGIN ) && -s "${ZDOTDIR:-${HOME}/dotfiles/zsh}/.zprofile" ]]; then
source "${ZDOTDIR:-${HOME}/dotfiles/zsh}/.zprofile"
fi
if [[ -f ${HOME}/.zshenv.local ]]; then
source ${HOME}.zshenv.local
fi
if [[ -d $CARGO_HOME ]]; then
source $CARGO_HOME/env
fi
source $HOMEBREW_PREFIX/opt/spaceship/spaceship.zsh