Skip to content

Instantly share code, notes, and snippets.

@niamurrell
Last active May 29, 2018 01:24
Show Gist options
  • Save niamurrell/f7e4d4a8c45817f2658f997d0c8d4d53 to your computer and use it in GitHub Desktop.
Save niamurrell/f7e4d4a8c45817f2658f997d0c8d4d53 to your computer and use it in GitHub Desktop.
Set colors, create function to get current git branch, and export prompt script to command line
# Colors
Color_Off="\[\033[0m\]" # Text Reset
Blue="\[\033[0;34m\]" # Blue
Cyan="\[\033[0;36m\]" # Cyan
BrightBlue="\[\033[0;94m\]" # Bright Blue
# Git branch function
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# Format prompt script
export PS1="$BrightPurple\h$Purple:\W$Cyan\$(parse_git_branch)$Color_Off \u$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment