11# https://zsh.sourceforge.io/Contrib/startup/users/debbiep/dot.zshenv
22# Function to remove non-existent directories from array.
33rationalize-path () {
4- local element
5- local build
6- build=()
7- # Evil quoting to survive an eval and to make sure that
8- # this works even with variables containing IFS characters, if I'm
9- # crazy enough to setopt shwordsplit.
10- eval '
11- foreach element in "$' " $1 " ' [@]"
12- do
13- if [[ -d "$element" ]]
14- then
15- build=("$build[@]" "$element")
16- fi
17- done
18- ' " $1 " ' =( "$build[@]" )
19- '
4+ local element
5+ local build
6+ build=()
7+ # Evil quoting to survive an eval and to make sure that
8+ # this works even with variables containing IFS characters, if I'm
9+ # crazy enough to setopt shwordsplit.
10+ eval '
11+ foreach element in "$' " $1 " ' [@]"
12+ do
13+ if [[ -d "$element" ]]
14+ then
15+ build=("$build[@]" "$element")
16+ fi
17+ done
18+ ' " $1 " ' =( "$build[@]" )
19+ '
2020}
2121
2222# Set up additional paths
2323path+=(
24- ~ /.npm-global/bin
2524 ~ /.local/bin
26- ~ /.linuxbrew/bin
27- ~ /.linuxbrew/sbin
2825)
2926
3027rationalize-path path
@@ -33,11 +30,6 @@ typeset -U path
3330
3431# Set INFOPATH
3532typeset -T INFOPATH infopath
36- infopath+=(
37- ~ /.linuxbrew/share/info
38- )
39- rationalize-path infopath
40- typeset -U infopath
4133
4234# Set MANPATH
4335typeset -T MANPATH manpath
@@ -47,20 +39,47 @@ manpath+=(
4739rationalize-path manpath
4840typeset -U manpath
4941
50- source " $HOME /.cargo/env"
42+ if [ ! -f $HOME /.cargo/env ]
43+ then
44+ source " $HOME /.cargo/env"
45+ fi
46+
47+ # Set up pyenv
48+ if (( $+ commands[pyenv] ))
49+ then
50+ export PYENV_ROOT=" $HOME /.pyenv"
51+ path=($PYENV_ROOT /bin " $path [@]" )
52+ eval " $( pyenv init --path) "
53+ eval " $( pyenv init -) "
54+ eval " $( pyenv virtualenv-init -) "
55+ fi
56+
57+ # Set up linuxbrew
58+ if (( $+ commands[brew] ))
59+ then
60+ export HOMEBREW_PREFIX=~ /.linuxbrew
61+ export HOMEBREW_CELLAR=~ /.linuxbrew/Cellar
62+ export HOMEBREW_REPOSITORY=~ /.linuxbrew/Homebrew
63+ export HOMEBREW_SHELLENV_PREFIX=~ /.linuxbrew
5164
52- # Set up Brew
53- export HOMEBREW_PREFIX=~ /.linuxbrew
54- export HOMEBREW_CELLAR=~ /.linuxbrew/Cellar
55- export HOMEBREW_REPOSITORY=~ /.linuxbrew/Homebrew
56- export HOMEBREW_SHELLENV_PREFIX=~ /.linuxbrew
65+ path+=(
66+ ~ /.linuxbrew/bin
67+ ~ /.linuxbrew/sbin
68+ )
69+ rationalize-path path
70+ typeset -U path
71+
72+ infopath+=(
73+ ~ /.linuxbrew/share/info
74+ )
75+ rationalize-path infopath
76+ typeset -U infopath
77+ fi
78+
79+ # Set up cuda
80+ path=(/usr/local/cuda-11.6/bin " $path [@]" )
81+ export PYENV_VIRTUALENV_DISABLE_PROMPT=1
5782
5883# Source aliases
5984source $HOME /.aliases.zsh
6085
61- # Set up pyenv
62- export PYENV_ROOT=" $HOME /.pyenv"
63- path=($PYENV_ROOT /bin " $path [@]" )
64- eval " $( pyenv init --path) "
65- eval " $( pyenv init -) "
66- eval " $( pyenv virtualenv-init -) "
0 commit comments