Last active
April 19, 2018 07:17
-
-
Save sigilioso/4171643 to your computer and use it in GitHub Desktop.
Custom prompt including git information
This file contains 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
export LANGUAGE==en_US.utf8 | |
export JAVA_HOME=/usr/lib/jvm/java-8-oracle | |
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash | |
source ~/.utils/git-completion.bash | |
# Only if docker installed | |
source /etc/bash_completion.d/docker | |
case "$TERM" in | |
xterm*) TERM=xterm-256color | |
esac | |
function git_dirty_state() { | |
if [ $(__gitdir) ]; then | |
[[ -n "$(git status --porcelain 2> /dev/null)" ]] && echo "✘" || echo "✔" | |
fi | |
} | |
PS1='\[\033[00;35m\][\[\033[00m\]\[\033[00;33m\]\u@\h:\[\033[00m\]\[\033[01;34m\]\w\[\033[00m\]\[\033[00;36m\]$(__git_ps1 "(%s)")$(git_dirty_state)\[\033[00m\]\[\033[00;35m\]]\[\033[00m\]\n\$ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment