From 1aa256252fbba2e9e84fab487cc5c840ee6b61c5 Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Sat, 7 Apr 2018 20:05:47 +0200 Subject: [PATCH] Note untracked files. --- .../zprezto_custom/matir/functions/prompt_matir_setup | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 "$@"