forked from SkylarKelty/bash
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bash_git
More file actions
20 lines (18 loc) · 706 Bytes
/
.bash_git
File metadata and controls
20 lines (18 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
__vcs_name() {
$(git branch &>/dev/null;)
if [ $? -eq 0 ]; then
$(echo `git status` | grep "nothing to commit" > /dev/null 2>&1;)
if [ "$?" -eq "0" ]; then
echo -e "-\e[1m\e[90m[\033[0;34m$(__git_ps1 'git \033[0;92m%s\033[0;34m')\e[1m\e[90m]";
else
echo -e "-\e[1m\e[90m[\033[0;34m$(__git_ps1 'git \033[0;91m%s\033[0;34m')\e[1m\e[90m]";
fi
fi
}
black=$(tput -Txterm setaf 0)
green=$(tput -Txterm setaf 2)
yellow=$(tput -Txterm setaf 3)
bold=$(tput -Txterm bold)
reset=$(tput -Txterm sgr0)
# Fancy prompt
export PS1='\n\[$bold\]\[$black\][\[$green\]\u\[$yellow\]@\[$green\]\h\[$black\]]\[$reset\]$(__vcs_name)\n\[$reset\]\w\[$reset\]\$ '