From a588f9d6d5761a8f668536a9162149e2e3ce3eef Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sun, 22 Jan 2017 11:21:36 +0800 Subject: _zsh: Speed up git prompt * Add option "--untracked-files=no" to "git status" * Do not check the ahead status --- _zsh/30-prompt.zsh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to '_zsh') diff --git a/_zsh/30-prompt.zsh b/_zsh/30-prompt.zsh index 6c1911a..3d439c7 100644 --- a/_zsh/30-prompt.zsh +++ b/_zsh/30-prompt.zsh @@ -4,7 +4,7 @@ function git_prompt_info { local ref=$(=git symbolic-ref HEAD 2> /dev/null) - local gitst="$(=git status 2> /dev/null)" + local gitst="$(=git status --untracked-files=no 2> /dev/null)" if [[ -f .git/MERGE_HEAD ]]; then if [[ ${gitst} =~ "unmerged" ]]; then @@ -16,8 +16,6 @@ function git_prompt_info { gitstatus=" %{$fg[blue]%}!%{$reset_color%}" elif [[ ${gitst} =~ "use \"git add" ]]; then gitstatus=" %{$fg[red]%}!%{$reset_color%}" - elif [[ -n `git checkout HEAD 2> /dev/null | grep ahead` ]]; then - gitstatus=" %{$fg[yellow]%}*%{$reset_color%}" else gitstatus='' fi -- cgit v1.2.2