mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
add hg_prompt_info function. Make it consistent with git_prompt_info. It uses the ZSH_THEME_HG_PROMPT_{PREFIX,SUFFIX,DIRTY,CLEAN} variables for customization.
This commit is contained in:
parent
27c6becffd
commit
6df804fd02
1 changed files with 14 additions and 0 deletions
|
|
@ -22,3 +22,17 @@ function hg_current_branch() {
|
||||||
echo hg:$(hg branch)
|
echo hg:$(hg branch)
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function parse_hg_dirty() {
|
||||||
|
if [[ -n $(hg status -mard . 2> /dev/null) ]]; then
|
||||||
|
echo "$ZSH_THEME_HG_PROMPT_DIRTY"
|
||||||
|
else
|
||||||
|
echo "$ZSH_THEME_HG_PROMPT_CLEAN"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function hg_prompt_info() {
|
||||||
|
if [ -d .hg ]; then
|
||||||
|
echo "$ZSH_THEME_HG_PROMPT_PREFIX$(hg branch)$(parse_hg_dirty)$ZSH_THEME_HG_PROMPT_SUFFIX"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue