summaryrefslogtreecommitdiff
path: root/git.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'git.zsh')
-rw-r--r--git.zsh16
1 files changed, 13 insertions, 3 deletions
diff --git a/git.zsh b/git.zsh
index b8fd1f08e..591b77895 100644
--- a/git.zsh
+++ b/git.zsh
@@ -1,16 +1,26 @@
+#
+ZSH_THEME_GIT_PROMPT_PREFIX="git:("
+ZSH_THEME_GIT_PROMPT_SUFFIX=")"
+ZSH_THEME_GIT_PROMPT_DIRTY="*"
+ZSH_THEME_GIT_PROMPT_CLEAN=""
+
# get the name of the branch we are on
function git_prompt_info() {
if [[ -d .git ]]; then
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
branch=${ref#refs/heads/}
- CURRENT_BRANCH="git:(%{$fg[red]%}${branch}%{$fg[blue]%})%{$reset_color%}$(parse_git_dirty)"
+ CURRENT_BRANCH="$ZSH_THEME_GIT_PROMPT_PREFIX${branch}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
else
CURRENT_BRANCH=''
fi
echo $CURRENT_BRANCH
}
-
parse_git_dirty () {
- [[ $(git status | tail -n1) != "nothing to commit (working directory clean)" ]] && echo " %{$fg[yellow]%}✗%{$reset_color%}"
+ if [[ $(git status | tail -n1) != "nothing to commit (working directory clean)" ]]; then
+ echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
+ else
+ echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
+ fi
}
+