#prompt #git-status #bash #zsh #icons #branch #schema

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

#166 in Database interfaces

Download history 109/week @ 2024-08-04 236/week @ 2024-08-11 147/week @ 2024-08-18 10/week @ 2024-08-25 1/week @ 2024-09-01

503 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

~14MB
~329K SLoC