forked from misc/zsh-config
Gitinfo and pztrn prompt now showing deleted files count.
This commit is contained in:
parent
a12c9bcff9
commit
2fbecf063d
@ -4,6 +4,7 @@ GITINFO_COMMIT_SHORTID=""
|
|||||||
GITINFO_COMMIT_COUNT=0
|
GITINFO_COMMIT_COUNT=0
|
||||||
GITINFO_NEW_FILES=""
|
GITINFO_NEW_FILES=""
|
||||||
GITINFO_MODIFIED_FILES=""
|
GITINFO_MODIFIED_FILES=""
|
||||||
|
GITINFO_DELETED_FILES=""
|
||||||
GITINFO_REMOTES=""
|
GITINFO_REMOTES=""
|
||||||
GITINFO_STASHES_COUNT=0
|
GITINFO_STASHES_COUNT=0
|
||||||
|
|
||||||
@ -87,10 +88,12 @@ function gitinfo_get_changes()
|
|||||||
if [ $? -eq 1 ]; then
|
if [ $? -eq 1 ]; then
|
||||||
GITINFO_NEW_FILES=""
|
GITINFO_NEW_FILES=""
|
||||||
GITINFO_MODIFIED_FILES=""
|
GITINFO_MODIFIED_FILES=""
|
||||||
|
GITINFO_DELETED_FILES=""
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
GITINFO_NEW_FILES=`LC_ALL=C git status | grep "new" | wc -l`
|
GITINFO_NEW_FILES=`LC_ALL=C git status | grep "new" | wc -l`
|
||||||
GITINFO_MODIFIED_FILES=`LC_ALL=C git status | grep "modified" | wc -l`
|
GITINFO_MODIFIED_FILES=`LC_ALL=C git status | grep "modified" | wc -l`
|
||||||
|
GITINFO_DELETED_FILES=`LC_ALL=C git status | grep "deleted" | wc -l`
|
||||||
}
|
}
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
@ -80,7 +80,7 @@ prompt_pztrn_gitinfo()
|
|||||||
p_gitinfo_branch="$vars['brackets_start']$vars['usercolor']${GITINFO_BRANCH}$reset_color$vars['brackets_end']"
|
p_gitinfo_branch="$vars['brackets_start']$vars['usercolor']${GITINFO_BRANCH}$reset_color$vars['brackets_end']"
|
||||||
p_gitinfo_commit="$vars['brackets_start']%{$fg[magenta]%}${GITINFO_COMMIT_SHORTID}$reset_color (%{$fg[cyan]%}${GITINFO_COMMIT_COUNT}$reset_color)$vars['brackets_end']"
|
p_gitinfo_commit="$vars['brackets_start']%{$fg[magenta]%}${GITINFO_COMMIT_SHORTID}$reset_color (%{$fg[cyan]%}${GITINFO_COMMIT_COUNT}$reset_color)$vars['brackets_end']"
|
||||||
p_gitinfo_remotes="$vars['brackets_start']%{$fg[green]%}${GITINFO_REMOTES} remote(s)$reset_color$vars['brackets_end']"
|
p_gitinfo_remotes="$vars['brackets_start']%{$fg[green]%}${GITINFO_REMOTES} remote(s)$reset_color$vars['brackets_end']"
|
||||||
p_gitinfo_files="$vars['brackets_start']%{$fg[green]%}${GITINFO_NEW_FILES}$reset_color new, %{$fg[yellow]%}${GITINFO_MODIFIED_FILES}$reset_color modified$vars['brackets_end']"
|
p_gitinfo_files="$vars['brackets_start']%{$fg[green]%}${GITINFO_NEW_FILES}$reset_color new, %{$fg[yellow]%}${GITINFO_MODIFIED_FILES}$reset_color modified, %{$fg[red]%}${GITINFO_DELETED_FILES} deleted$vars['brackets_end']"
|
||||||
p_gitinfo=$'\n'"$p_gitinfo_branch$p_gitinfo_commit$p_gitinfo_files$p_gitinfo_remotes"
|
p_gitinfo=$'\n'"$p_gitinfo_branch$p_gitinfo_commit$p_gitinfo_files$p_gitinfo_remotes"
|
||||||
else
|
else
|
||||||
p_gitinfo=""
|
p_gitinfo=""
|
||||||
|
Loading…
Reference in New Issue
Block a user