Meet Spaceship ZSH v3.0!
Three… Two… One… Liftoff!
Almost a year has passed since A big update of spaceship-zsh-theme and release of v2.0, but now we have even more exciting changes and announcements. So here we go!
The initial purpose of this release was refactoring of how Spaceship works with sections. By the way, there were a few pull-requests with breaking, but important changes. This release brings better API, new options, few performance improvements and more.
Drop Oh-My-Zsh dependency
We’ve run into troubles using built-in functions from Oh-My-Zsh (OMZ). Beside this, a lot of users would like to use Spaceship without OMZ, with their custom setup or with frameworks like prezto. That was the main reason why we decided to remove using OMZ in Spaceship code.
You don’t have to use
ZSH_CUSTOM folder anymore to install Spaceship. Since v3.0 we use a native
prompt system that comes zsh:
autoload -U promptinit; promptinit
Brand new name
Dropping OMZ means that Spaceship isn’t a theme anymore, it’s a prompt. We’ve renamed our packages and GitHub repository
spaceship-zsh-theme npm-package has been deprecated with recommendation to install
Better project structure
First of all, project structure has been totally reorganized. Previously, Spaceship was just a huge single source file and any change causes constant jumping between different parts of a single file.
Now Spaceship is split up into smaller modules (sections, utils, etc) and they are loading when it’s required. That also means, if you’re struggling with performance, you can just avoid loading the sections that you don’t use. Read more at “Why is my prompt slow?” section of documentation:
SPACESHIP_PROMPT_ORDER=( user dir host git hg node ruby elixir swift golang php rust haskell aws venv conda pyenv…denysdovhan.com
Custom sections and Spaceship API
Brice Dutheil sent us a pull-request with Allow to invoke custom functions. This feature opens an ability to define custom sections with any functionality and, therefore, to extend functionality as much as you need.
Moreover, v3.0 comes with better API for creating sections. To avoid conflicts, Spaceship uses
SPACESHIP_ prefix for variables and
spaceship:: prefix for a function. All section, including custom ones, are being required to use
spaceship_prefix before their name to load correctly.
Check out Spaceship’s API here:
This page describes Spaceship API for creating plugins and tweaking Spaceship's behavior. Spaceship uses SPACESHIP_…denysdovhan.com
We encourage you to create your section, as many as you want and share them with others on our External sections wiki-page!
Ability to extend and share sections requires new contributing guidelines, so we’ve finally added a
CONTRIBUGING.md file to our repository.
Three simple rules define our development path:
- Show only what’s needed. The prompt should not be overloaded, it shows only what user needs at the moment (current directory, git branch, etc).
- Work out of the box. The prompt should work right after installation without any additional configuration. Install it and use it.
- Be configurable. It works without configuration, but if a configuration is needed, it provides an easy-to-use interface for customization.
Please, keep this simple rules in mind while you’re contributing to Spaceship.
Spaceship supports most of the popular programming languages, runtimes, version managers, etc. If it doesn't support…denysdovhan.com
Right prompt support
The new release brings the support of right prompt (
RPROMPT). By default right prompt is empty, but you can add some sections the same way you do with a primary prompt.
Read the documentation about prompt ordering to learn more:
SPACESHIP_PROMPT_ORDER=( time user dir host git hg package node ruby elixir xcode swift golang php rust haskell julia…denysdovhan.com
Website and documentation
We are glad to announce that now Spaceship has a documentation website. We use GitBook for generating this website from our
Here’s how it looks like:
Check out our website at:
Spaceship is a minimalistic, powerful and extremely customizable Zsh prompt. It combines everything you may need for…denysdovhan.com
There was also a lot of petite, but still important changes:
- Thanks to Rolf Koenders Spaceship now truncates directory name in repositories.
- Now Spaceship has more options for displaying sections:
- We removed
LS_COLORSconfiguration from Spaceship since it doesn’t seem to be a part of prompt.
charis now a separate section that can be configurable as any other.
- Some long-standing bugs have been fixed and resolved.
You can check out Spaceship 3.0 Roadmap for further information:
A checklist and discussion about v3.0 (#148) release and new features. Roadmap Remove deprecation warnings of v2.0 Drop…github.com
It’s always interesting to see more statistic, so totally a pull-request #148 contains:
- ⏺ 178 commits
- ➕ 3,220 additions
- ➖ 2,250 deletions
- ✅ 34 closed issues in milestone
- 👨💻 +1 team member (welcome Maxim Baz 👋🏻)
Plans for future
As always, the project doesn’t stop to evolve. We have plenty of issue, pull-requests, and plans for future development.
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 ☕️.
I would appreciate your support! Thank you!