Insights / design

My Terminal Setup.

by Corfitz.
Written: 15 May, 2019

If you are like me, you care about the look and feel of your dev environment. Therefor I am writing this article as a documentation for how I have customised my terminal setup, so I also know how to implement it in the future. 😅

Shell

First up – I am using a different shell than standard for Mac OS. Oh-My-Zsh is an open source, community-driven framework that manages your Zsh configuration and comes bundled with lots of features and functionality along with theming for a more visual terminal layout.

https://ohmyz.sh/

$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Terminal

I am using Hyper, which is a simple and fast terminal developed and maintained by ZEIT. (You may remember ZEIT as being the team behind Next.js for React and the wonderful Now solution on which this very page is hosted.)

https://hyper.is/

Download for Mac

Theme

Contrast and bright colours are exactly what I am looking for in a theme. I am currently using Cobalt2 by Wes Bos in my VS Code environment, so I started out with that, but later was introduced to the Snazzy theme, which I find a little better suited for CLI work.

https://github.com/sindresorhus/hyper-snazzy

$ hyper install hyper-snazzy

Hyper Plugins

Additionally, I have a few extra plugins installed for the terminal, in order to make the experience and workflow better for me.

plugins: [
    "hyper-search",
    "hyper-sync-settings",
    "hyper-snazzy",
    "hyper-statusline",
    "hyper-tabs-enhanced",
    "hyper-quit",
    "hypercwd",
],

Prompt

The Snazzy theme also recommended a few extra additions for a more elegant and cleaner design, why I installed Pure. It is a fast, minimalistic and pretty ZSH prompt designed to remove all the clutter and improves some visuals like highlighting changes in git branches and pull/push state, current path, and only displays the host and username whenever I am working on a remote machine, to keep it “pure”.

https://github.com/sindresorhus/pure

$ npm install --global pure-prompt

After global installation, add the following to the end of your ~/.zshrc file

# .zshrc 
autoload -U promptinit; promptinit 
prompt pure 

Zsh Auto Suggestions

zsh-autosuggestions is a Fish-like fast/unobtrusive autosuggestions for zsh. It suggests commands as you type, based on command history. I can’t explain how much this has helped me increase in speed and efficiency. Can’t recommend it enough.

https://github.com/zsh-users/zsh-autosuggestions

$ git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

Zsh Syntax Highlighting

zsh-syntax-highlighting is, as the name suggests, a syntax highlighter for ZSH similar to the Fish Shell. This is one of those exact reasons I wanted to change the terminal UI to begin with. As a programmer, you are used to have beautiful structured syntax highlighting to separate elements of your code, what I initially also was looking for in my terminal. So here it is!

https://github.com/zsh-users/zsh-syntax-highlighting

$ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

Update Zsh Plugins

Finally, once everything has been configured and installed, you have to add the two plugins above to your ~/.zshrc file.

plugins=(git osx zsh-autosuggestions zsh-syntax-highlighting)

And don’t forget to source your Zsh Configuration file.

$ source ~/.zshrc

Final Result!

A beautiful, minimalistic and fast terminal maximising effeciency and at the same time visually appealing. Good luck!