Mac rockin’ terminal

Anthony Roux
3 min readJul 17, 2019

--

As you can see above, I customized my terminal to do different things:

  • Add a nice breadcrumb with git information,
  • Add a custom bar on the right which provides some contextual information such as the time to execute a command, the status of the command, the date and the time when the command has been executed,
  • Add a custom command: lc which executes a ls with nice display (as you can see above) but slower than ls.

Step-by-step guide

Install Oh-My-Zsh

Oh My Zsh is an open source, community-driven framework for managing your ZSH configuration.

You can install it using wget:

sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

You can add plugins to improve Oh-My-Zsh, the ones I will be using later are:

git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions
git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

Install powerlevel9k

Powerlevel9k is a theme for ZSH which uses Powerline Fonts.

You can install it using git:

$ git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k

Install nerd fonts

Nerd Fonts is a project that patches developer targeted fonts with a high number of glyphs (icons).

You can install it using brew:

brew tap homebrew/cask-fonts
brew install --cask font-hack-nerd-font

Configure your .zshrc

You can find the configuration I used here (don’t forget to change your default user name on line 2, it’s used to hide it in the terminal when it’s the usual one).

You can find some other ones here, for each of them you have the configuration, the font and the theme needed.

cp ~/.zshrc ~/.zshrc.backup
vi ~/.zshrc

Install the Solarized Dark theme for your terminal

You can find the documentation here.

Download this folder

Double click on Solarized Dark.terminal to install it (you might need to allow it in System Preferences -> Security and Privacy -> Allow)

Open your terminal -> On the menu bar Terminal / Preferences / Profiles:

  • In the list select Solarized Dark theme and click on the default button to set it by default (bottom left)
  • In the right part -> text tab / font / click on the change button and select your font (here: Hack Nerd Font)

Install colorls

colorls is A Ruby script that colorizes the ls output and adds icons.

  1. Install Ruby (preferably, version ≥ 2.5)

2. Install the patched fonts of powerline nerd-font and/or font-awesome. Have a look at nerdfont’s README for more installation instructions.

Note for iTerm2 users - Please enable the Nerd Font at iTerm2 > Preferences > Profiles > Text > Non-ASCII font > Hack Regular Nerd Font Complete.

3. Install colorls:

gem install colorls

Note for rbenv users: in case of load error when using lc, please try the below patch.

rbenv rehashrehash

4. Add the alias to lc :

vi ~/.zshrcalias lc='colorls -A --sd'

5. Start using colorls :

You can take a look at Recommended configurations.

You are done! Enjoy your new terminal :)

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Anthony Roux
Anthony Roux

Written by Anthony Roux

Doing DevRel for an open API program. Addicted to ski & scuba-diving.

No responses yet

Write a response