2.11.0 โ€ข Published 7 years ago

spaceship-zsh-theme v2.11.0

Weekly downloads
35
License
MIT
Repository
github
Last release
7 years ago

โญ๐Ÿš€ Spaceship ZSH

NPM version ZSH Oh-My-Zsh Donate with card Donate with Bitcoin Donate with Ethereum

An โ€œOh My ZSH!โ€ theme for Astronauts.

Spaceship is a minimalistic, powerful and extremely customizable โ€œOh My ZSH!โ€ 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:
    • ? โ€” untracked changes;
    • + โ€” uncommitted changes in the index;
    • ! โ€” unstaged changes;
    • ยป โ€” renamed files;
    • โœ˜ โ€” deleted files;
    • $ โ€” stashed changes;
    • = โ€” unmerged changes;
    • โ‡ก โ€” ahead of remote branch;
    • โ‡ฃ โ€” behind of remote branch;
    • โ‡• โ€” diverged chages.
  • Mercurial repo status:
    • ? โ€” untracked changes;
    • + โ€” uncommitted changes in the index;
    • ! โ€” unstaged changes;
    • โœ˜ โ€” deleted files;
  • 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.
  • If repo is a package, shows its version through npm (๐Ÿ“ฆ).
  • Current Node.js version, through nvm/nodenv/n (โฌข).
  • Current Ruby version, through rvm/rbenv/chruby (๐Ÿ’Ž).
  • Current Elixir version, through kiex/exenv/elixir (๐Ÿ’ง).
  • Current Swift version, through swiftenv (๐Ÿฆ).
  • Current Xcode version, through xenv (๐Ÿ› ).
  • Current Go version (๐Ÿน).
  • Current PHP version (๐Ÿ˜).
  • Current Rust version (๐—ฅ)
  • Current version of Haskell Tool Stack (ฮป)
  • Current Julia version (เฎƒ)
  • Current Docker version and connected machine (๐Ÿณ).
  • Current Amazon Web Services (AWS) profile (โ˜๏ธ) (Using named profiles)
  • Current Python virtualenv.
  • Current Conda virtualenv (๐Ÿ…’).
  • Current Python pyenv (๐Ÿ).
  • Current .NET SDK version, through dotnet-cli (.NET).
  • Current Ember.js version, through ember-cli (๐Ÿน).
  • Current Kubectl context (โ˜ธ๏ธ).
  • Current battery level and status:
    • โ‡ก - charging;
    • โ‡ฃ - discharging;
    • โ€ข - fully charged;
  • Current Vi-mode mode (with handy aliases for temporarily enabling).
  • Indicator for jobs in the background (โœฆ).
  • Optional exit-code of last command (how to enable).
  • Optional time stamps 12/24hr in format (how to enable).
  • Execution time of the last command if it exceeds the set threshold.

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

Preview

You can find more examples with different color schemes in Screenshots wiki-page.

Requirements

For correct work you will first need:

Installing

npm

npm install -g spaceship-zsh-theme

Done. This command should link spaceship.zsh-theme to your $ZSH_CUSTOM/themes and set ZSH_THEME to "spaceship". Just reload your terminal.

Tip: Update Spaceship to new versions as any other package.

oh-my-zsh

Installing using curl:

curl -o - https://raw.githubusercontent.com/denysdovhan/spaceship-zsh-theme/master/install.zsh | zsh

Installing using wget:

wget -O - https://raw.githubusercontent.com/denysdovhan/spaceship-zsh-theme/master/install.zsh | zsh

antigen

Add the following snippet ~/.zshrc after the line antigen use oh-my-zsh:

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

antibody

Update your .zshrc file with the following line:

antibody bundle denysdovhan/spaceship-zsh-theme

zgen

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

zgen load denysdovhan/spaceship-zsh-theme spaceship

zplug

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

zplug denysdovhan/spaceship-zsh-theme, use:spaceship.zsh, from:github, as:theme

Manual

If you have problems with approches above, follow these instructions:

  1. Download the theme here
  2. Rename spaceship.zsh to spaceship.zsh-theme
  3. Put the file spaceship.zsh-theme in $ZSH_CUSTOM/themes/
  4. Add the line to your ~/.zshrc: ZSH_THEME="spaceship"

Options

Now you have ability to disable elements of Spaceship. All options must be overridden in your .zshrc file.

Take a look at popular option presets or share your own configuration in Presets wiki page.

Order

You can specify the order of prompt section using SPACESHIP_PROMPT_ORDER option. Use zsh array syntax to define your own prompt order. The default order is:

SPACESHIP_PROMPT_ORDER=(
  time          # Time stampts section
  user          # Username section
  host          # Hostname section
  dir           # Current directory section
  git           # Git section (git_branch + git_status)
  hg            # Mercurial section (hg_branch  + hg_status)
  package       # Package version
  node          # Node.js section
  ruby          # Ruby section
  elixir        # Elixir section
  xcode         # Xcode section
  swift         # Swift section
  golang        # Go section
  php           # PHP section
  rust          # Rust section
  haskell       # Haskell Stack section
  julia         # Julia section
  docker        # Docker section
  aws           # Amazon Web Services section
  venv          # virtualenv section
  conda         # conda virtualenv section
  pyenv         # Pyenv section
  dotnet        # .NET section
  ember         # Ember.js section
  kubecontext   # Kubectl context section
  exec_time     # Execution time
  line_sep      # Line break
  battery       # Battery level and status
  vi_mode       # Vi-mode indicator
  jobs          # Backgound jobs indicator
  exit_code     # Exit code section
  char          # Prompt character
)

