An “Oh My ZSH!” theme for Astronauts.
Spaceship is an “Oh My ZSH!” minimalistic and powerful theme. It combines everything you may need for convenient work, without unnecessary complications, like a real spaceship.
Currently it shows:
- Current git branch.
- Git repo status:
+
— uncommitted changes in the index;!
— unstaged changes;?
— untracked changes;$
— stashed changes;⇣
— unpulled commits;⇡
— unpushed commits.
- Prompt character turns red if the last command exits with non-zero code.
- Hostname only displayed when in an SSH session.
- Username displayed only when it isn't
$LOGNAME
. - Username turns red when root.
- Current Node.js version, through NVM (
⬢
). - Current Ruby version, through RVM/RBENV/CHRUBY (
💎
). - Current Python virtualenv.
- Current Vi-mode mode.
Want more features? Please, open an issue or send pull request.
For correct work you will first need:
Installing using curl:
curl -o - https://raw.githubusercontent.com/denysdovhan/spaceship-zsh-theme/master/install.sh | zsh
Installing using wget:
wget -O - https://raw.githubusercontent.com/denysdovhan/spaceship-zsh-theme/master/install.sh | zsh
If you have problems, follow these instructions:
- Download the theme here
- Rename
spaceship.zsh
tospaceship.zsh-theme
- Put the file
spaceship.zsh-theme
in$ZSH_CUSTOM/themes/
- Add the line to your
~/.zshrc
:
ZSH_THEME="spaceship"
Add the following snippet ~/.zshrc
after the line antigen use oh-my-zsh
:
antigen theme https://github.com/denysdovhan/spaceship-zsh-theme spaceship
Add the following line to your ~/.zshrc
where you're adding your other zsh plugins:
zgen load denysdovhan/spaceship-zsh-theme spaceship
The spaceship theme looks awesome with some popular color schemes. Take a look to make sure:
Now you have ability to disable elements of Spaceship. All options must be overridden in your .zshrc
file.
Variable | Default | Meaning |
---|---|---|
SPACESHIP_PROMPT_SYMBOL |
➔ |
Character to be shown before any command |
SPACESHIP_PROMPT_SEPARATE_LINE |
true |
Make the prompt span across two lines |
SPACESHIP_PROMPT_ADD_NEWLINE |
true |
Adds a newline character before each prompt line |
SPACESHIP_PROMPT_TRUNC |
3 |
Number of folders of cwd to show in prompt, 0 to show all |
Variable | Default | Meaning |
---|---|---|
SPACESHIP_GIT_SHOW |
true |
Show/hide git status |
SPACESHIP_GIT_UNCOMMITTED |
+ |
Character to be shown on uncommitted changes |
SPACESHIP_GIT_UNSTAGED |
! |
Character to be shown on unstaged changes |
SPACESHIP_GIT_UNTRACKED |
? |
Character to be shown on untracked changes |
SPACESHIP_GIT_STASHED |
$ |
Character to be shown on stashed changes |
SPACESHIP_GIT_UNPULLED |
⇣ |
Character to be shown on unpulled changes |
SPACESHIP_GIT_UNPUSHED |
⇡ |
Character to be shown on unpushed changes |
Variable | Default | Meaning |
---|---|---|
SPACESHIP_NVM_SHOW |
true |
Current Node.js version |
SPACESHIP_NVM_SYMBOL |
⬢ |
Character to be shown before Node.js version |
Variable | Default | Meaning |
---|---|---|
SPACESHIP_RUBY_SHOW |
true |
Current Ruby version |
SPACESHIP_RUBY_SYMBOL |
💎 |
Character to be shown before Ruby version |
Variable | Default | Meaning |
---|---|---|
SPACESHIP_VENV_SHOW |
true |
Current Python virtualenv |
Variable | Default | Meaning |
---|---|---|
SPACESHIP_VI_MODE_SHOW |
true |
Current Vi-mode |
SPACESHIP_VI_MODE_INSERT |
[I] |
Text to be shown when in insert mode |
SPACESHIP_VI_MODE_NORMAL |
[N] |
Text to be shown when in normal mode |
Note: For oh-my-zsh users with vi-mode plugin enabled: Add export RPS1="%{$reset_color%}"
before source $ZSH/oh-my-zsh.sh
in ~/.zshrc to disable default <<<
NORMAL mode indicator in right prompt.
Here is all optins which may be changed. Copy this to your ~/.zshrc
to make it easy to change.
# PROMPT
SPACESHIP_PROMPT_SYMBOL='➔'
SPACESHIP_PROMPT_ADD_NEWLINE=true
SPACESHIP_PROMPT_SEPARATE_LINE=true
# GIT
SPACESHIP_GIT_SHOW=true
SPACESHIP_GIT_UNCOMMITTED='+'
SPACESHIP_GIT_UNSTAGED='!'
SPACESHIP_GIT_UNTRACKED='?'
SPACESHIP_GIT_STASHED='$'
SPACESHIP_GIT_UNPULLED='⇣'
SPACESHIP_GIT_UNPUSHED='⇡'
# NVM
SPACESHIP_NVM_SHOW=true
SPACESHIP_NVM_SYMBOL='⬢'
# RUBY
SPACESHIP_RUBY_SHOW=true
SPACESHIP_RUBY_SYMBOL='💎'
# VENV
SPACESHIP_VENV_SHOW=true
# VI_MODE
SPACESHIP_VI_MODE_SHOW=true
SPACESHIP_VI_MODE_INSERT="[I]"
SPACESHIP_VI_MODE_NORMAL="[N]"
MIT © Denys Dovhan