/
.env
143 lines (98 loc) · 3.01 KB
/
.env
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
# Environment Setup
# Shell Agnostic. Should work both with bash and zsh
###########################################################################################################################
# PATH
function prepend_path() {
# Does the alias only if the aliased program is installed
if [ -d $1 ]; then
export PATH="$1:$PATH"
fi
}
function append_path() {
# Does the alias only if the aliased program is installed
if [ -d $1 ]; then
export PATH="$PATH:$1"
fi
}
prepend_path "/usr/local/bin"
prepend_path "/usr/local/sbin"
prepend_path "$HOME/bin" # Custom scripts
prepend_path "$HOME/.secbin" # Secret custom scripts
prepend_path "$HOME/.local/bin"
prepend_path "/usr/local/opt/ruby/bin"
prepend_path "$HOME/.neovim/bin"
append_path "$HOME/.neovim/node/bin"
append_path "$HOME/.emacs.d/bin"
###########################################################################################################################
# PYTHON
# set PYTHONPATH for local user packages
export PYTHONPATH="$HOME/python-libs:$PYTHONPATH"
if [ -d "$HOME/.pyenv" ]; then
# Python from pyenv
export PYENV_ROOT="$HOME/.pyenv"
if command -v pyenv > /dev/null; then
eval "$(pyenv init -)";
fi
if command -v pyenv-virtualenv-init > /dev/null; then
eval "$(pyenv virtualenv-init -)";
fi
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
prepend_path "$PYENV_ROOT/bin" # PYENV binaries from
fi
###########################################################################################################################
# DEFAULT COLORS/PROGRAMS
# CLI colors
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
# Configure Editor
if command -v nvim > /dev/null; then
export EDITOR='nvim'
export VISUAL='nvim'
else
export EDITOR='vim'
export VISUAL='vim'
fi
###########################################################################################################################
# Misc Software
# Add GOPATH
export GOPATH=$HOME/go
export PATH=$PATH:"$GOPATH/bin"
# Rust Path init
export PATH="$HOME/.cargo/bin:$PATH"
# Fasd init
if command -v fasd > /dev/null; then
eval "$(fasd --init auto)"
fi
# Ansible
export ANSIBLE_NOCOWS=1
# Broot
BROOT=$HOME/.config/broot/launcher/bash/br
if [[ -f $BROOT ]]; then
source $BROOT
fi
export ET_NO_TELEMETRY=1
###########################################################################################################################
# OS specific
# So bash is brew's and not OS's
# export PATH="/usr/local/bin:$PATH"
case "$(uname -s)" in
Darwin)
# Matlab
# export PATH="$PATH:/Applications/MATLAB_R2017b.app/bin"
# export TERM="xterm-256color"
source $(brew --prefix asdf)/asdf.sh
;;
Linux)
# source $HOME/.config/broot/launcher/bash/br
;;
CYGWIN*|MINGW32*|MSYS*)
;;
# Add here more strings to compare
# See correspondence table at the bottom of this answer
*)
;;
esac
# LOCAL ENV
if [ -f ~/.local-env ]; then
source ~/.local-env
fi