Prompt

VariableDefaultMeaning
SPACESHIP_PROMPT_SYMBOLโžœCharacter to be shown before any command
SPACESHIP_PROMPT_ADD_NEWLINEtrueAdds a newline character before each prompt line
SPACESHIP_PROMPT_SEPARATE_LINEtrueMake the prompt span across two lines
SPACESHIP_PROMPT_PREFIXES_SHOWtrueShow prefixes before prompt sections or not
SPACESHIP_PROMPT_SUFFIXES_SHOWtrueShow suffixes before prompt sections or not
SPACESHIP_PROMPT_DEFAULT_PREFIXviaDefault prefix for prompt sections
SPACESHIP_PROMPT_DEFAULT_SUFFIXDefault suffix for prompt section

Time (time)

Disabled as default. Set SPACESHIP_TIME_SHOW to true in your .zshrc, if you need to show time stamps.

VariableDefaultMeaning
SPACESHIP_TIME_SHOWfalseShow time (set to true for enabling)
SPACESHIP_TIME_PREFIXatPrefix before time section
SPACESHIP_TIME_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after time section
SPACESHIP_TIME_COLORyellowColor of time section
SPACESHIP_TIME_FORMATfalseCustom date formatting (e.g. %D{%a %R}) ZSH date formats
SPACESHIP_TIME_12HRfalseFormat time using 12-hour clock (am/pm)

Username (user)

Username is shown only when it's not the same as $LOGNAME, when you're connected via SSH or when you're root. Root user is highlighted in SPACESHIP_USER_COLOR_ROOT color (red as default).

VariableDefaultMeaning
SPACESHIP_USER_SHOWtrueShow user section
SPACESHIP_USER_PREFIXwithPrefix before user section
SPACESHIP_USER_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after user section
SPACESHIP_USER_COLORyellowColor of user section
SPACESHIP_USER_COLOR_ROOTredColor of user section when it's root

Hostname (host)

Hostname is shown only when you're connected via SSH.

VariableDefaultMeaning
SPACESHIP_HOST_SHOWtrueShow host section
SPACESHIP_HOST_PREFIXatPrefix before the connected SSH machine name
SPACESHIP_HOST_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after the connected SSH machine name
SPACESHIP_HOST_COLORgreenColor of host section

Directory (dir)

Directory is always shown and truncated to the value of SPACESHIP_DIR_TRUNC.

VariableDefaultMeaning
SPACESHIP_DIR_SHOWtrueShow directory section
SPACESHIP_DIR_PREFIXinPrefix before current directory
SPACESHIP_DIR_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after current directory
SPACESHIP_DIR_TRUNC3Number of folders of cwd to show in prompt, 0 to show all
SPACESHIP_DIR_COLORcyanColor of directory section

Git (git)

Git section is consists with git_branch and git_status subsections. It is shown only in Git repositories.

VariableDefaultMeaning
SPACESHIP_GIT_SHOWtrueShow Git section
SPACESHIP_GIT_PREFIXonPrefix before Git section
SPACESHIP_GIT_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after Git section
SPACESHIP_GIT_SYMBOL๎‚ Character to be shown before Git section (requires powerline patched font)

Git branch (git_branch)

VariableDefaultMeaning
SPACESHIP_GIT_BRANCH_SHOWtrueShow Git branch subsection
SPACESHIP_GIT_BRANCH_PREFIX$SPACESHIP_GIT_SYMBOLPrefix before Git branch subsection
SPACESHIP_GIT_BRANCH_SUFFIX | Suffix after Git branch subsection
SPACESHIP_GIT_BRANCH_COLORmagentaColor of Git branch subsection

Git status (git_status)

Git status indicators is shown only when you have dirty repository.

VariableDefaultMeaning
SPACESHIP_GIT_STATUS_SHOWtrueShow Git status subsection
SPACESHIP_GIT_STATUS_PREFIX[Prefix before Git status subsection
SPACESHIP_GIT_STATUS_SUFFIX]Suffix after Git status subsection
SPACESHIP_GIT_STATUS_COLORredColor of Git status subsection
SPACESHIP_GIT_STATUS_UNTRACKED?Indicator for untracked changes
SPACESHIP_GIT_STATUS_ADDED+Indicator for added changes
SPACESHIP_GIT_STATUS_MODIFIED!Indicator for unstaged files
SPACESHIP_GIT_STATUS_RENAMEDยปIndicator for renamed files
SPACESHIP_GIT_STATUS_DELETEDโœ˜Indicator for deleted files
SPACESHIP_GIT_STATUS_STASHED$Indicator for stashed changes
SPACESHIP_GIT_STATUS_UNMERGED=Indicator for unmerged changes
SPACESHIP_GIT_STATUS_AHEADโ‡กIndicator for unpushed changes (ahead of remote branch)
SPACESHIP_GIT_STATUS_BEHINDโ‡ฃIndicator for unpulled changes (behind of remote branch)
SPACESHIP_GIT_STATUS_DIVERGEDโ‡•Indicator for diverged chages (diverged with remote branch)

