diff options
author | Ben Hilburn <bhilburn@gmail.com> | 2016-02-18 04:09:54 +0300 |
---|---|---|
committer | Ben Hilburn <bhilburn@gmail.com> | 2016-02-18 04:09:54 +0300 |
commit | 94c87a4d239f770346e510adf46e5844e9023b99 (patch) | |
tree | 498c8f47abe80557cb6c69fb8c68cda37b61527a /functions | |
parent | 5af484bd6d80acadee466b7592b345f969ee1b8d (diff) |
Reflect submodule status in VCS prompty by default.
Diffstat (limited to 'functions')
-rw-r--r-- | functions/vcs.zsh | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/functions/vcs.zsh b/functions/vcs.zsh index 3eec5dfd..7f0b9dea 100644 --- a/functions/vcs.zsh +++ b/functions/vcs.zsh @@ -6,13 +6,18 @@ # https://github.com/bhilburn/powerlevel9k ################################################################ +set_default POWERLEVEL9K_VCS_SHOW_SUBMODULE_DIRTY true function +vi-git-untracked() { + # TODO: check git >= 1.7.2 - see function git_compare_version() local FLAGS FLAGS=('--porcelain') - # TODO: check git >= 1.7.2 - see function git_compare_version() - FLAGS+='--ignore-submodules=dirty' + + if [[ "$POWERLEVEL9K_VCS_SHOW_SUBMODULE_DIRTY" == "false" ]]; then + FLAGS+='--ignore-submodules=dirty' + fi + if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' && \ - -n $(git status ${FLAGS} | grep '^??' 2> /dev/null | tail -n1) ]]; then + -n $(git status ${FLAGS} | grep -E '^??' 2> /dev/null | tail -n1) ]]; then hook_com[unstaged]+=" %F{$POWERLEVEL9K_VCS_FOREGROUND}$(print_icon 'VCS_UNTRACKED_ICON')%f" VCS_WORKDIR_HALF_DIRTY=true else |