Post

How to Setup an Amazing Terminal

Customize your macOS terminal with Oh My Zsh, Powerlevel10k, and handy plugins.

How to Setup an Amazing Terminal

Having a productive terminal setup can significantly enhance your workflow as a developer. With features like syntax highlighting, autocomplete suggestions, and powerful themes, a well-configured terminal not only looks great but also boosts productivity.

In this guide, I’ll share my way of setting up Oh My Zsh, the Powerlevel10k theme, and a suite of useful plugins on your macOS system.


1. Install Homebrew (if not already installed)

Check out my How to Install Homebrew on macOS post for detailed instructions on how to install Homebrew.


2. Install Zsh

Zsh is the shell required for Oh My Zsh.

  1. Check if Zsh is installed by running:

    1
    
    zsh --version
    

    If Zsh is installed, you’ll see the version number. If not, install it using Homebrew:

    1
    
    brew install zsh
    
  2. Set Zsh as your default shell:

    • For Apple Silicon Macs:

      1
      
      chsh -s /opt/homebrew/bin/zsh
      
    • For Intel-based Macs:

      1
      
      chsh -s /usr/local/bin/zsh
      
  3. Restart your terminal and confirm Zsh is now the default shell:

    1
    
    echo $SHELL
    

3. Install Oh My Zsh

Oh My Zsh is a framework for managing your Zsh configuration, and it comes with a huge library of plugins and themes.

  1. Install Oh My Zsh by running:

    1
    
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
    
  2. After installation, your terminal prompt will change, and you’ll see a default Oh My Zsh theme in action.


4. Install the Powerlevel10k Theme

The Powerlevel10k theme brings modern icons, a highly customizable prompt, and useful visual indicators to your terminal.

  1. Install the recommended font for Powerlevel10k: MesloLGS NF. You can download it from here and install it using the Font Book application on macOS.

  2. Install the Powerlevel10k theme by running:

    1
    2
    
    git clone --depth=1 https://github.com/romkatv/powerlevel10k.git \
      ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
    
  3. Set Powerlevel10k as the active theme:

    1
    
    nano ~/.zshrc
    

    Locate the line:

    1
    
    ZSH_THEME="robbyrussell"
    

    and replace it with:

    1
    
    ZSH_THEME="powerlevel10k/powerlevel10k"
    

    Save (ctrl + O, then enter) and exit (ctrl + X).

  4. Restart the terminal. On first load, the Powerlevel10k configuration wizard will guide you through customizing your prompt. If the wizard doesn’t appear, you can start it manually:

    1
    
    p10k configure
    

5. Install and Configure Additional Plugins

Oh My Zsh supports a wide range of plugins that can enhance your terminal experience even further.

5.1 Install Plugins That Are Not Included by Default

  1. autojump (quickly navigate your filesystem based on usage frequency):

    1
    
    brew install autojump
    

    Follow any instructions printed after installation (such as adding lines to your .zshrc).

  2. zsh-autosuggestions (inline suggestions based on command history):

    1
    2
    
    git clone https://github.com/zsh-users/zsh-autosuggestions \
      ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
    
  3. zsh-autocomplete (enhanced completion experience):

    1
    2
    
    git clone https://github.com/marlonrichert/zsh-autocomplete \
      ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autocomplete
    
  4. zsh-syntax-highlighting (highlights commands as you type):

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

5.2 Plugins Already Included With Oh My Zsh

  • web-search
  • bundler
  • npm
  • macos
  • rake
  • rbenv
  • ruby

These are shipped with Oh My Zsh, so you only need to enable them.

5.3 Enable Plugins in Your .zshrc

Open (or reopen) your .zshrc:

1
nano ~/.zshrc

Locate the plugins array and make sure it looks something like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
plugins=(
  git
  autojump
  zsh-autosuggestions
  zsh-autocomplete
  zsh-syntax-highlighting
  web-search
  bundler
  npm
  macos
  rake
  rbenv
  ruby
)

After making changes, save (ctrl + O, then enter) and exit (ctrl + X).

5.4 Apply Changes

Load the new configuration immediately by running:

1
source ~/.zshrc

Conclusion

With Oh My Zsh, the Powerlevel10k theme, and these plugins, your terminal becomes a powerful productivity tool. You’ll now have a feature-rich shell with modern styling, fast autocompletion, and a customizable prompt—all designed to enhance your workflow. Enjoy your newly upgraded terminal setup!

This post is licensed under CC BY 4.0 by the author.