Mercurial (hg)

Mercurial section is consists with hg_branch and hg_status subsections. It is shown only in Mercurial repositories.

VariableDefaultMeaning
SPACESHIP_HG_SHOWtrueShow Mercurial section
SPACESHIP_HG_PREFIXonPrefix before Mercurial section
SPACESHIP_HG_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after Mercurial section
SPACESHIP_HG_SYMBOLโ˜ฟCharacter to be shown before Mercurial section

Mercurial branch (hg_branch)

VariableDefaultMeaning
SPACESHIP_HG_BRANCH_SHOWtrueShow Mercurial branch subsection
SPACESHIP_HG_BRANCH_PREFIX$SPACESHIP_HG_SYMBOLPrefix before Mercurial branch subsection
SPACESHIP_HG_BRANCH_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after Mercurial branch subsection
SPACESHIP_HG_BRANCH_COLORmagentaColor of Mercurial branch subsection

Mercurial status (hg_status)

Mercurial status indicators is shown only when you have dirty repository.

VariableDefaultMeaning
SPACESHIP_HG_STATUS_SHOWtrueShow Mercurial status subsection
SPACESHIP_HG_STATUS_PREFIX[Prefix before Mercurial status subsection
SPACESHIP_HG_STATUS_SUFFIX]Suffix after Mercurial status subsection
SPACESHIP_HG_STATUS_COLORredColor of Mercurial status subsection
SPACESHIP_HG_STATUS_UNTRACKED?Indicator for untracked changes
SPACESHIP_HG_STATUS_ADDED+Indicator for added changes
SPACESHIP_HG_STATUS_MODIFIED!Indicator for unstaged files
SPACESHIP_HG_STATUS_DELETEDโœ˜Indicator for deleted files

Package version (package)

Works only for npm at the moment. Please, help us improve this section!

Package version is shown when repository is a package (contains a package.json file). This is the version of the package you are working on, not the version of package manager itself.

VariableDefaultMeaning
SPACESHIP_PACKAGE_SHOWtrueShow package version
SPACESHIP_PACKAGE_PREFIXisPrefix before package version section
SPACESHIP_PACKAGE_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after package version section
SPACESHIP_PACKAGE_SYMBOL๐Ÿ“ฆCharacter to be shown before package version
SPACESHIP_PACKAGE_COLORredColor of package version section

Node.js (node)

Node.js section is shown only in directories that contain package.json file, or node_modules folder, or any other file with .js extension.

If you use n as Node.js version manager, please, set SPACESHIP_NODE_DEFAULT_VERSION to the default Node.js version. If current version is the same as SPACESHIP_NODE_DEFAULT_VERSION, then Node.js section will be hidden.

VariableDefaultMeaning
SPACESHIP_NODE_SHOWtrueCurrent Node.js section
SPACESHIP_NODE_PREFIX$SPACESHIP_PROMPT_DEFAULT_PREFIXPrefix before Node.js section
SPACESHIP_NODE_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after Node.js section
SPACESHIP_NODE_SYMBOLโฌขCharacter to be shown before Node.js version
SPACESHIP_NODE_DEFAULT_VERSION | Node.js version to be treated as default (for n support)
SPACESHIP_NODE_COLORgreenColor of Node.js section

Ruby (ruby)

Ruby section is shown only in directories that contain Gemfile, or Rakefile, or any other file with .rb extension.

VariableDefaultMeaning
SPACESHIP_RUBY_SHOWtrueShow Ruby section
SPACESHIP_RUBY_PREFIX$SPACESHIP_PROMPT_DEFAULT_PREFIXPrefix before Ruby section
SPACESHIP_RUBY_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after Ruby section
SPACESHIP_RUBY_SYMBOL๐Ÿ’ŽCharacter to be shown before Ruby version
SPACESHIP_RUBY_COLORredColor of Ruby section

Elixir (elixir)

Elixir section is shown only in directories that contain mix.exs, or any other file with .ex or .exs extension. If the current elixir version is the same as the version set in SPACESHIP_ELIXIR_DEFAULT_VERSION, the elixir section will be hidden.

VariableDefaultMeaning
SPACESHIP_ELIXIR_SHOWtrueShow Elixir section
SPACESHIP_ELIXIR_PREFIX$SPACESHIP_PROMPT_DEFAULT_PREFIXPrefix before Elixir section
SPACESHIP_ELIXIR_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after Elixir section
SPACESHIP_ELIXIR_DEFAULT_VERSION | Elixir version to be treated as default
SPACESHIP_ELIXIR_SYMBOL๐Ÿ’งCharacter to be shown before Elixir version
SPACESHIP_ELIXIR_COLORmagentaColor of Elixir section

Xcode (xcode)

Shows current version of Xcode. Local version has more priority than global.

