Git Product home page Git Product logo

spaceship-prompt's Introduction

SWUbanner

spaceship β†’~ prompt
Spaceship Prompt πŸš€β­

Minimalistic, powerful and extremely customizable Zsh prompt

NPM Version GitHub Workflow Status Zsh Version Spaceship Twitter Chat on Discord Donate

Built with ❀︎ by Denys Dovhan and contributors

Spaceship is a minimalistic, powerful and extremely customizable Zsh prompt. Prompt is what you see when you type a command. It can show a lot of useful tips, saving your time and making user experience smooth and pleasant. It combines everything you may need for convenient work, without unnecessary complications, like a real spaceship.

Spaceship with One Dark, zsh-autosuggestions and zsh-syntax-highlight
Visit Frequently Asked Question for similar setup and find more examples with different color schemes in Screenshots wiki-page.

✨ Features

Here are some sneak picks of what Spaceship can show:

  • Clever hostname and username displaying
  • Repository statuses (Git and Mercurial are supported)
  • Runtime environments for various languages (Node.js, Rust, Python, Ruby, Swift, Go, PHP and many others)
  • Docker version, Kubernetes context and connected machine
  • Package version (npm, lerna, cargo, composer and others)
  • Battery level and status
  • Indicator for jobs in the background ✦
  • A lot of useful information
  • Custom information of your choice

Want more features? Please, open an issue or send pull request.

🀝 Requirements

Before we begin, let's make sure you have the following installed:

  • Zsh (v5.2 or recent) must be installed. Run the following command to check you version of Zsh:
    echo $ZSH_VERSION #> 5.8.1
  • Powerline Font or Nerd Font (even better) must be installed and used in your terminal. Fira Code is a popular choice. To check if Powerline Font works for you, run:
    echo -e "\xee\x82\xa0" #> ξ‚ 

πŸš€ Installation

Here's a few popular methods to install Spaceship. Select the one you use from the list below:

Homebrew Installing Spaceship via Homebrew is a simple command:
brew install spaceship

Add prompt initialization to your .zshrc:

echo "source $(brew --prefix)/opt/spaceship/spaceship.zsh" >>! ~/.zshrc
Oh-My-Zsh Clone this repo:
git clone https://github.com/spaceship-prompt/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1

Symlink spaceship.zsh-theme to your oh-my-zsh custom themes directory:

ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"

Set ZSH_THEME="spaceship" in your .zshrc.

npm Install Spaceship via npm as you would with any other global package:
npm install -g spaceship-prompt

This command will download Spaceship. It will also ask you to source Spaceship in your ~/.zshrc file.

prezto
  • Follow prezto-contrib#usage to clone prezto-contrib to the proper location.
  • Enable the contrib-prompt module (before the prompt module).
  • Set zstyle ':prezto:module:prompt' theme 'spaceship' in your .zpreztorc.
zim Add Spaceship to your `.zimrc`:
zmodule spaceship-prompt/spaceship-prompt --name spaceship --no-submodules

Then install Spaceship:

zimfw install
antigen Add the following snippet in your `.zshrc`:
antigen theme spaceship-prompt/spaceship-prompt
antibody Update your `.zshrc` file with the following line:
antibody bundle spaceship-prompt/spaceship-prompt
zinit Add the following line to your `.zshrc` where you're adding your other Zsh plugins:
zinit light spaceship-prompt/spaceship-prompt
zgen Add the following line to your `.zshrc` where you're adding your other Zsh plugins:
zgen load spaceship-prompt/spaceship-prompt spaceship
zplug Use this command in your `.zshrc` to load Spaceship as prompt theme:
zplug "spaceship-prompt/spaceship-prompt", use:spaceship.zsh, from:github, as:theme
sheldon Add the following to your `plugins.toml` file (open it with `sheldon edit`):
[plugins.spaceship]
github = "spaceship-prompt/spaceship-prompt"

Or run the following to automatically add it:

sheldon add spaceship --github spaceship-prompt/spaceship-prompt
Arch

Install the latest release from the AUR package spaceship-prompt:

git clone https://aur.archlinux.org/spaceship-prompt.git
cd spaceship-prompt
makepkg -si

or using yay:

yay -S spaceship-prompt

Also there is an unmaintained git package spaceship-prompt-git.

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.
  2. Source Spaceship in your ~/.zshrc.

Example

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

For initializing prompt system add this to your .zshrc:

source "$HOME/.zsh/spaceship/spaceship.zsh"

βš™οΈ Configuration

Spaceship works well out of the box, but you can customize almost everything if you want.

