A stellar mac command-line experience with Zsh. 🌌

The Stellar Explorer
2 min readMar 24, 2020

[Zsh](http://zsh.sourceforge.net) (The *Z-Shell*): A Shell; from 2019 onwards
the standard shell built into macOs. (..you should have it)
[Oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh): Zsh plugin manager; A
delightful community-driven (with 1500+ contributors) framework for managing your zsh configuration.

Installation

On macos, you should already have zsh installed and maybe already running it, since Apple made it standard since 2019.

Check if you have zsh on your system: Have a look at the output of zsh — version to know.

Check if you’re currently running zsh or for example bash: Look at the output of which $SHELL .

If you know you don’t have zsh: You can run brew install zsh or apt install zsh (linux)to install it.

In case you don’t have homebrew installed yet, have a look at this:

Go stellar with homebrew, the missing MacOs package manager. 👨🏼‍🚀

Make Zsh your default shell: Run chsh -s (which $SHELL) .

My Zsh configuration

My zshrc

Let’s go over the file quickly:

line 2 creates the link to the oh-my-zsh installation

line 4 sets the zsh color theme

line 7 to 10 includes my plugins; They are basically essential, I’ve not needed any more, ever.

line 14 then loads oh-my-zsh into zsh itself

finally, line 17ff loads aliases and shortcuts that I’ve setup

In the code snippet above, you can see first of all, that my zshrc is quite small. I implemented an atomic structure to make my whole setup more modular and decentralised. Why? To reduce files used. Now, my directory bookmark file can be shared between multiple programs and my aliases don’t clutter the .zshrc as they can also be used by e.g. ranger.

The actual look, colors and included items of the Zsh prompt is defined in the color scheme.

I like to keep my development and work environment to be clean and don’t like bloat. That’s why I don’t use something like powerlevel9k or similar.

For many people options like spaceship-prompt or pure-prompt are good options I’d recommend. There are also seemingly endless themes and syntax schemes for zsh, solarised is very popular, I personally use dim; here is a list of many of them: zsh themes.

I won’t go over setting up and configuring the zsh prompt, creating a custom theme or functionality of zsh. I will have separate entries for that, including a deeper dive at my personal setup.

--

--