fast-git-prompt

Crates.iofast-git-prompt
lib.rsfast-git-prompt
version0.2.2
sourcesrc
created_at2024-08-10 10:46:14.885835
updated_at2024-08-19 21:12:37.253883
descriptionA fast git prompt for zsh and bash.
homepage
repositoryhttps://github.com/MasterGordon/fast-git-prompt
max_upload_size
id1332247
size25,271
Gordon Goldbach (MasterGordon)

documentation

README

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
Commit count: 0

cargo fmt