mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
Updated BZR prompt info and added HG prompt info.
This commit is contained in:
parent
a38af27991
commit
bec0715e40
2 changed files with 33 additions and 6 deletions
21
lib/bzr.zsh
21
lib/bzr.zsh
|
|
@ -1,10 +1,19 @@
|
||||||
## Bazaar integration
|
## Bazaar integration
|
||||||
## Just works with the GIT integration just add $(bzr_prompt_info) to the PROMPT
|
## Just works with the GIT integration just add $(bzr_prompt_info) to the PROMPT
|
||||||
function bzr_prompt_info() {
|
function bzr_prompt_info() {
|
||||||
BZR_CB=`bzr nick 2> /dev/null | grep -v "ERROR" | cut -d ":" -f2 | awk -F / '{print "bzr::"$1}'`
|
BZR_BRANCH=$(command bzr nick 2> /dev/null | grep -v "ERROR" | cut -d ":" -f2 | awk -F / '{print $1}')
|
||||||
if [ -n "$BZR_CB" ]; then
|
|
||||||
BZR_DIRTY=""
|
if [[ -n "$BZR_CB" ]]; then
|
||||||
[[ -n `bzr status` ]] && BZR_DIRTY=" %{$fg[red]%} * %{$fg[green]%}"
|
echo "$ZSH_THEME_SCM_PROMPT_PREFIX$BZR_BRANCH$(parse_bzr_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
||||||
echo "$ZSH_THEME_SCM_PROMPT_PREFIX$BZR_CB$BZR_DIRTY$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function parse_bzr_dirty() {
|
||||||
|
BZR_STATUS=$(command bzr status 2> /dev/null | tail -n1)
|
||||||
|
|
||||||
|
if [[ -n "$BZR_STATUS" ]]; then
|
||||||
|
echo $ZSH_THEME_GIT_PROMPT_DIRTY
|
||||||
|
else
|
||||||
|
echo $ZSH_THEME_GIT_PROMPT_CLEAN
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
|
||||||
18
lib/hg.zsh
Normal file
18
lib/hg.zsh
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
## Mercurial (Hg) integration
|
||||||
|
function hg_prompt_info() {
|
||||||
|
HG_BRANCH=$(command hg branch 2> /dev/null | grep -v ^abort)
|
||||||
|
|
||||||
|
if [[ -n "$HG_CB" ]]; then
|
||||||
|
echo "$ZSH_THEME_HG_PROMPT_PREFIX$HG_BRANCH$(parse_hg_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function parse_hg_dirty() {
|
||||||
|
HG_STATUS=$(command hg status 2> /dev/null | tail -n1)
|
||||||
|
|
||||||
|
if [[ -n "$HG_STATUS" ]]; then
|
||||||
|
echo $ZSH_THEME_GIT_PROMPT_DIRTY
|
||||||
|
else
|
||||||
|
echo $ZSH_THEME_GIT_PROMPT_CLEAN
|
||||||
|
fi
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue