commit
65a70865d9
@ -0,0 +1,34 @@ |
|||||||
|
# This theme for gitprompt.sh is designed for dark color schemes |
||||||
|
# it is clone of oh-my-zsh crunch theme style with exit status |
||||||
|
|
||||||
|
override_git_prompt_colors() { |
||||||
|
if [ -e ~/.rvm/bin/rvm-prompt ]; then |
||||||
|
RUBY_PROMPT='{$(~/.rvm/bin/rvm-prompt i v)}' |
||||||
|
else |
||||||
|
if which rbenv &> /dev/null; then |
||||||
|
RUBY_PROMPT='{$(rbenv version | sed -e "s/ (set.*$//")}' |
||||||
|
fi |
||||||
|
fi |
||||||
|
Time12a="\$(date +%H:%M)" |
||||||
|
|
||||||
|
GIT_PROMPT_THEME_NAME="Crunch" |
||||||
|
GIT_PROMPT_STAGED="${Yellow}● " |
||||||
|
GIT_PROMPT_UNTRACKED="${Cyan}… " |
||||||
|
GIT_PROMPT_STASHED="${BoldMagenta}⚑ " |
||||||
|
GIT_PROMPT_CLEAN="${Green}✔ " |
||||||
|
GIT_PROMPT_COMMAND_OK="${Green}✔ " |
||||||
|
GIT_PROMPT_COMMAND_FAIL="${Red}✘ " |
||||||
|
|
||||||
|
KERNEL_PROMPT='‹$(uname -r)›' |
||||||
|
|
||||||
|
GIT_PROMPT_START_USER="_LAST_COMMAND_INDICATOR_${White}{${Yellow}${Time12a}${White}}[${Magenta}${RUBY_PROMPT}${White}]${Cyan}${PathShort}${White}:" |
||||||
|
GIT_PROMPT_START_ROOT="${GIT_PROMPT_START_USER}" |
||||||
|
GIT_PROMPT_END_USER="${BoldBlue} ➭ ${ResetColor}" |
||||||
|
GIT_PROMPT_END_ROOT="${BoldRed} # ${ResetColor}" |
||||||
|
GIT_PROMPT_LEADING_SPACE=0 |
||||||
|
GIT_PROMPT_PREFIX="${Green}[" |
||||||
|
GIT_PROMPT_SUFFIX="${Green}]" |
||||||
|
GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING="✭" |
||||||
|
} |
||||||
|
|
||||||
|
reload_git_prompt_colors "Crunch" |
||||||
@ -0,0 +1,102 @@ |
|||||||
|
# This is an alternative approach. Single line in git repo. |
||||||
|
# Theme optimised for Terminus and PowerLine compatible fonts. |
||||||
|
# This theme for gitprompt.sh is optimized for the "Solarized Dark" and "Solarized Light" color schemes |
||||||
|
# without the indicator of the last command state |
||||||
|
# tweaked for Ubuntu terminal fonts |
||||||
|
|
||||||
|
unset_git_prompt_colors() { |
||||||
|
unset Time12a |
||||||
|
unset PathShort |
||||||
|
unset GIT_PROMPT_PREFIX |
||||||
|
unset GIT_PROMPT_SUFFIX |
||||||
|
unset GIT_PROMPT_SEPARATOR |
||||||
|
unset GIT_PROMPT_BRANCH |
||||||
|
unset GIT_PROMPT_STAGED |
||||||
|
unset GIT_PROMPT_CONFLICTS |
||||||
|
unset GIT_PROMPT_CHANGED |
||||||
|
unset GIT_PROMPT_REMOTE |
||||||
|
unset GIT_PROMPT_UNTRACKED |
||||||
|
unset GIT_PROMPT_STASHED |
||||||
|
unset GIT_PROMPT_CLEAN |
||||||
|
unset GIT_PROMPT_COMMAND_OK |
||||||
|
unset GIT_PROMPT_COMMAND_FAIL |
||||||
|
unset GIT_PROMPT_VIRTUALENV |
||||||
|
unset GIT_PROMPT_START_USER |
||||||
|
unset GIT_PROMPT_START_ROOT |
||||||
|
unset GIT_PROMPT_END_USER |
||||||
|
unset GIT_PROMPT_END_ROOT |
||||||
|
unset GIT_PROMPT_SYMBOLS_AHEAD |
||||||
|
unset GIT_PROMPT_SYMBOLS_BEHIND |
||||||
|
unset GIT_PROMPT_SYMBOLS_PREHASH |
||||||
|
unset GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING |
||||||
|
} |
||||||
|
|
||||||
|
define_helpers() |
||||||
|
{ |
||||||
|
PathShort="${BoldBlue}\u:${Cyan}\W" |
||||||
|
} |
||||||
|
|
||||||
|
define_undefined_git_prompt_colors() { |
||||||
|
if [[ -z ${GIT_PROMPT_THEME_NAME} ]]; then GIT_PROMPT_THEME_NAME="Single_line_Solarized"; fi |
||||||
|
|
||||||
|
# These are the color definitions used by gitprompt.sh |
||||||
|
if [[ -z ${GIT_PROMPT_PREFIX} ]]; then GIT_PROMPT_PREFIX="[ "; fi # start of the git info string |
||||||
|
if [[ -z ${GIT_PROMPT_SUFFIX} ]]; then GIT_PROMPT_SUFFIX=" ]"; fi # the end of the git info string |
||||||
|
if [[ -z ${GIT_PROMPT_SEPARATOR} ]]; then GIT_PROMPT_SEPARATOR=" |"; fi # separates each item |
||||||
|
|
||||||
|
if [[ -z ${GIT_PROMPT_BRANCH} ]]; then GIT_PROMPT_BRANCH="${Magenta}"; fi # the git branch that is active in the current directory |
||||||
|
if [[ -z ${GIT_PROMPT_STAGED} ]]; then GIT_PROMPT_STAGED=" ${Yellow}●${ResetColor}"; fi # the number of staged files/directories |
||||||
|
if [[ -z ${GIT_PROMPT_CONFLICTS} ]]; then GIT_PROMPT_CONFLICTS=" ${Red}✖ ${ResetColor}"; fi # the number of files in conflict |
||||||
|
if [[ -z ${GIT_PROMPT_CHANGED} ]]; then GIT_PROMPT_CHANGED=" ${Blue}✚ ${ResetColor}"; fi # the number of changed files |
||||||
|
|
||||||
|
if [[ -z ${GIT_PROMPT_REMOTE} ]]; then GIT_PROMPT_REMOTE=" "; fi # the remote branch name (if any) and the symbols for ahead and behind |
||||||
|
if [[ -z ${GIT_PROMPT_UNTRACKED} ]]; then GIT_PROMPT_UNTRACKED=" ${Cyan}…${ResetColor}"; fi # the number of untracked files/dirs |
||||||
|
if [[ -z ${GIT_PROMPT_STASHED} ]]; then GIT_PROMPT_STASHED=" ${BoldMagenta}⚑ ${ResetColor}"; fi # the number of stashed files/dir |
||||||
|
if [[ -z ${GIT_PROMPT_CLEAN} ]]; then GIT_PROMPT_CLEAN=" ${Green}✔ ${ResetColor}"; fi # a colored flag indicating a "clean" repo |
||||||
|
|
||||||
|
# For the command indicator, the placeholder _LAST_COMMAND_STATE_ |
||||||
|
# will be replaced with the exit code of the last command |
||||||
|
# e.g. |
||||||
|
# GIT_PROMPT_COMMAND_OK="${Green}✔-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of 0 |
||||||
|
# GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of other than 0 |
||||||
|
|
||||||
|
if [[ -z ${GIT_PROMPT_COMMAND_OK} ]]; then GIT_PROMPT_COMMAND_OK="${Green}✔"; fi # indicator if the last command returned with an exit code of 0 |
||||||
|
if [[ -z ${GIT_PROMPT_COMMAND_FAIL} ]]; then GIT_PROMPT_COMMAND_FAIL="${Red}✘"; fi # indicator if the last command returned with an exit code of other than 0 |
||||||
|
|
||||||
|
# template for displaying the current virtual environment |
||||||
|
# use the placeholder _VIRTUALENV_ will be replaced with |
||||||
|
# the name of the current virtual environment (currently CONDA and VIRTUAL_ENV) |
||||||
|
if [[ -z ${GIT_PROMPT_VIRTUALENV} ]]; then GIT_PROMPT_VIRTUALENV="(${Blue}_VIRTUALENV_${ResetColor}) "; fi |
||||||
|
|
||||||
|
# _LAST_COMMAND_INDICATOR_ will be replaced by the appropriate GIT_PROMPT_COMMAND_OK OR GIT_PROMPT_COMMAND_FAIL |
||||||
|
if [[ -z ${GIT_PROMPT_START_USER} ]]; then GIT_PROMPT_START_USER="_LAST_COMMAND_INDICATOR_ ${Yellow}${PathShort}${ResetColor}"; fi |
||||||
|
|
||||||
|
if [[ -z ${GIT_PROMPT_START_ROOT} ]]; then GIT_PROMPT_START_ROOT="${GIT_PROMPT_START_USER}"; fi |
||||||
|
if [[ -z ${GIT_PROMPT_END_USER} ]]; then GIT_PROMPT_END_USER="${BoldBlue} ➭ ${ResetColor}"; fi # Reset color for user |
||||||
|
if [[ -z ${GIT_PROMPT_END_ROOT} ]]; then GIT_PROMPT_END_ROOT="${BoldRed} # "; fi # Bright red for Root |
||||||
|
|
||||||
|
# Please do not add colors to these symbols |
||||||
|
if [[ -z ${GIT_PROMPT_SYMBOLS_AHEAD} ]]; then GIT_PROMPT_SYMBOLS_AHEAD="↑·"; fi # The symbol for "n versions ahead of origin" |
||||||
|
if [[ -z ${GIT_PROMPT_SYMBOLS_BEHIND} ]]; then GIT_PROMPT_SYMBOLS_BEHIND="↓·"; fi # The symbol for "n versions behind of origin" |
||||||
|
if [[ -z ${GIT_PROMPT_SYMBOLS_PREHASH} ]]; then GIT_PROMPT_SYMBOLS_PREHASH=":"; fi # Written before hash of commit, if no name could be found |
||||||
|
if [[ -z ${GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING} ]]; then GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING="✭"; fi # This symbol is written after the branch, if the branch is not tracked |
||||||
|
} |
||||||
|
|
||||||
|
# call only from theme file |
||||||
|
reload_git_prompt_colors() { |
||||||
|
if [[ "${GIT_PROMPT_THEME_NAME}" != $1 ]]; then |
||||||
|
unset_git_prompt_colors |
||||||
|
define_helpers |
||||||
|
override_git_prompt_colors |
||||||
|
define_undefined_git_prompt_colors |
||||||
|
fi |
||||||
|
} |
||||||
|
|
||||||
|
if [[ "${GIT_PROMPT_THEME}" == "Single_line_Solarized" && "${GIT_PROMPT_THEME_NAME}" != "Single_line_Solarized" ]]; then |
||||||
|
define_helpers |
||||||
|
define_undefined_git_prompt_colors |
||||||
|
fi |
||||||
|
|
||||||
|
overide_git_prompt_colors() { |
||||||
|
GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING="✭" |
||||||
|
} |
||||||
@ -0,0 +1,41 @@ |
|||||||
|
# This theme for gitprompt.sh is optimized for the "Solarized Dark" and "Solarized Light" color schemes |
||||||
|
# tweaked for Ubuntu terminal fonts |
||||||
|
# some modifications on colors |
||||||
|
# added ruby prompt, and kernel version as well |
||||||
|
|
||||||
|
override_git_prompt_colors() { |
||||||
|
if [ -e ~/.rvm/bin/rvm-prompt ]; then |
||||||
|
RUBY_PROMPT='{$(~/.rvm/bin/rvm-prompt i v)}' |
||||||
|
else |
||||||
|
if which rbenv &> /dev/null; then |
||||||
|
RUBY_PROMPT='{$(rbenv version | sed -e "s/ (set.*$//")}' |
||||||
|
fi |
||||||
|
fi |
||||||
|
Time12a="\$(date +%H:%M:%S)" |
||||||
|
|
||||||
|
GIT_PROMPT_THEME_NAME="Solarized Extravagant" |
||||||
|
GIT_PROMPT_STAGED="${Yellow}● " |
||||||
|
GIT_PROMPT_UNTRACKED="${Cyan}… " |
||||||
|
GIT_PROMPT_STASHED="${BoldMagenta}⚑ " |
||||||
|
GIT_PROMPT_CLEAN="${Green}✔ " |
||||||
|
GIT_PROMPT_COMMAND_OK="${Green}✔ " |
||||||
|
GIT_PROMPT_COMMAND_FAIL="${Red}✘ " |
||||||
|
|
||||||
|
KERNEL_PROMPT='‹$(uname -r)›' |
||||||
|
|
||||||
|
GIT_PROMPT_START_USER="_LAST_COMMAND_INDICATOR_ ${BoldBlueFg}${Time12a} ${Green}${KERNEL_PROMPT} ${Cyan}${RUBY_PROMPT} ${Yellow}${PathShort}" |
||||||
|
GIT_PROMPT_START_ROOT="${GIT_PROMPT_START_USER}" |
||||||
|
if [ -n "$SSH_CLIENT" ]; then |
||||||
|
GIT_PROMPT_END_USER="\n${BoldRed} ➤ ${ResetColor}" |
||||||
|
GIT_PROMPT_END_ROOT="\n${BoldRed} » ${ResetColor}" |
||||||
|
else |
||||||
|
GIT_PROMPT_END_USER="\n${BoldBlue} ➭ ${ResetColor}" |
||||||
|
GIT_PROMPT_END_ROOT="\n${BoldRed} # ${ResetColor}" |
||||||
|
fi |
||||||
|
GIT_PROMPT_LEADING_SPACE=1 |
||||||
|
GIT_PROMPT_PREFIX="${Cyan}[" |
||||||
|
GIT_PROMPT_SUFFIX="${Cyan}]" |
||||||
|
GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING="✭" |
||||||
|
} |
||||||
|
|
||||||
|
reload_git_prompt_colors "Solarized Extravagant" |
||||||
Loading…
Reference in new issue