-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.bashrc
74 lines (62 loc) · 1.52 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
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
RED="\[\e[00;31m\]"
GREEN="\[\e[00;32m\]"
YELLOW="\[\e[00;33m\]"
CYAN="\[\e[00;36m\]"
WHITE="\[\e[00;37m\]"
RESET="\[\e[0m\]"
git_status() {
STATUS=$(git status 2> /dev/null )
if [[ ${STATUS} =~ "Changes to be committed" ]]
then
GSTATUS="${GSTATUS}${GREEN}•${RESET}"
fi
if [[ ${STATUS} =~ "Untracked" ]] || [[ ${STATUS} =~ "Changes not staged for commit" ]]
then
GSTATUS="${GSTATUS}${RED}×${RESET}"
fi
if [[ -z ${GSTATUS} ]]
then
echo ""
else
echo " ${GSTATUS}"
fi
}
git_branch() {
if [[ -d .git ]] || git rev-parse --git-dir > /dev/null 2>&1
then
BRANCH=$(git rev-parse --abbrev-ref HEAD 2> /dev/null)
echo "${WHITE} (${BRANCH})${RESET}$(git_status)"
fi
}
tid() {
echo "[\t"]
}
user_and_host() {
echo "${GREEN}\u${RESET}${CWHITE}@${RESET}${GREEN}\h${RESET}"
}
colon_seperator() {
echo "${CWHITE}:${RESET}"
}
working_dir() {
echo "[${CYAN}\w${RESET}]"
}
divider() {
echo "${WHITE}❯${RESET}${GREEN}❯${RESET}${WHITE}❯${RESET}"
}
# Legacy: PS1="$(tid) $(user_and_host)$(working_dir)$(git_branch) $(divider) "
make_dat_ps1() {
PS1="$(user_and_host)$(working_dir)$(git_branch) $(divider) "
}
export CLICOLOR=1
export TERM=xterm-256color
export EDITOR=vim
export PROMPT_COMMAND=make_dat_ps1
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/bin:$GOPATH:/usr/local/go/bin:$HOME/bin
. ~/.aliases
. ~/.func
# Source variables you do not want version controlled
if [ -f ~/.boffline ]
then
. ~/.boffline
fi