VariableDefaultMeaning
SPACESHIP_XCODE_SHOW_LOCALtrueCurrent local Xcode version based on xcenv
SPACESHIP_XCODE_SHOW_GLOBALtrueGlobal Xcode version based on xcenv
SPACESHIP_XCODE_PREFIX$SPACESHIP_PROMPT_DEFAULT_PREFIXPrefix before Xcode section
SPACESHIP_XCODE_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after Xcode section
SPACESHIP_XCODE_SYMBOL๐Ÿ› Character to be shown before Xcode version
SPACESHIP_XCODE_COLORblueColor of Xcode section

Swift (swift)

Shows current version of Swift. Local version has more priority than global.

VariableDefaultMeaning
SPACESHIP_SWIFT_SHOW_LOCALtrueCurrent local Swift version based on swiftenv
SPACESHIP_SWIFT_SHOW_GLOBALfalseGlobal Swift version based on swiftenv
SPACESHIP_SWIFT_PREFIX$SPACESHIP_PROMPT_DEFAULT_PREFIXPrefix before the Swift section
SPACESHIP_SWIFT_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix to be shown before the Swift section
SPACESHIP_SWIFT_SYMBOL๐ŸฆCharacter to be shown before Swift version
SPACESHIP_SWIFT_COLORyellowColor of Swift section

Go (golang)

Go section is shown only in directories that contain Godeps, glide.yaml, any other file with .go extension, or when current directory is in the Go workspace defined in $GOPATH.

VariableDefaultMeaning
SPACESHIP_GOLANG_SHOWtrueShown current Go version or not
SPACESHIP_GOLANG_PREFIX$SPACESHIP_PROMPT_DEFAULT_PREFIXPrefix before the Go section
SPACESHIP_GOLANG_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after the Go section
SPACESHIP_GOLANG_SYMBOL๐ŸนCharacter to be shown before Go version
SPACESHIP_GOLANG_COLORcyanColor of Go section

PHP (php)

PHP section is shown only in directories that contain any file with .php extension.

VariableDefaultMeaning
SPACESHIP_PHP_SHOWtrueShow PHP section
SPACESHIP_PHP_PREFIX$SPACESHIP_PROMPT_DEFAULT_PREFIXPrefix before the PHP section
SPACESHIP_PHP_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after the PHP section
SPACESHIP_PHP_SYMBOL๐Ÿ˜Character to be shown before PHP version
SPACESHIP_PHP_COLORblueColor of PHP section

Rust (rust)

Rust section is shown only in directories that contain Cargo.toml or any other file with .rs extension.

VariableDefaultMeaning
SPACESHIP_RUST_SHOWtrueShown current Rust version or not
SPACESHIP_RUST_PREFIX$SPACESHIP_PROMPT_DEFAULT_PREFIXPrefix before the Rust section
SPACESHIP_RUST_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after the Rust section
SPACESHIP_RUST_SYMBOL๐—ฅCharacter to be shown before Rust version
SPACESHIP_RUST_COLORredColor of Rust section

Haskell (haskell)

Haskell section is shown only in directories that contain stack.yaml file.

VariableDefaultMeaning
SPACESHIP_HASKELL_SHOWtrueShown current Haskell Tool Stack version or not
SPACESHIP_HASKELL_PREFIX$SPACESHIP_PROMPT_DEFAULT_PREFIXPrefix before the Haskell section
SPACESHIP_HASKELL_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after the Haskell section
SPACESHIP_HASKELL_SYMBOLฮปCharacter to be shown before Haskell Tool Stack version
SPACESHIP_HASKELL_COLORredColor of Haskell section

Julia (julia)

Julia section is shown only in directories that contain file with .jl extension.

VariableDefaultMeaning
SPACESHIP_JULIA_SHOWtrueShown current Julia version or not
SPACESHIP_JULIA_PREFIX$SPACESHIP_PROMPT_DEFAULT_PREFIXPrefix before the Julia section
SPACESHIP_JULIA_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after the Julia section
SPACESHIP_JULIA_SYMBOLเฎƒCharacter to be shown before Julia version
SPACESHIP_JULIA_COLORgreenColor of Julia section

Docker (docker)

Docker section is shown only in directories that contain Dockerfile or docker-compose.yml file.

VariableDefaultMeaning
SPACESHIP_DOCKER_SHOWtrueShow current Docker version and connected docker-machine or not
SPACESHIP_DOCKER_PREFIXonPrefix before the Docker section
SPACESHIP_DOCKER_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after the Docker section
SPACESHIP_DOCKER_SYMBOL๐ŸณCharacter to be shown before Docker version
SPACESHIP_DOCKER_COLORcyanColor of Docker section

Amazon Web Services (AWS) (aws)

Shows selected Amazon Web Services profile using 'named profiles'.

VariableDefaultMeaning
SPACESHIP_AWS_SHOWtrueShow current selected AWS-cli profile or not
SPACESHIP_AWS_PREFIXusingPrefix before the AWS section
SPACESHIP_AWS_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after the AWS section
SPACESHIP_AWS_SYMBOLโ˜๏ธCharacter to be shown before AWS profile
SPACESHIP_AWS_COLOR208Color of AWS section

Virtualenv (venv)

