d6a36b175646fa2a79466f050b07d47c2342b75e

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

Message

Merge pull request #1575 from mguindin/agnoster-change

[agnoster-theme] modifying theme for dirty/staged files

Diff

 1diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
 2index 75e09577681863ca7fba4787bb29acd2559b55c6..a9de8c84ea8c8765edd5594df1d6eb9463fb22ab 100644
 3--- a/themes/agnoster.zsh-theme
 4+++ b/themes/agnoster.zsh-theme
 5@@ -71,7 +71,6 @@ prompt_context() {
 6 prompt_git() {
 7   local ref dirty
 8   if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then
 9-    ZSH_THEME_GIT_PROMPT_DIRTY='±'
10     dirty=$(parse_git_dirty)
11     ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)"
12     if [[ -n $dirty ]]; then
13@@ -79,7 +78,19 @@ prompt_git() {
14     else
15       prompt_segment green black
16     fi
17-    echo -n "${ref/refs\/heads\//⭠ }$dirty"
18+
19+    setopt promptsubst
20+    autoload -Uz vcs_info
21+
22+    zstyle ':vcs_info:*' enable git
23+    zstyle ':vcs_info:*' get-revision true
24+    zstyle ':vcs_info:*' check-for-changes true
25+    zstyle ':vcs_info:*' stagedstr '✚'
26+    zstyle ':vcs_info:git:*' unstagedstr '●'
27+    zstyle ':vcs_info:*' formats ' %u%c'
28+    zstyle ':vcs_info:*' actionformats '%u%c'
29+    vcs_info
30+    echo -n "${ref/refs\/heads\//⭠ }${vcs_info_msg_0_}"
31   fi
32 }
33