diff options
author | Aaron LI <aaronly.me@outlook.com> | 2017-01-22 11:21:36 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2017-01-22 11:21:36 +0800 |
commit | a588f9d6d5761a8f668536a9162149e2e3ce3eef (patch) | |
tree | 2b828385ea62b13059067f6611489b60fd1467cf /_zsh | |
parent | e1c6811f302fcfe1ff4825eb471d2c5c99fd0eb8 (diff) | |
download | dotfiles-a588f9d6d5761a8f668536a9162149e2e3ce3eef.tar.bz2 |
_zsh: Speed up git prompt
* Add option "--untracked-files=no" to "git status"
* Do not check the ahead status
Diffstat (limited to '_zsh')
-rw-r--r-- | _zsh/30-prompt.zsh | 4 |
1 files changed, 1 insertions, 3 deletions
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 |