Note untracked files.

This commit is contained in:
David Tomaschik
2018-04-07 20:05:47 +02:00
parent 5705cb59c8
commit 1aa256252f

View File

@@ -17,6 +17,7 @@ function prompt_matir_setup {
zstyle ':vcs_info:*' formats ' (%b%u%c)' zstyle ':vcs_info:*' formats ' (%b%u%c)'
zstyle ':vcs_info:*' stagedstr '*' zstyle ':vcs_info:*' stagedstr '*'
zstyle ':vcs_info:*' unstagedstr '*' zstyle ':vcs_info:*' unstagedstr '*'
zstyle ':vcs_info:git*+set-message:*' hooks git-untracked
# Virtualenv formatting # Virtualenv formatting
zstyle ':prezto:module:python:info:virtualenv' format ' (py:%v)' zstyle ':prezto:module:python:info:virtualenv' format ' (py:%v)'
@@ -53,4 +54,14 @@ function prompt_matir_precmd {
python-info python-info
} }
### git: Show marker (*) if there are untracked files in repository
# Make sure you have added staged to your 'formats': %c
+vi-git-untracked(){
if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' ]] && \
git status --porcelain | grep '??' &> /dev/null ; then
hook_com[staged]+='*'
fi
}
prompt_matir_setup "$@" prompt_matir_setup "$@"