Additionally, join our community in Discord and follow our Twitter for updates.

🫢 Contributing

We're glad to accept contributions from developers of all skill levels! If you are interested in contributing to Spaceship, please take a look at our Contribution Guide for more details. If you're looking for an easy way into the project, take one of the issues with good first issue label.

If you are fluent in any other language besides English, we greatly appreciate any help with translating our documentation in other languages. If you would like to help, join the team of translators on our Crowdin.

If you're interested in helping other people, answer questions asked by other users of Spaceship and help to solve their issues. Additionally, join our Discord to discuss Spaceship and help people who need help.

πŸ’Œ Sponsoring

If you really enjoy this project, you can contribute financially. Any contribution is highly appreciated, even the smallest one. There are several ways to donate:

πŸ€” Having trouble?

Find answers on our troubleshooting page or get help by our community.

Issues β€’ Discussions β€’ Discord

Still struggling? Please, file an issue, describe your problem, and we will gladly help you.

πŸ‘€ Derived Projects

Here's a list of related projects that have been inspired by Spaceship ZSH.

  • denysdovhan/dotfiles - Dotfiles of Spaceship's author from which Spaceship is originated.
  • matchai/spacefish - A port of Spaceship ZSH for fish shell intending to achieve complete feature parity.
  • starship/starship - A blazing-fast, cross-shell prompt written in Rust, heavily inspired by Spaceship ZSH.

πŸ“„ License

MIT Β© Denys Dovhan

spaceship-prompt's People

Contributors

ajlende avatar arttse avatar asonix avatar bleys avatar bric3 avatar denysdovhan avatar dependabot[bot] avatar estheruary avatar gillchristian avatar github-actions[bot] avatar grimmyson avatar gurpreetatwal avatar igorcoding avatar lautis avatar martinohansen avatar mawburn avatar maximbaz avatar merikan avatar nomaed avatar olets avatar poissonballon avatar rolfkoenders avatar rteabeault avatar runrioter avatar salmanulfarzy avatar segevfiner avatar semantic-release-bot avatar snuggle avatar thebluejay avatar yusufkandemir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spaceship-prompt's Issues

β¬’ n support

We need to support n - an interactive node version manager.

Probably, spaceship_nvm_status should be refactored to spaceship_node_status. In that case, we need to care of backward compatibility.

Icon: Maybe better to use different icons for nvm and n i.e ⬒ and ⬑
Related: #33

Logo ideas

Woo-hoo! Spaceship is going to get 200 stars! I think it's time to make a logo for theme. I will be grad if anybody can help me with that, so I'm looking for volontiers.

I think it have to be something simple, clean and expressive. Something that can reflect the essence and idea of the theme itself.

Examples

Bullet Train:

image

Git status Update

I've just installed your theme for .oh-my-zsh, I run it throught Babun and I got this error message everytime I browse a folder wich is a git repo :
g/uwamp/www
βž” cd ~/.oh-my-zsh/themes
spaceship_git_satus:24: command not found: git_current_branch

2016-08-13 png

Colors/Font

I know it's not part of your theme per say, but could you mention the color scheme and font you used in the demo image? It's pretty nice. Thanks!

Custom prompt ordering

There should be an option for custom prompt ordering, like:

SPACESHIP_PROMPT_ORDER=(
  user
  host
  dir
  git
  hg
  # so on
)

A useful feature for those, who wants to prompt character at the beginning, time before prompt character and so on.

Probable implementation:

spaceship_prompt() {
  # ...

  for segment in $SPACESHIP_PROMPT_ORDER; do
    spaceship_$segment
  done

  # ...
}

Install via Homebrew

Would be great if users will have ability to install Spaceship using Homebrew. Don't know how to do this. Can anyone help?

Extra quotes with the symbols.

I am not sure whether this is a problem local to me or not, but I had to do the following to get the special symbols to show without overlapping quotation marks:

export SPACESHIP_RUBY_SYMBOL=πŸ’Ž
export SPACESHIP_NVM_SYMBOL=β¬’
export SPACESHIP_PROMPT_SYMBOL=βž”
antigen theme https://github.com/denysdovhan/spaceship-zsh-theme spaceship

Result:

Workspace/cpp/on master [?$] via β¬’ v5.7.1=> (default)
 via πŸ’Ž  ruby-2.2.1
βž”

