forked from joaovitor/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenv
50 lines (42 loc) · 1018 Bytes
/
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
# mysql
export PATH=/usr/local/mysql/bin:$PATH
export EDITOR="vim"
export MANPAGER='less -Xr'
# rvm
if [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi
# preserve last path on new tabs
cd () {
builtin cd "$@";
local cwd;
cwd=$(pwd);
while :; do
if [[ -z "$cwd" ]] || [[ "$HOME" = "$cwd" ]] || [[ "/" = "$cwd" ]]; then
if [[ "$rvm_project_rvmrc_default" = 1 ]]; then
rvm default > /dev/null 2>&1;
fi;
break;
else
if [[ -f "$cwd/.rvmrc" ]]; then
source "$cwd/.rvmrc";
break;
else
cwd=$(dirname "$cwd");
fi;
fi;
done
echo $PWD > ~/.pwd;
}
if [[ -f ~/.pwd ]] ; then cd `cat ~/.pwd` ; fi
# User specific environment and startup programs
for i in $HOME/dotfiles/profile.d/*.sh ; do
if [ -x "$i" ]; then
. $i
fi
done
# Project specific environment and startup programs
for i in $HOME/dotfiles/projects.d/*.sh ; do
if [ -x "$i" ]; then
. $i
fi
done
export PATH=$HOME/bin:$PATH