-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshenv
executable file
·106 lines (87 loc) · 2.7 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
## SOME PATH SETTING FUNCTIONS
# ADD NEW ELEMENTS TO A PATH VARIABLE, AVOIDING DUPLICATES
xpathadd() {
local VAR="$1"
local DIR="$2"
if [ -d "$DIR" ] && [[ ":${(P)VAR}:" != *":$DIR:"* ]]; then
eval "export $VAR=\"${(P)VAR:+\"\$$VAR:\"}$DIR\""
fi
}
# THE SAME, BUT ADDING TO THE START INSTEAD OF THE END OF THE PATH VAR
xpathprepend() {
local VAR="$1"
local DIR="$2"
if [ -d "$DIR" ] && [[ ":${(P)VAR}:" != *":$DIR:"* ]]; then
eval "export $VAR=\"$DIR${(P)VAR:+\":\$$VAR\"}\""
fi
}
# SPECIFICALLY, ADD ELEMENTS TO the end of $PATH
pathadd() {
xpathadd "PATH" "${1}"
}
# OR TO THE START
pathprepend() {
xpathprepend "PATH" "${1}"
}
## OLD VERSION WITH PATH HARD-CODED (from here: https://superuser.com/a/39995)
# pathadd() {
# if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
# export PATH="${PATH:+"$PATH:"}$1"
# fi
# }
# ADD ELEMENTS TO $MANPATH, including a leading colon if $MANPATH is empty, so that we don't overwrite the defaults available from `manpath`.
manadd() {
# Check if $MANPATH has a value already; if it doesn't, then we add the initial colon before adding the new value
if [ -n "$MANPATH" ]; then
xpathadd "MANPATH" "${1}"
else
export MANPATH=":${1}"
fi
}
infoadd() {
# Check if $INFOPATH has a value already; if it doesn't, then we add the initial colon before adding the new value
if [ -n "$INFOPATH" ]; then
xpathadd "INFOPATH" "${1}"
else
export INFOPATH=":${1}"
fi
}
# Some variables
export DEFAULT_USER='jamief'
## ADDING TO $PATH
# local bin file
pathadd "$HOME/.local/bin"
# Emacs
pathadd "$HOME/.emacs.d/bin"
pathadd "$HOME/.config/emacs/bin"
# My homebrew scripts
pathadd "$HOME/Dropbox/git/scripts"
# Running Stanza locally
pathadd "$HOME/stanza-parsing"
# TeX Live
manadd "/usr/local/texlive/2023/texmf-dist/doc/man"
infoadd "/usr/local/texlive/2023/texmf-dist/doc/info"
pathprepend "/usr/local/texlive/2023/bin/x86_64-linux"
# Pyenv
pathadd "$PYENV_ROOT/bin"
pathadd "$HOME/.pyenv/bin"
# Ruby
pathadd "$HOME/.rbenv/bin"
# Go
pathadd "/usr/local/go/bin"
# Hugo
pathadd "$HOME/hugo"
# Spicetify
pathadd "$HOME/.spicetify"
# XLE
export XLEPATH="/home/jamief/.local/bin/xle"
pathadd "${XLEPATH}/bin"
export LD_LIBRARY_PATH=${XLEPATH}/lib:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=${XLEPATH}/lib:$DYLD_LIBRARY_PATH
export TCLLIBPATH=${XLEPATH}/tcl/scripts/tcl
export TCL_LIBRARY=${XLEPATH}/tcl/scripts/tcl
export TKLIBPATH=${XLEPATH}/tcl/scripts/tk
export TK_LIBRARY=${XLEPATH}/tcl/scripts/tk
# Stanford CoreNLP Java JAR
xpathadd "CLASSPATH" "$HOME/stanford-corenlp/stanford-corenlp-4.5.6"
# export CLASSPATH="$HOME/stanford-corenlp/stanford-corenlp-4.5.6/stanford-corenlp-4.5.6.jar"