Without setting these, the prompt looked like the following (note the extra quote symbol around the icons:

Workspace/cpp on master [?$] via 'β¬’' v5.7.1=> (default)
 via 'πŸ’Ž'  ruby-2.2.1
'βž”'

Version info:

prog/work/github-representation on master [!?'⇑']
βž” zsh --version
zsh 5.0.8 (x86_64-apple-darwin15.0)

I suspect I will need similar changes for the Git pull/push symbols. I need the same change for Git pull/push icons. However, I need it only for the unicode characters, not for the ASCII characters. I guess it might have something to do with my iTerm2's setup.

Pyenv support

Hi there, thanks for the awesome theme. Is it possible to add support for pyenv alongside with virtualenv ? If you're busy I can help with PR too.

Hide username if not root

How to hide username if the user is not root via SSH?

I am using vagrant-box Ubuntu with zsh.
SSH into Ubuntu via 127.0.0.1:2222 and the username is vagrant

vagrant in vm at ~ via ⬒ v7.8.0 on 🐳  v1.13.1
βž” whoami                                                                                                                                                                               
vagrant

vagrant in vm at ~ via ⬒ v7.8.0 on 🐳  v1.13.1
βž” echo $LOGNAME                                                                                                                                                                        vagrant

I didn't see any setting in Readme.md.

Hide user in termux

I would like a config option to hide the user. In termux, I just get

 at ~
βž” 

The user is blank, one space, then at ~. I have tried setting SPACESHIP_USER_SHOW=false like #60 (though I don't see this option in the README). I have also tried DEFAULT_USER=\whoami``. Can we get a config setting to hide the user?

Add customization

Add ability to costomize the theme. Add special variables and hooks.

I think every variable should have SPACESHIP_* prefix.

Documentation issue.

I think descriptions for SPACESHIP_PROMPT_ADD_NEWLINE and SPACESHIP_PROMPT_SEPARATE_LINE in README are other way around.

nvm plugin ignores local .nvmrc files

Hi,

like your work here. I might be doing something wrong, but the nvm plugin only checks node -v version for me. I can change it to anyone I want with nvm alias default <NODE_VERSION>, but that doesn't help me that much. :(

I'd be great if it looked at local .nvmrc file to make sure which node is used/preferred for this project. Or, I'm not seeing some option to enable this feature.

I'm using this on Mac OS with oh-my-zsh

Hide user and machine name? Prompt Symbol not working either.

Should be very straight forward but, can't get mine to go away.

I've tried:

SPACESHIP_USER_SHOW=false

SPACESHIP_PREFIX_SHOW=false

DEFAULT_USER=""

Prompt line:

SPACESHIP_PROMPT_SYMBOL='βž”'

Time still displays as well:

SPACESHIP_TIME_SHOW=false

screenshot

antigen wrong name in README.md

Taken from README.md

antigen theme https://github.com/denysdovhan/spaceship-zsh-theme spaceship-zsh-theme

The spaceship-zsh-theme should match the filename of the theme, which is spaceship(.zsh-theme).

I had to change the command to the below to get it works.

antigen theme https://github.com/denysdovhan/spaceship-zsh-theme spaceship

Hostname displayed out of a SSH session

root at /home/userA on 🐳 v17.03.1-ce viaγ€”localhost〕

I'm not even in a SSH session, why do I have the hostname displayed?
I'm on Ubuntu 16.04 LTS.

Tests for Spaceship

Currently, there aren't tests for Spaceship. Would be great if we find a way to lint or test this theme somehow.

Open for discussion.

✘ Exit code of previous command

Might be useful to implement a showing of exit code, when previous command fails.

For example:

~/Projects/Repos
(127) βž”
~/Projects/Repos
✘127 βž”
~/Projects/Repos
(✘ 127) βž” 
~/Projects/Repos
(✘127) βž” 
~/Projects/Repos
[✘127] βž” 

The examples above are just for instance. Maybe there is a better way to show this segment. Also, will be useful with #71.

Icon: ✘

Is Ruby version shown everywhere?

Hey @Zeotyn, @robbl, @gillchristian I need your help, guys.

Usually, I use nvm and that's works well for me with this flow:

  • nvm install 4 β€” install Node.js 4
  • nvm use 4 β€” use this version of Node.js (Spaceship shows version that isn't equal to system)
  • nvm use system β€” use global version of Node.js (Spaceship hides version)

Recently, I've installed rbenv and found that system version is shown everywhere:

image

When I do rbenv global 2.4.0, it shows current version:

image

Maybe we should check if Ruby's version is equal system too. In other case, Ruby version is shown everywhere and everytime, which is not spaceship-way.

Maybe I'm doing something wrong. Need your help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.