Skip to content

Instantly share code, notes, and snippets.

@nickiaconis
Last active December 25, 2016 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickiaconis/dc41e09c608b877d10f1 to your computer and use it in GitHub Desktop.
Save nickiaconis/dc41e09c608b877d10f1 to your computer and use it in GitHub Desktop.
BashGitPrompt Rainbow Theme
# Add this to ~/.bash_profile or ~./bashrc
# If installed via Homebrew:
if [ -f "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" ]; then
source "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh"
fi
# If installed via Git clone:
source ~/.bash-git-prompt/gitprompt.sh
# Save this to ~/.git-prompt-colors.sh
# Formatting in prompt
BOLD="\[$(tput bold)\]"
UNDERLINE="\[$(tput smul)\]"
INVERT="\[$(tput rev)\]"
RESET="\[$(tput sgr0)\]"
# Colors in prompt
BLACK="\[$(tput setaf 0)\]"
RED="\[$(tput setaf 9)\]"
ORANGE="\[$(tput setaf 172)\]"
GREEN="\[$(tput setaf 10)\]"
YELLOW="\[$(tput setaf 11)\]"
BLUE="\[$(tput setaf 32)\]"
PURPLE="\[$(tput setaf 99)\]"
MAGENTA="\[$(tput setaf 13)\]"
CYAN="\[$(tput setaf 14)\]"
WHITE="\[$(tput setaf 15)\]"
RAINBOW_PROMPT="${RED}\u${ORANGE}@${YELLOW}\h ${GREEN}\$(dirname \$PWD)${BLUE}/\$(basename \$PWD)${RESET}"
override_git_prompt_colors() {
GIT_PROMPT_THEME_NAME="Rainbow"
GIT_PROMPT_PREFIX="(" # start of the git info string
GIT_PROMPT_SUFFIX=")" # the end of the git info string
GIT_PROMPT_BRANCH="${PURPLE}" # the git branch that is active in the current directory
GIT_PROMPT_STAGED="${GREEN}●" # the number of staged files/directories
GIT_PROMPT_CONFLICTS="${RED}○" # the number of files in conflict
GIT_PROMPT_CHANGED="${ORANGE}+" # the number of changed files
GIT_PROMPT_UNTRACKED="${CYAN}…" # the number of untracked files/dirs
GIT_PROMPT_STASHED="${YELLOW}⚑" # the number of stashed files/dir
GIT_PROMPT_CLEAN="${GREEN}✓" # a colored flag indicating a "clean" repo
PROMPT_START="_LAST_COMMAND_INDICATOR_\n${RAINBOW_PROMPT}"
GIT_PROMPT_START="${PROMPT_START}"
PROMPT_END="\n» "
GIT_PROMPT_END="${PROMPT_END}"
GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING="〆" # This symbol is written after the branch, if the branch is not tracked ❄ ⚠ ☢ ⚡ ☎ 〆 ≠ ↯ ⇝ ⟿
}
reload_git_prompt_colors "Rainbow"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment