Last active
May 29, 2018 01:24
-
-
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
This file contains hidden or 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
| # 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