VariableDefaultMeaning
SPACESHIP_VENV_SHOWtrueShow current Python virtualenv or not
SPACESHIP_VENV_PREFIX$SPACESHIP_PROMPT_DEFAULT_PREFIXPrefix before the virtualenv section
SPACESHIP_VENV_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after the virtualenv section
SPACESHIP_VENV_COLORblueColor of virtualenv environment section

Conda virtualenv (conda)

Show activated conda virtual environment. Disable native conda prompt by conda config --set changeps1 False.

VariableDefaultMeaning
SPACESHIP_CONDA_SHOWtrueShow current Python conda virtualenv or not
SPACESHIP_CONDA_PREFIX$SPACESHIP_PROMPT_DEFAULT_PREFIXPrefix before the conda virtualenv section
SPACESHIP_CONDA_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after the conda virtualenv section
SPACESHIP_CONDA_SYMBOL๐Ÿ…’Character to be shown before conda virtualenv section
SPACESHIP_CONDA_COLORblueColor of conda virtualenv environment section

Pyenv (pyenv)

pyenv section is shown only in directories that contain requirements.txt or any other file with .py extension.

VariableDefaultMeaning
SPACESHIP_PYENV_SHOWtrueShow current Pyenv version or not
SPACESHIP_PYENV_PREFIX$SPACESHIP_PROMPT_DEFAULT_PREFIXPrefix before the pyenv section
SPACESHIP_PYENV_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after the pyenv section
SPACESHIP_PYENV_SYMBOL๐ŸCharacter to be shown before Pyenv version
SPACESHIP_PYENV_COLORyellowColor of Pyenv section

.NET (dotnet)

.NET section is shown only in directories that contains a project.json or global.json file, or a file with one of these extensions: .csproj, .xproj or .sln.

VariableDefaultMeaning
SPACESHIP_DOTNET_SHOWtrueCurrent .NET section
SPACESHIP_DOTNET_PREFIX$SPACESHIP_PROMPT_DEFAULT_PREFIXPrefix before .NET section
SPACESHIP_DOTNET_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after .NET section
SPACESHIP_DOTNET_SYMBOL.NETCharacter to be shown before .NET version
SPACESHIP_DOTNET_COLOR128Color code of .NET section

Ember.js (ember)

Ember.js section is shown only in directories that contain a ember-cli-build.js file.

VariableDefaultMeaning
SPACESHIP_EMBER_SHOWtrueCurrent Ember.js section
SPACESHIP_EMBER_PREFIX$SPACESHIP_PROMPT_DEFAULT_PREFIXPrefix before Ember.js section
SPACESHIP_EMBER_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after Ember.js section
SPACESHIP_EMBER_SYMBOL๐ŸนCharacter to be shown before Ember.js version
SPACESHIP_EMBER_COLOR210Color of Ember.js section

Kubectl context (kubecontext)

Shows the active kubectl context.

VariableDefaultMeaning
SPACESHIP_KUBECONTEXT_SHOWtrueCurrent Kubectl context section
SPACESHIP_KUBECONTEXT_PREFIXatPrefix before Kubectl context section
SPACESHIP_KUBECONTEXT_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after Kubectl context section
SPACESHIP_KUBECONTEXT_SYMBOLโ˜ธ๏ธCharacter to be shown before Kubectl context
SPACESHIP_KUBECONTEXT_COLORcyanColor of Kubectl context section

Execution time (exec_time)

Execution time of the last command. Will be displayed if it exceeds the set threshold of time.

VariableDefaultMeaning
SPACESHIP_EXEC_TIME_SHOWtrueShow execution time
SPACESHIP_EXEC_TIME_PREFIXtookPrefix before execution time section
SPACESHIP_EXEC_TIME_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after execution time section
SPACESHIP_EXEC_TIME_COLORyellowColor of execution time section
SPACESHIP_EXEC_TIME_ELAPSED2The minimum number of seconds for showing execution time section

Battery (battery)

By default, Battery section is shown only if battery level is below SPACESHIP_BATTERY_THRESHOLD (default: 10%) or it's fully charged. It can be made always visible by setting SPACESHIP_BATTERY_ALWAYS_SHOW=true.

VariableDefaultMeaning
SPACESHIP_BATTERY_SHOWtrueShow battery section or not
SPACESHIP_BATTERY_ALWAYS_SHOWfalseAlways show battery section or not
SPACESHIP_BATTERY_PREFIX | Prefix before battery section
SPACESHIP_BATTERY_SUFFIXSPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after battery section
SPACESHIP_BATTERY_CHARGING_SYMBOLโ‡กCharacter to be shown if battery is charging
SPACESHIP_BATTERY_DISCHARGING_SYMBOLโ‡ฃCharacter to be shown if battery is discharging
SPACESHIP_BATTERY_FULL_SYMBOLโ€ขCharacter to be shown if battery is full
SPACESHIP_BATTERY_THRESHOLD10Battery level below which battery section will be shown

Vi-mode (vi_mode)

This section shows mode indicator only when Vi-mode is enabled.

VariableDefaultMeaning
SPACESHIP_VI_MODE_SHOWtrueShown current Vi-mode or not
SPACESHIP_VI_MODE_PREFIX | Prefix before Vi-mode section
SPACESHIP_VI_MODE_SUFFIX$SPACESHIP_PROMPT_DEFAULT_SUFFIXSuffix after Vi-mode section
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
SPACESHIP_VI_MODE_COLORwhiteColor of Vi-mode section

