-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
46 lines (41 loc) · 1.1 KB
/
.bashrc
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
function prompt
{
# How many characters of the $PWD should be kept
local pwdmaxlen=30
# Indicator that there has been directory truncation:
local trunc_symbol="..."
if [ ${#PWD} -gt $pwdmaxlen ]
then
local pwdoffset=$(( ${#PWD} - $pwdmaxlen ))
newPWD="${trunc_symbol}${PWD:$pwdoffset:$pwdmaxlen}"
else
newPWD=${PWD}
fi
echo -n $newPWD
}
export PS1="\u@\h:\$(prompt)> "
source ~/.environment
source ~/.aliases
plat="$(uname -s)"
case "${plat}" in
Linux*)
if [ -f ~/.environment.linux ]; then
source ~/.environment.linux
fi
if [ -f ~/.aliases.linux ]; then
source ~/.aliases.linux
fi
;;
Darwin*)
if [ -f ~/.environment.darwin ]; then
source ~/.environment.darwin
fi
if [ -f ~/.aliases.darwin ]; then
source ~/.aliases.darwin
fi
;;
esac
if [ -f ~/.tmux/tmux-git/tmux-git.sh ]; then
source ~/.tmux/tmux-git/tmux-git.sh;
fi
source ~/.local_environment