Default to old powerline and make configurable

This commit is contained in:
Devin Christensen 2013-05-01 13:32:48 -06:00
commit 3dad438312

View file

@ -26,7 +26,15 @@
# A few utility functions to make it easy and re-usable to draw segmented prompts
CURRENT_BG='NONE'
SEGMENT_SEPARATOR=''
if [ "x$USE_NEW_POWERLINE" = "xtrue" ]; then
SEGMENT_SEPARATOR=''
BRANCH_SYMBOL=''
else
SEGMENT_SEPARATOR='⮀'
BRANCH_SYMBOL='⭠'
fi
# Begin a segment
# Takes two arguments, background and foreground. Both can be omitted,
@ -90,7 +98,7 @@ prompt_git() {
zstyle ':vcs_info:*' formats ' %u%c'
zstyle ':vcs_info:*' actionformats '%u%c'
vcs_info
echo -n "${ref/refs\/heads\// }${vcs_info_msg_0_}"
echo -n "${ref/refs\/heads\//$BRANCH_SYMBOL }${vcs_info_msg_0_}"
fi
}
@ -110,7 +118,7 @@ prompt_hg() {
# if working copy is clean
prompt_segment green black
fi
echo -n $(hg prompt "⭠ {rev}@{branch}") $st
echo -n $(hg prompt "$BRANCH_SYMBOL {rev}@{branch}") $st
else
st=""
rev=$(hg id -n 2>/dev/null | sed 's/[^-0-9]//g')
@ -124,7 +132,7 @@ prompt_hg() {
else
prompt_segment green black
fi
echo -n "⭠ $rev@$branch" $st
echo -n "$BRANCH_SYMBOL $rev@$branch" $st
fi
fi
}