Skip to content

spaceship-prompt/spaceship-react

Repository files navigation

⚛ + 🚀
Spaceship React

A React section for Spaceship prompt

GitHub Release GitHub Workflow Status Spaceship Twitter Chat on Discord

Current React version from package.json file found in the closest node_modules/react package ().

Installing

You need to source this plugin somewhere in your dotfiles. Here's how to do it with some popular tools:

Execute this command to clone this repo into Oh-My-Zsh plugin's folder:

git clone https://github.com/spaceship-prompt/spaceship-react.git $ZSH_CUSTOM/plugins/spaceship-react

Include spaceship-react in Oh-My-Zsh plugins list:

plugins=($plugins spaceship-react)
zplug "spaceship-prompt/spaceship-react"
antigen bundle "spaceship-prompt/spaceship-react"
antibody bundle "spaceship-prompt/spaceship-react"
zinit light "spaceship-prompt/spaceship-react"
zgen load "spaceship-prompt/spaceship-react"
[plugins.spaceship-react]
github = "spaceship-prompt/spaceship-react"

Manual

If none of the above methods works for you, you can install Spaceship manually.

  1. Clone this repo somewhere, for example to $HOME/.zsh/spaceship-react.
  2. Source this section in your ~/.zshrc.

Example

mkdir -p "$HOME/.zsh"
git clone --depth=1 https://github.com/spaceship-prompt/spaceship-react.git "$HOME/.zsh/spaceship-react"

For initializing prompt system add this to your .zshrc:

source "~/.zsh/spaceship-react/spaceship-react.plugin.zsh"

Usage

After installing, add the following line to your .zshrc in order to include React section in the prompt:

spaceship add react

Options

This section is shown only in directories within a React context.

Variable Default Meaning
SPACESHIP_REACT_SHOW true Show current section
SPACESHIP_REACT_ASYNC true Render section asynchronously
SPACESHIP_REACT_PREFIX via Prefix before section
SPACESHIP_REACT_SUFFIX Suffix after section
SPACESHIP_REACT_SYMBOL Character to be shown before version
SPACESHIP_REACT_COLOR cyan Color of section

Contributing

First, thanks for your interest in contributing!

Contribute to this repo by submitting a pull request. Please use conventional commits, since this project adheres to semver and is automatically released via semantic-release.

License

MIT © Denys Dovhan and Ryan Jentzsch