summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2011-07-23 09:15:42 -0700
committerRobby Russell <robby@planetargon.com>2011-07-23 09:15:42 -0700
commitdd6cc96bb1db382d824eb6dfa512d0526b6adac0 (patch)
tree692fe1cc5e9565dad219b8227a0ea77cbfe216cb
parent9e783c0a8e276e89d9d81951a4c32ea61dadccf1 (diff)
parent5f103c750891b926aab9f24f896853ea2a0493d5 (diff)
downloadzsh-dd6cc96bb1db382d824eb6dfa512d0526b6adac0.tar.gz
zsh-dd6cc96bb1db382d824eb6dfa512d0526b6adac0.tar.bz2
zsh-dd6cc96bb1db382d824eb6dfa512d0526b6adac0.zip
Merge pull request #112 from lukerandall/master
Update theme to support fine grained git status
-rw-r--r--themes/lukerandall.zsh-theme16
1 files changed, 15 insertions, 1 deletions
diff --git a/themes/lukerandall.zsh-theme b/themes/lukerandall.zsh-theme
index 24a0612b7..f4045bd8e 100644
--- a/themes/lukerandall.zsh-theme
+++ b/themes/lukerandall.zsh-theme
@@ -3,8 +3,22 @@
local return_code="%(?..%{$fg_bold[red]%}%? ↵%{$reset_color%})"
-PROMPT='%{$fg_bold[green]%}%n@%m%{$reset_color%} %{$fg_bold[blue]%}%2~%{$reset_color%} $(git_prompt_info)%{$reset_color%}%B»%b '
+function my_git_prompt_info() {
+ ref=$(git symbolic-ref HEAD 2> /dev/null) || return
+ GIT_STATUS=$(git_prompt_status)
+ [[ -n $GIT_STATUS ]] && GIT_STATUS=" $GIT_STATUS"
+ echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$GIT_STATUS$ZSH_THEME_GIT_PROMPT_SUFFIX"
+}
+
+PROMPT='%{$fg_bold[green]%}%n@%m%{$reset_color%} %{$fg_bold[blue]%}%2~%{$reset_color%} $(my_git_prompt_info)%{$reset_color%}%B»%b '
RPS1="${return_code}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}("
ZSH_THEME_GIT_PROMPT_SUFFIX=") %{$reset_color%}"
+ZSH_THEME_GIT_PROMPT_UNTRACKED="%%"
+ZSH_THEME_GIT_PROMPT_ADDED="+"
+ZSH_THEME_GIT_PROMPT_MODIFIED="*"
+ZSH_THEME_GIT_PROMPT_RENAMED="~"
+ZSH_THEME_GIT_PROMPT_DELETED="!"
+ZSH_THEME_GIT_PROMPT_UNMERGED="?"
+