diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 725f4b3d..d736b331 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -10,7 +10,7 @@ SCM_GIT='git' SCM_GIT_CHAR='±' SCM_HG='hg' -SCM_HG_CHAR='hg' +SCM_HG_CHAR='☿' SCM_SVN='svn' SCM_SVN_CHAR='⑆' diff --git a/themes/zuper/zuper.theme.bash b/themes/zuper/zuper.theme.bash index 9898be50..91e28c6e 100644 --- a/themes/zuper/zuper.theme.bash +++ b/themes/zuper/zuper.theme.bash @@ -4,23 +4,40 @@ SCM_THEME_PROMPT_DIRTY=" ${red}✖${reset_color}" SCM_THEME_PROMPT_AHEAD=" ${red}!${reset_color}" SCM_THEME_PROMPT_CLEAN=" ${green}✔${reset_color}" -SCM_THEME_PROMPT_PREFIX="${white} ❮${cyan} " +SCM_THEME_PROMPT_PREFIX="${white} ❮ $(scm_char)${cyan} " SCM_THEME_PROMPT_SUFFIX="${white} ❯" -#GIT_SHA_PREFIX="${white} ❮ ${yellow}" -#GIT_SHA_SUFFIX="${reset_color}" +GIT_SHA_PREFIX="${white} ❮ $(scm_char)${cyan} " +GIT_SHA_SUFFIX="${white} ❯" #HG_SHA_PREFIX="${white} ❮ ${yellow}" #HG_SHA_SUFFIX="${reset_color}" - -function git_short_sha() { - SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$GIT_SHA_PREFIX$SHA$GIT_SHA_SUFFIX" +function zuper_hg_prompt_info() { + hg_prompt_vars + echo -e "$SCM_PREFIX$SCM_BRANCH$SCM_STATE$SCM_SUFFIX" } +function zuper_git_prompt_info { + git_prompt_vars + echo -e "$SCM_PREFIX$SCM_BRANCH$SCM_STATE$SCM_SUFFIX" +} + +function zuper_scm_prompt_info { + scm + scm_prompt_char + SCM_DIRTY=0 + SCM_STATE='' + [[ $SCM == $SCM_GIT ]] && zuper_git_prompt_info && return + [[ $SCM == $SCM_HG ]] && zuper_hg_prompt_info && return + [[ $SCM == $SCM_SVN ]] && svn_prompt_info && return +} + + + prompt() { - local git_branch="$(scm_prompt_info)" - PS1="${white}\n[ ${yellow}\u@\H ${white}] ${green}\w${git_branch}\n${white}[ ${red}\t${white} ] →${white} " + local my_branch="$(zuper_scm_prompt_info)" + PS1="${white}\n[ ${yellow}\u@\H ${white}] ${green}\w${my_branch}\n${white}[ ${red}\t${bold_white} ] →${normal} " } PROMPT_COMMAND=prompt \ No newline at end of file