Skip to content

Instantly share code, notes, and snippets.

@batoreh
Created June 22, 2017 14:43
Show Gist options
  • Save batoreh/6db0597bfd25dd0ebbfb15a5e8c2b43e to your computer and use it in GitHub Desktop.
Save batoreh/6db0597bfd25dd0ebbfb15a5e8c2b43e to your computer and use it in GitHub Desktop.
export EDITOR=/usr/bin/vim
test -s ~/.alias && . ~/.alias || true
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
branch_name() {
git branch 2> /dev/null | grep "\*" | cut -b 3-
}
branch_changes() {
CHANGES=$(git status 2> /dev/null | wc -l)
if [ "$CHANGES" -gt 4 ]
then
STR_CHANGES="*"
else
STR_CHANGES=""
fi
echo "$STR_CHANGES"
}
export PS1="\W \[$(tput sgr0)\]\$(branch_name)\$(branch_changes) \[\033[38;5;133m\]\\$\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment