#git-status #prompt #bash #git-branch #zsh #icons #config-file

app fast-git-prompt

A fast git prompt for zsh and bash

5 releases

0.2.2 Aug 19, 2024
0.2.1 Aug 15, 2024
0.2.0 Aug 11, 2024
0.1.1 Aug 10, 2024
0.1.0 Aug 10, 2024

#77 in Configuration

Download history 309/week @ 2024-08-09 172/week @ 2024-08-16 20/week @ 2024-08-23 2/week @ 2024-08-30 9/week @ 2024-09-13 7/week @ 2024-09-20 3/week @ 2024-09-27 2/week @ 2024-10-04 1/week @ 2024-10-11

215 downloads per month

MIT license

16KB
363 lines

fast-git-prompt

A fast git prompt for zsh and bash.

This is a work in progress. More features will be added in the future.

Installation

cargo install fast-git-prompt

Make sure you have $HOME/.cargo/bin in your $PATH.

Usage

Include fast-git-prompt in your .zshrc or .bashrc file as part of your prompt.

Configuration

Create a file called config.json in your $XDG_CONFIG_HOME/fast-git-prompt or $HOME/.config/fast-git-prompt directory. The configuration of the prompt is fully modular and customizable.

Example

{
  "version-do-not-modify": "0.1.0",
  "schema": "$XDG_CONFIG_HOME/fast-git-prompt/schema.json",
  "baseColor": "white",
  "prompt": [
    // Your prompt parts go here
  ]
}

Prompt Parts

The color property of every icon is optional.

Branch Name

The branch name is the name of the current branch.

{
  "type": "branchName",
  "color": "white" // Optional
}

Origin Icon

The origin icon is the icon of the current branch's remote.

{
  "type": "originIcon",
  "icons": {
    "github.com": {
      "icon": "",
      "color": "white"
    },
    "gitlab.com": {
      "icon": "",
      "color": "brightRed"
    }
  },
  "defaultIcon": {
    "icon": "",
    "color": "white"
  }
}

Branch Status

The branch status is the status of the current branch.

{
  "type": "BranchStatus",
  "dirty": {
    "color": "red",
    "icon": ""
  },
  "clean": {
    "color": "green",
    "icon": "󰸞"
  },
  "deleted": {
    "color": "red",
    "icon": ""
  },
  "changed": {
    "color": "yellow",
    "icon": ""
  },
  "new": {
    "color": "yellow",
    "icon": ""
  }
}

Branch Sync

The branch sync is the sync status of the current branch.

{
  "type": "BranchSync",
  "ahead": {
    "icon": ""
  },
  "behind": {
    "icon": ""
  }
}

Colors

You can currently only use ansi colors. Which will use by your terminal emulator.

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white
  • brightBlack
  • brightRed
  • brightGreen
  • brightYellow
  • brightBlue
  • brightMagenta
  • brightCyan
  • brightWhite

Dependencies

~15MB
~320K SLoC