Created
January 2, 2014 17:05
-
-
Save phile/8222457 to your computer and use it in GitHub Desktop.
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
# SEPARATOR | |
# ############################## | |
separator() { | |
w=$(stty size | cut -d" " -f2) # width of the terminal | |
for ((x = 0; x < w; x++)); do | |
printf '\e[0;90m'%s - #dark gray | |
done | |
} | |
# SOURCE A GIT COMPLETION SCRIPT | |
# ############################## | |
source ~/.git-completion.bash | |
source ~/.git-prompt.sh | |
CYAN="\[\033[0;36m\]" | |
LIGHT_CYAN="\[\033[0;96m\]" | |
RED="\[\033[0;31m\]" | |
LIGHT_RED="\[\033[0;91m\]" | |
YELLOW="\[\033[0;33m\]" | |
LIGHT_YELLOW="\[\033[0;93m\]" | |
MAGENTA="\[\033[0;35m\]" | |
LIGHT_MAGENTA="\[\033[0;95m\]" | |
BLUE="\[\033[34m\]" | |
LIGHT_GRAY="\[\033[0;37m\]" | |
DARK_GRAY="\[\033[0;90m\]" | |
GREEN="\[\033[0;32m\]" | |
WHITE="\[\033[0;97m\]" | |
GIT_PS1_SHOWDIRTYSTATE=true | |
export LS_OPTIONS='--color=auto' | |
export CLICOLOR='Yes' | |
export LSCOLORS=gxfxbEaEBxxEhEhBaDaCaD | |
# CUSTOM TERMINAL PROMPT | |
# ############################## | |
export PS1=$DARK_GRAY"\u"$WHITE"@"$DARK_GRAY"\h"'$( | |
if [[ $(__git_ps1) =~ \*\)$ ]] | |
# a file has been modified but not added | |
then echo "'$YELLOW'"$(__git_ps1 " (%s)") | |
elif [[ $(__git_ps1) =~ \+\)$ ]] | |
# a file has been added, but not commited | |
then echo "'$MAGENTA'"$(__git_ps1 " (%s)") | |
else | |
# the state is clean, changes are commited | |
echo "'$CYAN'"$(__git_ps1 " (%s)") | |
fi | |
)'$LIGHT_CYAN" \W"$WHITE": " | |
# UPDATE TITLE BAR WITH CURRENT FULL PATH | |
# ####################################### | |
PROMPT_COMMAND=' | |
echo -ne "\033]0;${PWD}\007" | |
separator | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment