Modify agnoster theme for Mac OSX Yosemite

This commit is contained in:
Shien Hong 2015-03-23 10:36:12 -07:00
commit e385094292

View file

@ -26,7 +26,8 @@
# A few utility functions to make it easy and re-usable to draw segmented prompts # A few utility functions to make it easy and re-usable to draw segmented prompts
CURRENT_BG='NONE' CURRENT_BG='NONE'
SEGMENT_SEPARATOR='' SEGMENT_SEPARATOR='⮀'
# Begin a segment # Begin a segment
# Takes two arguments, background and foreground. Both can be omitted, # Takes two arguments, background and foreground. Both can be omitted,
@ -74,9 +75,11 @@ prompt_git() {
dirty=$(parse_git_dirty) dirty=$(parse_git_dirty)
ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)" ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)"
if [[ -n $dirty ]]; then if [[ -n $dirty ]]; then
prompt_segment yellow black prompt_segment red black
st=' ±'
else else
prompt_segment green black prompt_segment green black
fi fi
if [[ -e "${repo_path}/BISECT_LOG" ]]; then if [[ -e "${repo_path}/BISECT_LOG" ]]; then
@ -86,7 +89,7 @@ prompt_git() {
elif [[ -e "${repo_path}/rebase" || -e "${repo_path}/rebase-apply" || -e "${repo_path}/rebase-merge" || -e "${repo_path}/../.dotest" ]]; then elif [[ -e "${repo_path}/rebase" || -e "${repo_path}/rebase-apply" || -e "${repo_path}/rebase-merge" || -e "${repo_path}/../.dotest" ]]; then
mode=" >R>" mode=" >R>"
fi fi
mode=$st;
setopt promptsubst setopt promptsubst
autoload -Uz vcs_info autoload -Uz vcs_info
@ -98,7 +101,7 @@ prompt_git() {
zstyle ':vcs_info:*' formats ' %u%c' zstyle ':vcs_info:*' formats ' %u%c'
zstyle ':vcs_info:*' actionformats ' %u%c' zstyle ':vcs_info:*' actionformats ' %u%c'
vcs_info vcs_info
echo -n "${ref/refs\/heads\// }${vcs_info_msg_0_%% }${mode}" echo -n "${ref/refs\/heads\// }${vcs_info_msg_0_%% }${mode}"
fi fi
} }