Skip to content

Instantly share code, notes, and snippets.

@orhanveli
Created June 23, 2015 08:13
Show Gist options
  • Select an option

  • Save orhanveli/b6a3c2fe940bfe58ad7d to your computer and use it in GitHub Desktop.

Select an option

Save orhanveli/b6a3c2fe940bfe58ad7d to your computer and use it in GitHub Desktop.
my .bashc
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
NO_COLOR="\[\033[0m\]"
GRAY="\[\033[38;5;250m\]"
PS1=" \[$(tput bold)\]\[$(tput sgr0)\]$YELLOW\u\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\]@\h: \[$(tput sgr0)\]$GRAY\w\[$(tput sgr0)\]\[\033[38;5;15m\] \\$ \[$(tput sgr0)\]"
# Add git branch if its present to PS1
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
if [ "$color_prompt" = yes ]; then
#PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ '
PS1=" \[$(tput bold)\]\[$(tput sgr0)\]$YELLOW\u\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\]@\h: \[$(tput sgr0)\]$GRAY\w\[$(tput sgr0)\]\[\033[38;5;15m\] $YELLOW\$(parse_git_branch)$NO_COLOR \\$ \[$(tput sgr0)\]"
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ '
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment