theRDnotes

2020 February 12th

Terminal setup | macOS

This guide aims to convert your boring terminal into a colorful one with added features.

Terminal

Content

Install iTerm

brew install iterm2

Li'l boring interface. Let's spice it up in the next steps

Install ZSH and ZSH completions

brew install zsh zsh-completions

Install Oh My Zsh on top of ZSH

curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh

If you don't get zsh prompt or username at the top,
check the default shell, using echo $SHELL
and expect /usr/bin/zsh as the result or something similar.
If that's not the case then
use chsh -s /bin/zsh
or chsh -s $(which zsh)
command to make zsh your default shell and then restart the shell.

Install Nerd Font

For extra font symbols and glyphs like below

  1. Download the Meslo Nerd Font from https://www.nerdfonts.com/font-downloads and extract the zip file.
  2. Install Meslo LG M Regular Nerd Font Complete.ttf by double-clicking it.
  3. Configure iTerm2 to use the new font:
    Open iTerm2 → Preferences → Profiles → Text and set Font to MesloLGM Nerd Font.

Install PowerLevel10k

Follow the guide at https://github.com/romkatv/powerlevel10k

Steps I followed:

  1. Installation of PowerLevel10k for Oh My Zsh

    git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
  2. Set ZSH_THEME="powerlevel10k/powerlevel10k" in ~/.zshrc.
  3. Restart zsh.
  4. Type p10k configure if the configuration wizard doesn't start automatically.

Theme

I'm using Elementary theme from https://iterm2colorschemes.com/
Download and import/select it in iTerm2 → Preferences → Profiles → Color → Color Presets

Plugins

zsh-autosuggestions

This plugin will suggest command as you write from the terminal history.
Just use right arrow key to complete the command.

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

Steps I followed:

  1. Installation

    brew install zsh-autosuggestions
  2. To activate the autosuggestions, add the following at the end of your .zshrc:

    source #{HOMEBREW_PREFIX}/share/zsh-autosuggestions/zsh-autosuggestions.zsh
  3. You will also need to force reload of your .zshrc:

    source ~/.zshrc