Aller au contenu

Getting Started

Welcome aboard! Let's install Spaceship on your machine, astronaut!

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" #> 
    

Installing

Now that the requirements are satisfied, you can install Spaceship via any of the following approaches:

Hint

If you're using any plugin manager, like Oh-My-Zsh, antigen, zgen, zplug or other, this might not be the best way to install Spaceship for you.

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

Example

Terminal
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:

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

Installing Spaceship via Homebrew is a simple command:

Terminal
brew install spaceship

Add prompt initialization to your .zshrc:

Terminal
echo "source $(brew --prefix)/opt/spaceship/spaceship.zsh" >>! ~/.zshrc

Tip

You can also add the following to your Brewfile to bundle Spaceship along with your other software:

Brewfile
brew "spaceship"

Clone this repo:

Terminal
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:

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

Set ZSH_THEME="spaceship" in your .zshrc.

Install Spaceship via npm as you would with any other global package:

Terminal
npm install -g spaceship-prompt

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

Tip

Update Spaceship to new versions as you would any other package.

  • 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.

Add Spaceship to your .zimrc:

.zimrc
zmodule spaceship-prompt/spaceship-prompt --name spaceship --no-submodules

Then install Spaceship:

Terminal
zimfw install

Add the following snippet in your .zshrc:

.zshrc
antigen theme spaceship-prompt/spaceship-prompt

Update your .zshrc file with the following line:

.zshrc
antibody bundle spaceship-prompt/spaceship-prompt

Add the following line to your .zshrc where you're adding your other Zsh plugins:

.zshrc
zinit light spaceship-prompt/spaceship-prompt

Add the following line to your .zshrc where you're adding your other Zsh plugins:

.zshrc
zgen load spaceship-prompt/spaceship-prompt spaceship

Use this command in your .zshrc to load Spaceship as prompt theme:

.zshrc
zplug "spaceship-prompt/spaceship-prompt", use:spaceship.zsh, from:github, as:theme

Add the following to your plugins.toml file (open it with sheldon edit):

plugins.toml
[plugins.spaceship]
github = "spaceship-prompt/spaceship-prompt"

Or run the following to automatically add it:

Terminal
sheldon add spaceship --github spaceship-prompt/spaceship-prompt

Install the latest master from the AUR package spaceship-prompt-git:

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

Congratulations!

You've made it! You've installed Spaceship on your machine!

What's next? Spaceship has reasonable defaults, but you might want to adjust them to your needs. Learn how to configure your Spaceship:

Configure Spaceship

Additionally, join our community or consider contributing to the project.

Contribute Twitter Discord

Having trouble?

Find answers on our troubleshooting page or get help by our community. Still struggling? Please, file an issue, describe your problem, and we will gladly help you.

Discord Discussions Issues