You can temporarily enable or disable vi-mode with handy functions (just execute them in terminal as any other regular command):

FunctionMeaning
spaceship_vi_mode_enableEnable vi-mode for current terminal session
spaceship_vi_mode_disableDisable vi-mode for current terminal session

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.

Jobs (jobs)

This section show only when there are active jobs in the background.

VariableDefaultMeaning
SPACESHIP_JOBS_SHOWtrueShow background jobs indicator
SPACESHIP_JOBS_PREFIX | Prefix before the jobs indicator
SPACESHIP_JOBS_SUFFIXSuffix after the jobs indicator
SPACESHIP_JOBS_SYMBOLโœฆCharacter to be shown when jobs are hiding
SPACESHIP_JOBS_COLORblueColor of background jobs section

Exit code (exit_code)

Disabled as default. Set SPACESHIP_EXIT_CODE_SHOW to true in your .zshrc, if you need to show exit code of last command.

VariableDefaultMeaning
SPACESHIP_EXIT_CODE_SHOWfalseShow exit code of last command
SPACESHIP_EXIT_CODE_PREFIX | Prefix before exit code section
SPACESHIP_EXIT_CODE_SUFFIXSuffix after exit code section
SPACESHIP_EXIT_CODE_SYMBOLโœ˜Character to be shown before exit code
SPACESHIP_EXIT_CODE_COLORredColor of exit code section

Example

Here is all options which may be changed. Copy this to your ~/.zshrc to make it easy to change.

Warning!: These overridden variables should be placed after the theme in your .zshrc file.

# ORDER
SPACESHIP_PROMPT_ORDER=(
  time
  user
  host
  dir
  git
  hg
  package
  node
  ruby
  elixir
  xcode
  swift
  golang
  php
  rust
  julia
  docker
  aws
  venv
  conda
  pyenv
  dotnet
  ember
  kubecontext
  battery
  exec_time
  line_sep
  vi_mode
  jobs
  exit_code
  char
)

# PROMPT
SPACESHIP_PROMPT_SYMBOL="โžœ"
SPACESHIP_PROMPT_ADD_NEWLINE=true
SPACESHIP_PROMPT_SEPARATE_LINE=true
SPACESHIP_PROMPT_PREFIXES_SHOW=true
SPACESHIP_PROMPT_SUFFIXES_SHOW=true
SPACESHIP_PROMPT_DEFAULT_PREFIX="via "
SPACESHIP_PROMPT_DEFAULT_SUFFIX=" "

# TIME
SPACESHIP_TIME_SHOW=false
SPACESHIP_TIME_PREFIX="at "
SPACESHIP_TIME_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_TIME_FORMAT=false
SPACESHIP_TIME_12HR=false
SPACESHIP_TIME_COLOR="yellow"

# EXECUTION TIME
SPACESHIP_EXEC_TIME_SHOW=true
SPACESHIP_EXEC_TIME_PREFIX="took "
SPACESHIP_EXEC_TIME_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_EXEC_TIME_COLOR="yellow"
SPACESHIP_EXEC_TIME_THRESHOLD=5000
SPACESHIP_EXEC_TIME_MS=false

# USER
SPACESHIP_USER_SHOW=true
SPACESHIP_USER_PREFIX="with "
SPACESHIP_USER_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_USER_COLOR="yellow"
SPACESHIP_USER_COLOR_ROOT="red"

# HOST
SPACESHIP_HOST_SHOW=true
SPACESHIP_HOST_PREFIX="at "
SPACESHIP_HOST_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_HOST_COLOR="green"

# DIR
SPACESHIP_DIR_SHOW=true
SPACESHIP_DIR_PREFIX="in "
SPACESHIP_DIR_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_DIR_TRUNC=3
SPACESHIP_DIR_COLOR="cyan"

# GIT
SPACESHIP_GIT_SHOW=true
SPACESHIP_GIT_PREFIX="on "
SPACESHIP_GIT_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_GIT_SYMBOL="๎‚  "
# GIT BRANCH
SPACESHIP_GIT_BRANCH_SHOW=true
SPACESHIP_GIT_BRANCH_PREFIX="$SPACESHIP_GIT_SYMBOL"
SPACESHIP_GIT_BRANCH_SUFFIX=""
SPACESHIP_GIT_BRANCH_COLOR="magenta"
# GIT STATUS
SPACESHIP_GIT_STATUS_SHOW=true
SPACESHIP_GIT_STATUS_PREFIX=" ["
SPACESHIP_GIT_STATUS_SUFFIX="]"
SPACESHIP_GIT_STATUS_COLOR="red"
SPACESHIP_GIT_STATUS_UNTRACKED="?"
SPACESHIP_GIT_STATUS_ADDED="+"
SPACESHIP_GIT_STATUS_MODIFIED="!"
SPACESHIP_GIT_STATUS_RENAMED="ยป"
SPACESHIP_GIT_STATUS_DELETED="โœ˜"
SPACESHIP_GIT_STATUS_STASHED="$"
SPACESHIP_GIT_STATUS_UNMERGED="="
SPACESHIP_GIT_STATUS_AHEAD="โ‡ก"
SPACESHIP_GIT_STATUS_BEHIND="โ‡ฃ"
SPACESHIP_GIT_STATUS_DIVERGED="โ‡•"

