diff --git a/dotfiles/zprezto_custom/matir/functions/prompt_matir_setup b/dotfiles/zprezto_custom/matir/functions/prompt_matir_setup index 60f0c80..de89e78 100644 --- a/dotfiles/zprezto_custom/matir/functions/prompt_matir_setup +++ b/dotfiles/zprezto_custom/matir/functions/prompt_matir_setup @@ -17,6 +17,7 @@ function prompt_matir_setup { zstyle ':vcs_info:*' formats ' (%b%u%c)' zstyle ':vcs_info:*' stagedstr '*' zstyle ':vcs_info:*' unstagedstr '*' + zstyle ':vcs_info:git*+set-message:*' hooks git-untracked # Virtualenv formatting zstyle ':prezto:module:python:info:virtualenv' format ' (py:%v)' @@ -53,4 +54,14 @@ function prompt_matir_precmd { 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 "$@"