dotfiles/.bashrc

34 lines
850 B
Bash
Raw Normal View History

2016-01-19 15:10:51 -06:00
prompt_command() {
retval=$?
branch="";
clean="";
numcolor="\[\e[0;33m\]"
red="\[\e[0;31m\]"
sepcolor="\[\e[1;30m\]"
yellow="\[\e[0;33m\]"
brightyellow="\[\e[1;33m\]"
brightblue="\[\e[1;34m\]"
default="\[\e[0m\]"
green="\[\e[0;32m\]"
if [[ $retval != 0 ]]; then
numcolor="\[\e[1;41;33m\]"
fi
if git branch &>/dev/null; then
2016-01-19 15:24:54 -06:00
branch="$green$(git branch 2>/dev/null | grep \* | cut -d ' ' -f 2-)"
2016-01-19 15:10:51 -06:00
clean=$(git status | grep clean)
if [ -z "$clean" ]; then clean="${red}"; else clean=""; fi
fi
2016-01-19 15:24:54 -06:00
PS1="${debian_chroot:+($debian_chroot)}$numcolor\!$red \u$sepcolor@${brightblue}\h${default}:${branch}${clean} $default\w$green\$${default} "
2016-01-19 15:10:51 -06:00
unset clean numcolor branch retval
}
PROMPT_COMMAND=prompt_command
eval "$(thefuck --alias fixit)"
set -o vi