From 2eb006d435e1a099fcb88d80b046f0a9ec4ba9f6 Mon Sep 17 00:00:00 2001 From: David Anema Date: Fri, 7 Dec 2012 10:05:26 +0100 Subject: [PATCH] Added better GIT-info --- themes/danema.zsh-theme | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/themes/danema.zsh-theme b/themes/danema.zsh-theme index cbe8ba43c..edb727fa5 100644 --- a/themes/danema.zsh-theme +++ b/themes/danema.zsh-theme @@ -1,7 +1,22 @@ -PROMPT='%n%{$reset_color%}%{$fg[red]%}@%m%{$reset_color%}:[%{$fg[green]%}%~%{$reset_color%}]$(git_prompt_info)%{$fg[red]%} ➜ %{$reset_color%}' +function git_prompt_custom() { + ref=$(git symbolic-ref HEAD 2> /dev/null) || return + GIT_STATUS="%{$fg[red]%}<%{$reset_color%}$(git_prompt_info)%{$reset_color%}[%{$fg[green]%}$(git_prompt_short_sha)%{$reset_color%}]$(git_prompt_status)%{$fg[red]%}>" + [[ -n $GIT_STATUS ]] && GIT_STATUS=" $GIT_STATUS" + echo "$ZSH_THEME_GIT_PROMPT_PREFIX$GIT_STATUS$ZSH_THEME_GIT_PROMPT_SUFFIX" +} + +PROMPT='%n%{$reset_color%}%{$fg[red]%}@%m%{$reset_color%}:[%{$fg[green]%}%~%{$reset_color%}]%u$(git_prompt_custom)%{$fg[red]%} ?^?^? %{$reset_color%}' RPROMPT='[%{$fg[red]%}%W %t%{$reset_color%}]' -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%} <" +ZSH_THEME_GIT_PROMPT_PREFIX="" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY=":%{$fg[white]%}✗%{$fg[red]%}>%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[red]%}>" +ZSH_THEME_GIT_PROMPT_DIRTY=": %{$fg[red]%}?^?^?%{$fg[red]%} " +ZSH_THEME_GIT_PROMPT_CLEAN=": %{$fg[red]%}" + +ZSH_THEME_GIT_PROMPT_UNMERGED=" %{$RED%}unmerged" +ZSH_THEME_GIT_PROMPT_DELETED=" %{$RED%}deleted" +ZSH_THEME_GIT_PROMPT_RENAMED=" %{$YELLOW%}renamed" +ZSH_THEME_GIT_PROMPT_MODIFIED=" %{$YELLOW%}modified" +ZSH_THEME_GIT_PROMPT_ADDED=" %{$GREEN%}added" +ZSH_THEME_GIT_PROMPT_UNTRACKED=" %{$WHITE%}untracked" +ZSH_THEME_GIT_PROMPT_AHEAD=" %{$RED%}(!)"