# HG
SPACESHIP_HG_SHOW=true
SPACESHIP_HG_PREFIX="on "
SPACESHIP_HG_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_HG_SYMBOL="โ˜ฟ "
# HG BRANCH
SPACESHIP_HG_BRANCH_SHOW=true
SPACESHIP_HG_BRANCH_PREFIX="$SPACESHIP_HG_SYMBOL"
SPACESHIP_HG_BRANCH_SUFFIX=""
SPACESHIP_HG_BRANCH_COLOR="magenta"
# HG STATUS
SPACESHIP_HG_STATUS_SHOW=true
SPACESHIP_HG_STATUS_PREFIX="["
SPACESHIP_HG_STATUS_SUFFIX="]"
SPACESHIP_HG_STATUS_COLOR="red"
SPACESHIP_HG_STATUS_UNTRACKED="?"
SPACESHIP_HG_STATUS_ADDED="+"
SPACESHIP_HG_STATUS_MODIFIED="!"
SPACESHIP_HG_STATUS_DELETED="โœ˜"

# PACKAGE
SPACESHIP_PACKAGE_SHOW=true
SPACESHIP_PACKAGE_PREFIX="is "
SPACESHIP_PACKAGE_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_PACKAGE_SYMBOL="๐Ÿ“ฆ "
SPACESHIP_PACKAGE_COLOR="red"

# NODE
SPACESHIP_NODE_SHOW=true
SPACESHIP_NODE_PREFIX="$SPACESHIP_PROMPT_DEFAULT_PREFIX"
SPACESHIP_NODE_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_NODE_SYMBOL="โฌข "
SPACESHIP_NODE_DEFAULT_VERSION=""
SPACESHIP_NODE_COLOR="green"

# RUBY
SPACESHIP_RUBY_SHOW=true
SPACESHIP_RUBY_PREFIX="$SPACESHIP_PROMPT_DEFAULT_PREFIX"
SPACESHIP_RUBY_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_RUBY_SYMBOL="๐Ÿ’Ž "
SPACESHIP_RUBY_COLOR="red"

# ELIXIR
SPACESHIP_ELIXIR_SHOW=true
SPACESHIP_ELIXIR_PREFIX="$SPACESHIP_PROMPT_DEFAULT_PREFIX"
SPACESHIP_ELIXIR_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_ELIXIR_SYMBOL="๐Ÿ’ง "
SPACESHIP_ELIXIR_DEFAULT_VERSION=""
SPACESHIP_ELIXIR_COLOR="magenta"

# XCODE
SPACESHIP_XCODE_SHOW_LOCAL=true
SPACESHIP_XCODE_SHOW_GLOBAL=false
SPACESHIP_XCODE_PREFIX="$SPACESHIP_PROMPT_DEFAULT_PREFIX"
SPACESHIP_XCODE_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_XCODE_SYMBOL="๐Ÿ›  "
SPACESHIP_XCODE_COLOR="blue"

# SWIFT
SPACESHIP_SWIFT_SHOW_LOCAL=true
SPACESHIP_SWIFT_SHOW_GLOBAL=false
SPACESHIP_SWIFT_PREFIX="$SPACESHIP_PROMPT_DEFAULT_PREFIX"
SPACESHIP_SWIFT_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_SWIFT_SYMBOL="๐Ÿฆ "
SPACESHIP_SWIFT_COLOR="yellow"

# GOLANG
SPACESHIP_GOLANG_SHOW=true
SPACESHIP_GOLANG_PREFIX="$SPACESHIP_PROMPT_DEFAULT_PREFIX"
SPACESHIP_GOLANG_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_GOLANG_SYMBOL="๐Ÿน "
SPACESHIP_GOLANG_COLOR="cyan"

# PHP
SPACESHIP_PHP_SHOW=true
SPACESHIP_PHP_PREFIX="$SPACESHIP_PROMPT_DEFAULT_PREFIX"
SPACESHIP_PHP_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_PHP_SYMBOL="๐Ÿ˜ "
SPACESHIP_PHP_COLOR="blue"

# RUST
SPACESHIP_RUST_SHOW=true
SPACESHIP_RUST_PREFIX="$SPACESHIP_PROMPT_DEFAULT_PREFIX"
SPACESHIP_RUST_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_RUST_SYMBOL="๐—ฅ "
SPACESHIP_RUST_COLOR="red"

# JULIA
SPACESHIP_JULIA_SHOW=true
SPACESHIP_JULIA_PREFIX="$SPACESHIP_PROMPT_DEFAULT_PREFIX"
SPACESHIP_JULIA_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_JULIA_SYMBOL="เฎƒ "
SPACESHIP_JULIA_COLOR="green"

# DOCKER
SPACESHIP_DOCKER_SHOW=true
SPACESHIP_DOCKER_PREFIX="on "
SPACESHIP_DOCKER_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_DOCKER_SYMBOL="๐Ÿณ "
SPACESHIP_DOCKER_COLOR="cyan"

