ef8e3a67f293ab3d4dfc67da5af321de7c019ca4

Author
Matt Guindin <matt@guindin.com>
Committer
Matt Guindin <matt@guindin.com>
Date

Message

[agnoster] modifying theme to show dot for dirty files and plus for staged files in git repos

Diff

 1diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
 2index c3107c06c04fb42b0ca27b0a81b15854819969c6..3ca5385beb0f8c62ad16ccd997b269c66f2a1b73 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