Skip to content

Instantly share code, notes, and snippets.

@atward
Created September 20, 2019 01:42
Show Gist options
  • Save atward/792f28cdb26a2eed43b17ecdf6e68ae1 to your computer and use it in GitHub Desktop.
Save atward/792f28cdb26a2eed43b17ecdf6e68ae1 to your computer and use it in GitHub Desktop.
# theme based off https://github.com/magicmonty/bash-git-prompt/blob/a2182bb646987ebca978a655a5deb18bcc65dbe1/themes/Single_line_Solarized.bgptheme
define_helpers() {
:
}
# Get git relative path
function prompt_callback {
if [[ -e "$repo" ]]; then
GitBaseName="${repo##*/}"
GitPWD="${PWD##$repo}"
local pwdmaxlen=${1:-$((${COLUMNS:-80}/4))}
[[ ${#GitPWD} -gt $pwdmaxlen ]] && GitPWD="...${GitPWD:3-$pwdmaxlen}"
echo "${Yellow}${GitBaseName}${White}:${Cyan}${GitPWD##/}${ResetColor}"
else
echo "${Cyan}\w${ResetColor}"
fi
}
override_git_prompt_colors() {
GIT_PROMPT_THEME_NAME="Custom"
GIT_PROMPT_PREFIX="["
GIT_PROMPT_SUFFIX="]"
GIT_PROMPT_SEPARATOR="|"
GIT_PROMPT_STAGED="${Yellow}● ${ResetColor}"
GIT_PROMPT_CONFLICTS="${Red}✖ ${ResetColor}"
GIT_PROMPT_CHANGED="${Blue}✚ ${ResetColor}"
GIT_PROMPT_UNTRACKED="${Cyan}…${ResetColor}"
GIT_PROMPT_STASHED="${BoldMagenta}⚑ ${ResetColor}"
GIT_PROMPT_CLEAN="${Green}✔ ${ResetColor}"
#GIT_PROMPT_COMMAND_FAIL="${Red}✘"
#GIT_PROMPT_START_USER="_LAST_COMMAND_INDICATOR_ ${Yellow}${PathShort}${ResetColor}"
GIT_PROMPT_START_USER="_LAST_COMMAND_INDICATOR_ ${ResetColor}"
GIT_PROMPT_START_USER="_LAST_COMMAND_INDICATOR_ ${Yellow}\${PathShort}${ResetColor}"
#GIT_PROMPT_END_USER="${BoldBlue} $ ${ResetColor}"
GIT_PROMPT_END_USER=" ${White}\A $ ${ResetColor}"
GIT_PROMPT_END_ROOT="${BoldRed}# "
GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING="✭"
}
reload_git_prompt_colors "Custom"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment