-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshenv
161 lines (134 loc) · 3.92 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# return eary for non-interactive mode (e.g scp/rsync)
[[ "$-" =~ i ]] || return
[ -n "${SHOW_SOURCE:-}" ] && echo "====start scriptting $0===="
export _TTY=$TTY # for vim yank
[[ $PATH =~ "(:|^)/usr/sbin(:|$)" ]] || export PATH="$PATH:/usr/sbin"
[[ $PATH =~ "(:|^)/usr/local/bin(:|$)" ]] || export PATH="/usr/local/bin:$PATH"
case ${OSTYPE} in
darwin*)
export SHELL=/usr/local/bin/zsh
;;
linux*)
if [ -e "/usr/local/bin/zsh" ]; then
export SHELL=/usr/local/bin/zsh
else
export SHELL=/usr/bin/zsh
fi
;;
esac
# Colors
default=$(tput sgr0)
red=$(tput setaf 1)
green=$(tput setaf 2)
purple=$(tput setaf 5)
orange=$(tput setaf 9)
# Less colors for man pages
export PAGER=less
# Begin blinking
export LESS_TERMCAP_mb=$red
# Begin bold
export LESS_TERMCAP_md=$orange
# End mode
export LESS_TERMCAP_me=$default
# End standout-mode
export LESS_TERMCAP_se=$default
# Begin standout-mode - info box
export LESS_TERMCAP_so=$purple
# End underline
export LESS_TERMCAP_ue=$default
# Begin underline
export LESS_TERMCAP_us=$green
export MANPAGER=less
# unsetopt global_rcs avoid sourceing path_helper in /etc/z*
# /etc/zprofile do "eval `/usr/libexec/path_helper -s`"
unsetopt global_rcs
# export PATH="/usr/local/bin:$PATH"
export PATH="$HOME/.bin:$PATH"
# local
if [ -d "$HOME/.local/bin" ] ; then
export PATH="$HOME/.local/bin:$PATH"
fi
if which nvim >/dev/null 2>&1; then
export EDITOR=nvim
elif which vim >/dev/null 2>&1; then
export EDITOR=vim
fi
if [ -e ~/.fzf ]; then
export PAHT=$PATH:~/.fzf/bin
fi
if which starship >/dev/null 2>/dev/null; then
export STARSHIP_HOME=$HOME/.starship
[ -d "${STARSHIP_HOME}" ] || mkdir ${STARSHIP_HOME}
export STARSHIP_CONFIG=${STARSHIP_HOME}/config.toml
export STARSHIP_CACHE=${STARSHIP_HOME}/cache
fi
#python
# git clone https://github.com/pyenv/pyenv.git ~/.pyenv
if [[ -d $HOME/.pyenv ]] || (which pyenv > /dev/null 2>/dev/null) ; then
[ -n "${SHOW_SOURCE:-}" ] && echo init pyenv
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
fi
if (which pipenv >/dev/null 2>/dev/null); then
export PIPENV_VENV_IN_PROJECT=true
fi
# ruby
# git clone https://github.com/rbenv/rbenv.git ~/.rbenv
if [[ -d $HOME/.rbenv ]] ; then
export PATH=$HOME/.rbenv/bin:$PATH
eval "$(rbenv init -)"
fi
#rust
if [[ -d $HOME/.cargo ]] ; then
export PATH="$HOME/.cargo/bin:$PATH"
source $HOME/.cargo/env
fi
#go
export GOPATH=$HOME/go
export GO111MODULE=on
if [[ -d "/usr/local/go/bin" ]] ; then
export PATH="/usr/local/go/bin:$PATH"
fi
if [[ -d "$GOPATH/bin" ]] ; then
export PATH="$GOPATH/bin:$PATH"
fi
#direnv
if type direnv 1> /dev/null 2>&1; then
eval "$(direnv hook zsh)"
fi
#node
export N_PREFIX="$HOME/n"
[[ :$PATH: == *":$N_PREFIX/bin:"* ]] || PATH+=":$N_PREFIX/bin" # Added by n-install (see http://git.io/n-install-repo).
export MANPATH=/usr/local/man:/usr/local/share/man:/usr/share/man:/usr/man
if [[ -d "$HOME/.nodebrew" ]] ; then
export PATH="$HOME/.nodebrew/current/bin:$PATH"
export NODEBREW_ROOT=$HOME/.nodebrew
export NODEBREW_ROOT=/usr/local/var/nodebrew
export PATH=/usr/local/var/nodebrew/current/bin:$PATH
fi
if (which n >/dev/null 2>/dev/null); then
export PATH=$HOME/n/bin:$PATH
fi
if ! [[ :$PATH: == *".nvm"* ]]; then
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
fi
#npm
export PATH=$PATH:./node_modules/.bin
if [ -e "${KREW_ROOT:-$HOME/.krew}" ]; then
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
fi
#haskell
# PATH=$PATH:$HOME/.local/bin # bellow
# set stack ghc aliases
#alias ghci='stack ghci'
#alias ghc='stack ghc --'
#alias runghc='stack runghc --'
#export USE_CCACHE=1
#export CC='ccache gcc'
export LIBVIRT_DEFAULT_URI="qemu:///system"
export DOCKER_BUILDKIT=1
export ZPLUG_HOME=~/.zplug
[ -n "${SHOW_SOURCE:-}" ] && echo "====finish scriptting $0===="