pull/160/head
vaidas 2012-11-12 09:13:17 +02:00
parent c882a71053
commit 27a9631255
2 changed files with 12 additions and 7 deletions

View File

@ -10,7 +10,7 @@ SCM_GIT='git'
SCM_GIT_CHAR='±'
SCM_HG='hg'
SCM_HG_CHAR=''
SCM_HG_CHAR='hg'
SCM_SVN='svn'
SCM_SVN_CHAR='⑆'
@ -108,8 +108,8 @@ function hg_prompt_vars {
fi
SCM_PREFIX=${HG_THEME_PROMPT_PREFIX:-$SCM_THEME_PROMPT_PREFIX}
SCM_SUFFIX=${HG_THEME_PROMPT_SUFFIX:-$SCM_THEME_PROMPT_SUFFIX}
SCM_BRANCH=$(hg summary 2> /dev/null | grep branch | awk '{print $2}')
SCM_CHANGE=$(hg summary 2> /dev/null | grep parent | awk '{print $2}')
SCM_BRANCH=$(hg summary 2> /dev/null | grep branch: | awk '{print $2}')
SCM_CHANGE=$(hg summary 2> /dev/null | grep parent: | awk '{print $2}')
}
function rvm_version_prompt {

View File

@ -4,17 +4,22 @@
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="${cyan} "
SCM_THEME_PROMPT_PREFIX="${white} ${cyan} "
SCM_THEME_PROMPT_SUFFIX="${white} "
GIT_SHA_PREFIX="${white} ${yellow}"
GIT_SHA_SUFFIX="${reset_color}"
#GIT_SHA_PREFIX="${white} ${yellow}"
#GIT_SHA_SUFFIX="${reset_color}"
#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"
}
prompt() {
local git_branch="$(git_short_sha)$(scm_prompt_info)"
local git_branch="$(scm_prompt_info)"
PS1="${white}\n[ ${yellow}\u@\H ${white}] ${green}\w${git_branch}\n${white}[ ${red}\t${white} ] →${white} "
}