# Amazon Web Services (AWS)
SPACESHIP_AWS_SHOW=true
SPACESHIP_AWS_PREFIX="using "
SPACESHIP_AWS_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_AWS_SYMBOL="โ˜๏ธ "
SPACESHIP_AWS_COLOR="208"

# VENV
SPACESHIP_VENV_SHOW=true
SPACESHIP_VENV_PREFIX="$SPACESHIP_PROMPT_DEFAULT_PREFIX"
SPACESHIP_VENV_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_VENV_COLOR="blue"

# CONDA
SPACESHIP_CONDA_SHOW=true
SPACESHIP_CONDA_PREFIX="$SPACESHIP_PROMPT_DEFAULT_PREFIX"
SPACESHIP_CONDA_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_CONDA_SYMBOL="๐Ÿ…’ "
SPACESHIP_CONDA_COLOR="blue"

# PYENV
SPACESHIP_PYENV_SHOW=true
SPACESHIP_PYENV_PREFIX="$SPACESHIP_PROMPT_DEFAULT_PREFIX"
SPACESHIP_PYENV_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_PYENV_SYMBOL="๐Ÿ "
SPACESHIP_PYENV_COLOR="yellow"

# DOTNET
SPACESHIP_DOTNET_SHOW=true
SPACESHIP_DOTNET_PREFIX="$SPACESHIP_PROMPT_DEFAULT_PREFIX"
SPACESHIP_DOTNET_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_DOTNET_SYMBOL=".NET "
SPACESHIP_DOTNET_COLOR="128"

# EMBER
SPACESHIP_EMBER_SHOW=true
SPACESHIP_EMBER_PREFIX="$SPACESHIP_PROMPT_DEFAULT_PREFIX"
SPACESHIP_EMBER_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_EMBER_SYMBOL="๐Ÿน "
SPACESHIP_EMBER_COLOR="210"

# KUBECONTEXT
SPACESHIP_KUBECONTEXT_SHOW=true
SPACESHIP_KUBECONTEXT_PREFIX="at "
SPACESHIP_KUBECONTEXT_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_KUBECONTEXT_SYMBOL="โ˜ธ๏ธ "
SPACESHIP_KUBECONTEXT_COLOR="cyan"

# BATTERY
SPACESHIP_BATTERY_SHOW=true
SPACESHIP_BATTERY_ALWAYS_SHOW=false
SPACESHIP_BATTERY_PREFIX=""
SPACESHIP_BATTERY_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_BATTERY_CHARGING_SYMBOL="โ‡ก"
SPACESHIP_BATTERY_DISCHARGING_SYMBOL="โ‡ฃ"
SPACESHIP_BATTERY_FULL_SYMBOL="โ€ข"
SPACESHIP_BATTERY_THRESHOLD=10

# VI_MODE
SPACESHIP_VI_MODE_SHOW=true
SPACESHIP_VI_MODE_PREFIX=""
SPACESHIP_VI_MODE_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_VI_MODE_INSERT="[I]"
SPACESHIP_VI_MODE_NORMAL="[N]"
SPACESHIP_VI_MODE_COLOR="white"

# JOBS
SPACESHIP_JOBS_SHOW="true"
SPACESHIP_JOBS_PREFIX=""
SPACESHIP_JOBS_SUFFIX=" "
SPACESHIP_JOBS_SYMBOL="โœฆ"
SPACESHIP_JOBS_COLOR="blue"

# EXIT CODE
SPACESHIP_EXIT_CODE_SHOW=false
SPACESHIP_EXIT_CODE_PREFIX="("
SPACESHIP_EXIT_CODE_SUFFIX=") "
SPACESHIP_EXIT_CODE_SYMBOL="โœ˜ "
SPACESHIP_EXIT_CODE_COLOR="red"

Donate

Hi! I work on this project in my spare time, beside my primary job. I hope enjoy using Spaceship, and if you do, please, buy me a cup of tea โ˜•๏ธ.

Credit/Debit cardBitcoinEthereum
Donate with LiqPay1FrPrQb6ACTkbSBAz9PduJWrDFfq41Ggb40x6aF39C917359897ae6969Ad682C14110afe1a0a1

I would appreciate your support! Thank you!

License

MIT ยฉ Denys Dovhan

2.11.0

7 years ago

2.10.3

8 years ago

2.10.2

8 years ago

2.10.1

8 years ago

2.10.0

8 years ago

2.9.0

8 years ago

2.8.0

8 years ago

2.7.3

8 years ago

2.7.2

8 years ago

2.7.1

8 years ago

2.7.0

8 years ago

2.6.3

8 years ago

2.6.2

8 years ago

2.6.0

8 years ago

2.5.3

8 years ago

2.5.2

8 years ago

2.5.1

8 years ago

2.5.0

8 years ago

2.4.2

8 years ago

2.4.1

8 years ago

2.4.0

8 years ago

2.3.1

8 years ago

2.3.0

8 years ago

2.2.2

8 years ago

2.2.1

8 years ago

2.2.0

8 years ago

2.1.0

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago