Skip to content

pawel-slowik/zsh-async-git-prompt

Repository files navigation

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:

  1. Oh My Zsh git-prompt plugin, which in turn is based on an old version of Olivier Verdier's plugin,
  2. Anish Athalye's asynchronous prompt idea.

configuration

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.

screenshots

Default configuration, clean repo, local branch equal to remote:

screenshot

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:

screenshot

Customized to look similar to powerline prompts (see async-git-prompt.config-example.zsh), clean:

screenshot

With some changes:

screenshot

About

Asynchronous Git prompt for Zsh

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages