This Zsh script / plugin will put local Git repo status in your right side prompt (RPROMPT).
The main difference between this plugin and standard vcs_info
based prompts
/ themes is asynchronous computation. This makes the plugin feel faster,
although it really isn't, it just returns immediately and updates the status
in the background. If your current prompt works fast enough, there's no need
to switch to this plugin.
The plugin is inspired by:
- Oh My Zsh git-prompt plugin, which in turn is based on an old version of Olivier Verdier's plugin,
- Anish Athalye's asynchronous prompt idea.
You can set any the following variables before loading the plugin:
$GIT_PROMPT_ORDER
- determines the order of elements (modified / staged / untracked etc.),$GIT_PROMPT_SYMBOLS
- what to display before each element,$GIT_PROMPT_INDENT_HACK
- try 0 or 1 if the prompt seems misaligned.
Default configuration, clean repo, local branch equal to remote:
Local branch diverged from remote (1 commit behind, 2 commits ahead), 4 files modified, but not staged, 3 files staged, 2 conflicts, 1 untracked file:
Customized to look similar to powerline prompts (see async-git-prompt.config-example.zsh), clean:
With some changes: