dd6cc96bb1db382d824eb6dfa512d0526b6adac0

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #112 from lukerandall/master

Update theme to support fine grained git status

Diff

 1diff --git a/themes/lukerandall.zsh-theme b/themes/lukerandall.zsh-theme
 2index 24a0612b72b9fa8bb3813ab3d1c9edb493bcb9aa..f4045bd8e7a6e979e1d0ec0c128ea6dfa5731b1f 100644
 3--- a/themes/lukerandall.zsh-theme
 4+++ b/themes/lukerandall.zsh-theme
 5@@ -3,8 +3,22 @@
 6 
 7 local return_code="%(?..%{$fg_bold[red]%}%? ↵%{$reset_color%})"
 8 
 9-PROMPT='%{$fg_bold[green]%}%n@%m%{$reset_color%} %{$fg_bold[blue]%}%2~%{$reset_color%} $(git_prompt_info)%{$reset_color%}%B»%b '
10+function my_git_prompt_info() {
11+  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
12+  GIT_STATUS=$(git_prompt_status)
13+  [[ -n $GIT_STATUS ]] && GIT_STATUS=" $GIT_STATUS"
14+  echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$GIT_STATUS$ZSH_THEME_GIT_PROMPT_SUFFIX"
15+}
16+
17+PROMPT='%{$fg_bold[green]%}%n@%m%{$reset_color%} %{$fg_bold[blue]%}%2~%{$reset_color%} $(my_git_prompt_info)%{$reset_color%}%B»%b '
18 RPS1="${return_code}"
19 
20 ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}("
21 ZSH_THEME_GIT_PROMPT_SUFFIX=") %{$reset_color%}"
22+ZSH_THEME_GIT_PROMPT_UNTRACKED="%%"
23+ZSH_THEME_GIT_PROMPT_ADDED="+"
24+ZSH_THEME_GIT_PROMPT_MODIFIED="*"
25+ZSH_THEME_GIT_PROMPT_RENAMED="~"
26+ZSH_THEME_GIT_PROMPT_DELETED="!"
27+ZSH_THEME_GIT_PROMPT_UNMERGED="?"
28+