-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
279 lines (228 loc) · 7.35 KB
/
.zshrc
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
export HOME=$HOME
export PROJECTS=$HOME/projects
export DOTFILES=$HOME/dotfiles
export BINPATH=$DOTFILES/bin
export PROGRAMS=$HOME/programs
#export PATH=$PATH:$BINPATH:$PROGRAMS/bin
# Misc program paths
export PATH=$PROGRAMS/ParaView-5.7.0-RC1-MPI-Linux-64bit/bin:$PATH
export PATH=$PROGRAMS/gmsh-4.3.0-Linux64/bin:$PATH
export PATH=/usr/local/MATLAB/R2017a/bin/:$PATH
# Project specific
export PATH=$PROJECTS/missile-datcom-itar/bin/Linux:$PATH
export PATH=$PROJECTS/rosetta/drivers:$PATH
export PATH=$PROJECTS/cws/cws/bin:$PATH
# Python startup
export PYTHONSTARTUP=~/.startup.py
export PYTHONPATH=$PYTHONPATH:/home/ijw/projects/meadow-python
export PYTHONPATH=$PYTHONPATH:/home/ijw/projects/rosetta
export PYTHONPATH=$PYTHONPATH:/home/ijw/projects/pymoo
# export PYTHONPATH=$PYTHONPATH:/home/ijw/programs/ParaView-5.7.0-RC1-MPI-Linux-64bit/lib
# export PYTHONPATH=$PYTHONPATH:/home/ijw/programs/ParaView-5.7.0-RC1-MPI-Linux-64bit/lib/python2.7/site-packages
# load oxide if it's available, if not default to sunaku
ZSH_THEME="theunraveler"
plugins=(git)
source $ZSH/oh-my-zsh.sh
## Keybind overwrites ##
bindkey '^[[1;5D' backward-word
bindkey '^[[1;5C' forward-word
bindkey '\e[3;5~' kill-word
bindkey '^H' backward-kill-word
## Aliases, Misc. Defaults ##
# emacs aliases
alias em='emacs -nw'
alias emz='emacs -nw ~/.zshrc'
alias emb='emacs -nw ~/.bashrc'
alias cz='code ~/.zshrc'
alias sz='source ~/.zshrc'
# git aliases
alias gdm='git diff master'
alias gcm='git checkout master'
alias gdno='git diff --name-only'
# misc alias
alias python='python3'
## Evironment Variables ##
export EDITOR='code'
## HEAT ##
export HEATPATH="$PROJECTS/heat"
export PATH="$PATH:$HEATPATH/build"
export PATH="$PATH:$PROJECTS/heat/tools/bash"
export PYTHONPATH="$PROJECTS/heat/tools/python:$PYTHONPATH"
## PREHEAT ##
export PREHEATPATH="$PROJECTS/preheat"
export PATH="$PATH:$PREHEATPATH/build"
## KOKKOS ##
export OMP_NUM_THREADS=8
export OMP_PROC_BIND=spread
export OMP_PLACES=threads
## OSG ##
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:$PROJECTS/OpenSceneGraph/lib"
export PATH="${PATH}:$PROJECTS/OpenSceneGraph/bin"
export OPENTHREADS_INC_DIR="/usr/local/include"
## CUDA ##
export CUDA_INSTALL_PATH="/usr/local/cuda-10.1"
export PATH="$CUDA_INSTALL_PATH/bin:$PATH"
export LD_LIBRARY_PATH="$CUDA_INSTALL_PATH/lib64:$LD_LIBRARY_PATH"
## FLITES ##
FLITES_VERSION="2.2.0"
export FLT2_DIR="/home/ijw/projects/flites-$FLITES_VERSION"
export FLT2_ARCH="linux_x64_rhel7"
export FLT2_ARCH="linux-x64"
export FLT2_LIBRARY_DIR="/home/ijw/projects/flites-$FLITES_VERSION/binaries/$FLT2_ARCH/lib"
export FLT2_BIN_DIR="/home/ijw/projects/flites-$FLITES_VERSION/binaries/$FLT2_ARCH/bin"
export FLT2_CXX11_ABI="0"
export PLPLOT_LIB="/home/ijw/projects/flites-$FLITES_VERSION/binaries/linux-x64/ext/share/plplot5.13.0"
export __GL_SYNC_TO_VBLANK="0"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:$FLT2_LIBRARY_DIR"
export PATH="${PATH}:$FLT2_BIN_DIR"
## MEADOW
export PATH=/home/ijw/projects/datcom/bin/Linux:$PATH
## VTK ##
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ijw/projects/matlab_c++_interop
## Extensions ##
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
. /usr/share/autojump/autojump.sh
## Functions ##
# create symlink of $1 by moving it to $DOTFILES and pointing back to it
symlink(){
[ -f $1 ] && echo "Linking $1 to $DOTFILES/$1" || { echo "$1 does not exist" && exit }
mv $1 $DOTFILES/$1
ln -s $DOTFILES/$1 $1
}
# remove flites .so because of cuda dependences
move_flites_library(){
mv $FLT2_LIBRARY_DIR/$1 $FLT2_LIBRARY_DIR/temp/$1
}
# build current project #
function b(){
if [[ $(pwd) == *"preheat"* ]]; then
PREHEAT_BUILD_PATH=$PREHEATPATH/build
jump_back=0
if [[ $(pwd) != $PREHEAT_BUILD_PATH ]]; then
jump_back=1
cd $PREHEAT_BUILD_PATH
fi
elif [[ $(pwd) == *"flites"* ]]; then
HEAT_FLITES_BUILD_PATH=$PROJECTS/heat-flites/build
jump_back=0
if [[ $(pwd) != $HEAT_FLITES_BUILD_PATH ]]; then
jump_back=1
cd $HEAT_FLITES_BUILD_PATH
fi
elif [[ $(pwd) == *"heat"* ]]; then
HEAT_BUILD_PATH=$HEATPATH/build
jump_back=0
if [[ $(pwd) != $HEAT_BUILD_PATH ]]; then
jump_back=1
cd $HEAT_BUILD_PATH
fi
fi
#make
make
result=$?
if [[ $jump_back == 1 ]]; then
cd -
fi
return $result
}
# build and run current project
function bnr(){
if [[ $(pwd) == *"osg"* ]]; then
cd ${PROJECTS}/osgsharedvector/build
make
if [[ $? == 0 ]]; then
./osgsharedvector
fi
elif [[ $(pwd) == *"flites"* ]]; then
no_return=0
if [[ $(pwd) == "${PROJECTS}/heat-flites" ]]; then
no_return=1
fi
# cd in heat-flights an make
cd ${PROJECTS}/heat-flites/build
cmake ..
make
res=$?
cd ${PROJECTS}/heat-flites
# if build successful, run
if [[ $res == 0 ]]; then
./build/heat-flites $1
fi
# return to prev directory if necessary
if [[ $no_return == 0 ]]; then
cd -
fi
elif [[ $(pwd) == *"heat"* ]]; then
no_return=0
if [[ $(pwd) == "${PROJECTS}/heat/build" ]]; then
no_return=1
fi
cd ${PROJECTS}/heat/build
make
if [[ $? == 0 ]]; then
# ./heat-flites
fi
if [[ $no_return == 0 ]]; then
cd -
fi
fi
}
# create new .sh file $1 in bin
function binscript(){
if [[ -f $BINPATH/$1.sh ]]; then
echo "File $1 already exists!"
exit 1
fi
printf "#!/bin/bash\n# $1 : " > $BINPATH/$1.sh
code $BINPATH/$1.sh
}
# open file in bin
function codebin(){
code $BINPATH/$1
}
#ripgrep src directory of current project
function rgsrc(){
search=$1
if [[ $(pwd) == *"flites"* ]]; then
src=/home/ijw/projects/heat-flites/src
elif [[ $(pwd) == *"preheat"* ]]; then
src=$PREHEATPATH/src
elif [[ $(pwd) == *"heat"* ]]; then
src=$HEATPATH/src
fi
rg $search $src
}
alias chmodbin='sudo chmod a+x $BINPATH/*'
alias visit='/usr/local/bin/visit/bin/visit'
alias rgfzf='rg . | fzf'
alias codetest='code Testing/Temporary/LastTest.log'
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/ijw/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/ijw/miniconda3/etc/profile.d/conda.sh" ]; then
. "/home/ijw/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/home/ijw/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
# Create the alias.
alias dmen='dmenu_run -nb "$color0" -nf "$color15" -sb "$color1" -sf "$color15"'
# conda activate py385
# export PATH=$PATH:/home/ijw/miniconda3/envs/py385/bin
# export PATH=/home/ijw/miniconda3/envs/py385/bin:$PATH
export CONDA_AUTO_ACTIVATE_BASE=false
conda activate base
# Import colorscheme from 'wal'
# Import the colors.
. "${HOME}/.cache/wal/colors.sh"
# wal --theme .config/wpg/schemes/_home_ijw__config_wpg_wallpapers_sea_side_jpg_dark_wal__1.1.0.json
# wal -i ~/Documents/Wallpapers/sea_side.jpg
(cat $HOME/.config/wpg/sequences &)