1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-18 05:40:07 +00:00

powerlevel-9k: getting rid of the totally fake hg vcs_info

This commit is contained in:
Ben Hilburn 2015-01-26 19:43:06 -08:00
parent cfa8d2558e
commit d86013365f

View file

@ -157,42 +157,6 @@ function +vi-git-tagname() {
[[ -n ${tag} ]] && hook_com[branch]=" %F{black}${tag}%f"
}
# Mercurial status
prompt_hg() {
local rev status
if $(hg id >/dev/null 2>&1); then
if $(hg prompt >/dev/null 2>&1); then
if [[ $(hg prompt "{status|unknown}") = "?" ]]; then
# if files are not added
left_prompt_segment red white
st='±'
elif [[ -n $(hg prompt "{status|modified}") ]]; then
# if any modification
left_prompt_segment yellow black
st='±'
else
# if working copy is clean
left_prompt_segment green black
fi
echo -n $(hg prompt "☿ {rev}@{branch}") $st
else
st=""
rev=$(hg id -n 2>/dev/null | sed 's/[^-0-9]//g')
branch=$(hg id -b 2>/dev/null)
if `hg st | grep -Eq "^\?"`; then
left_prompt_segment red black
st='±'
elif `hg st | grep -Eq "^(M|A)"`; then
left_prompt_segment yellow black
st='±'
else
left_prompt_segment green black
fi
echo -n "☿ $rev@$branch" $st
fi
fi
}
# Dir: current working directory
prompt_dir() {
left_prompt_segment blue black '%~'