Updated BZR prompt info and added HG prompt info #2373

Open
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants
@bmallred

lib/bzr.zsh

  • Followed the pattern given by lib/git.zsh and refactored to have a separate function to determine if the BZR repository is dirty or clean.
  • Removed static "bzr::" prefix to allow for custom defining in theme or configuration file(s).

lib/hg.zsh

  • New library function to provide similar functionality as lib/git.zsh and lib/bzr.zsh.

Known Issues

  • If the Mercurial (Hg) repository uses special plugins/extensions (i.e. largefiles) which have not been configured on the system then hg_prompt_info() will not display any repository information.

Example Theme

if [[ -z $ZSH_THEME_CLOUD_PREFIX ]]; then
    ZSH_THEME_CLOUD_PREFIX=''
fi

PROMPT='${ZSH_THEME_CLOUD_PREFIX} $FG[208]/* $FG[248]dir:%~ $FG[208]*/%{$reset_color%} '
RPROMPT='$(git_prompt_info)$(hg_prompt_info)$(bzr_prompt_info)'

# This is the standard prompt to be used between all version control systems.
VCS_PROMPT_PREFIX="$FG[208]["

ZSH_THEME_GIT_PROMPT_PREFIX="${VCS_PROMPT_PREFIX}$FG[248]git$FG[208]::$FG[248]"
ZSH_THEME_SCM_PROMPT_PREFIX="${VCS_PROMPT_PREFIX}$FG[248]bzr$FG[208]::$FG[248]"
ZSH_THEME_HG_PROMPT_PREFIX="${VCS_PROMPT_PREFIX}$FG[248]hg$FG[208]::$FG[248]"
ZSH_THEME_GIT_PROMPT_SUFFIX="$FG[208]]%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="$FG[160]*%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment