Last active
December 25, 2019 18:17
-
-
Save behnammodi/0771fb79d101212784d42c7e090bdbdf to your computer and use it in GitHub Desktop.
.bash_profile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git branch in prompt. | |
function parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
function number_of_uncommited(){ | |
git status -s 2> /dev/null | wc -l | awk '{$1=$1};1' | grep -v "^0" | |
} | |
function color_blue(){ | |
echo -e "\033[34m$1\033[00m" | |
} | |
function color_green(){ | |
echo -e "\033[32m$1\033[00m" | |
} | |
function text_bold(){ | |
echo -e "\033[1m$1\033[21m" | |
} | |
function text_blink(){ | |
echo -e "\033[5m$1\033[25m" | |
} | |
export PS1="\u@\h 📂 \W \$(color_green \$(parse_git_branch)) \$(text_bold \$(text_blink \$(color_blue \$(number_of_uncommited)))) ❯ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Features