-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc_extras
70 lines (55 loc) · 1.33 KB
/
.zshrc_extras
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
function unsetpath() {
if [ $1 ]
then
export PATH=$(echo $PATH | sed -e "s|${LOCAL_PATH}/${1}[^:]*:||g")
fi
}
# pyenv
function setpyenv() {
export PYENV_ROOT=$LOCAL_PATH/pyenv
export PATH=$PYENV_ROOT/bin:$PATH
eval "$(pyenv init -)"
}
setpyenv
# Conda
function setconda() {
unsetpath pyenv
unset -f pyenv
source $LOCAL_PATH/conda/etc/profile.d/conda.sh
conda activate
}
function unsetconda() {
conda deactivate
unsetpath conda
setpyenv
}
# "open" for linux
function open() {
xdg-open $1 &> /dev/null
}
# Use nvim instead of vim
alias vim=nvim
alias vimdiff="nvim -d"
# xclip to clipboard
alias pbcopy="xclip -selection clipboard"
alias pbpaste="xclip -out -selection clipboard"
# Ignore DS_Store files
export FIGNORE=DS_Store
# To avoid conda's bug (https://github.com/conda/conda/issues/7031) changing it
readonly HOST=$(cat /etc/hostname)
export HOST
# rbenv
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(~/.rbenv/bin/rbenv init - zsh)"
# sbt
export PATH=$LOCAL_PATH/sbt/bin:$PATH
# nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# rbenv
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
# use rake alias if it exists
type rake >/dev/null 2>&1 && alias rake="noglob rake"
# Spark
export SPARK_HOME=$LOCAL_PATH/spark