My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Mac rockin’ terminal

Anthony Roux's photo
Anthony Roux
·Apr 13, 2020

blog1.png

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 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 https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

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 caskroom/fonts 
brew cask install font-meslo-nerd-font
# replace font-meslo-nerd-font by any font name you want to install

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

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
  • In the right part -> text tab / font / click on the change button and select your font (here: Knack Regular Nerd Font Complete)

Install colorls

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

a. Install Ruby (preferably, version > 2.1)

b. 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 > Knack Regular Nerd Font Complete.

c. Install colorls :

gem install colorls

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

rbenv rehash
rehash

d. Add the alias to lc:

vi ~/.zshrc
alias lc='colorls'

e. Start using colorls:

You can take a look at Recommended configurations.

blog2.png

You are done! Enjoy your new terminal :)