diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2022-01-01 02:26:11 -0600 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2022-01-01 02:26:11 -0600 |
commit | 49edbf438ed690c76e6b2af80368c59404cf0167 (patch) | |
tree | 129b3adb2f5f39a1329a426a3b7d51ed2c2290c1 /plugins/git-prompt | |
parent | 1bc186dabe12b3d01b2257e82f3a104c48b8b3c7 (diff) | |
parent | 78c91ccbf99c77bd4d9cdb74279a40776721f66d (diff) | |
download | zsh-49edbf438ed690c76e6b2af80368c59404cf0167.tar.gz zsh-49edbf438ed690c76e6b2af80368c59404cf0167.tar.bz2 zsh-49edbf438ed690c76e6b2af80368c59404cf0167.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'plugins/git-prompt')
-rw-r--r-- | plugins/git-prompt/README.md | 8 | ||||
-rw-r--r-- | plugins/git-prompt/git-prompt.plugin.zsh | 5 | ||||
-rw-r--r-- | plugins/git-prompt/gitstatus.py | 2 |
3 files changed, 10 insertions, 5 deletions
diff --git a/plugins/git-prompt/README.md b/plugins/git-prompt/README.md index c6610fa94..83d365c84 100644 --- a/plugins/git-prompt/README.md +++ b/plugins/git-prompt/README.md @@ -11,7 +11,8 @@ plugins=(... git-prompt) See the [original repository](https://github.com/olivierverdier/zsh-git-prompt). -## Prerequisites +## Requirements + This plugin uses `python`, so your host needs to have it installed ## Examples @@ -30,7 +31,7 @@ The prompt may look like the following: By default, the general appearance of the prompt is: -``` +```text (<branch><branch tracking>|<local status>) ``` @@ -58,9 +59,8 @@ The symbols are as follows: ## Customisation - Set the variable `ZSH_THEME_GIT_PROMPT_CACHE` to any value in order to enable caching. -- You may also change a number of variables (whose name start with `ZSH_THEME_GIT_PROMPT_`) +- You may also change a number of variables (whose name start with `ZSH_THEME_GIT_PROMPT_`) to change the appearance of the prompt. Take a look at the bottom of the [plugin file](git-prompt.plugin.zsh)` to see what variables are available. - **Enjoy!** diff --git a/plugins/git-prompt/git-prompt.plugin.zsh b/plugins/git-prompt/git-prompt.plugin.zsh index a4c952471..c86c1f59b 100644 --- a/plugins/git-prompt/git-prompt.plugin.zsh +++ b/plugins/git-prompt/git-prompt.plugin.zsh @@ -1,3 +1,8 @@ +# Handle $0 according to the standard: +# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html +0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" +0="${${(M)0:#/*}:-$PWD/$0}" + __GIT_PROMPT_DIR="${0:A:h}" ## Hook function definitions diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py index 786274a71..4dea8000f 100644 --- a/plugins/git-prompt/gitstatus.py +++ b/plugins/git-prompt/gitstatus.py @@ -81,7 +81,7 @@ for st in status: staged.append(st) stashed = get_stash() -if not changed and not staged and not conflicts and not untracked and not stashed: +if not changed and not staged and not conflicts and not untracked: clean = 1 else: clean = 0 |