Terminal : Setting Up and Customizing Your Terminal with Oh My Zsh and Powerlevel10k

Siddu HussainSiddu Hussain
3 min read

A customized terminal can enhance your productivity and make your development environment more visually appealing. This guide walks you through setting up Oh My Zsh, installing Powerlevel10k for a sleek terminal theme, and configuring the necessary fonts for the best experience.


Step 1: Install and Set Up Oh My Zsh

  1. Open Terminal:

    Open your terminal application.

  2. Set zsh as Default:

    Ensure that zsh is set as your default shell by typing:

     zsh
    
  3. Install Oh My Zsh:

    Go to the Oh My Zsh website and follow the installation instructions. Alternatively, run the following command in your terminal:

     sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
    
  4. On Success:

Step 2: Install Powerlevel10k Theme

  1. Clone the Powerlevel10k Repository:

    Run the following command to install Powerlevel10k:

     git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
    
  2. Configure Powerlevel10k in .zshrc:

    Open your .zshrc file with a text or code editor. Here, we use VS Code:

     code ~/.zshrc
    
  3. Modify the Theme Setting:

    Find the line that sets the theme, which looks like this:

     ZSH_THEME="robbyrussell"
    

    Replace it with:

     ZSH_THEME="powerlevel10k/powerlevel10k"
    
  4. Save and Restart Terminal:

    Save the changes and restart your terminal. If you see weird symbols, don't worry; it means you need to install the necessary fonts.

Step 3: Install the Required Fonts

  1. Download Meslo Nerd Fonts:

    If you are using iTerm2 or Termux, p10k configure can install the recommended font for you. Simply answer Yes when asked whether to install Meslo Nerd Font. For other terminals, go to the Powerlevel10k Font Installation Guide and download the following four ttf files:

    • MesloLGS NF Regular.ttf

    • MesloLGS NF Bold.ttf

    • MesloLGS NF Italic.ttf

    • MesloLGS NF Bold Italic.ttf

  2. Install Fonts:

    Double-click each downloaded font file and click "Install" to make them available on your system.

  3. Set Terminal Font to MesloLGS NF:

    Change the terminal font to MesloLGS NF in your terminal settings.

  4. Restart Terminal:

    Restart your terminal to apply the new font settings. You should see the correct symbols now.

Step 4: Customize Powerlevel10k

  1. Run Configuration Wizard:

    The first time you restart your terminal with Powerlevel10k, a configuration wizard will start. Answer the questions to customize your prompt.

  2. Example Configuration:

    Once configured, your terminal should look something like this:

  3. Change Colors:

    You can change the colors based on the profile you select in the terminal settings. For instance, here’s how it looks with the Visual Studio Code profile:

Step 5: Customize VS Code Terminal

  1. Open VS Code Settings:

    • On PC: Press Ctrl+, or go to File > Preferences > Settings.

    • On Mac: Press ⌘ , or go to Code > Preferences > Settings.

  2. Set Terminal Font Family:Search for terminal.integrated.fontFamily in the settings and set it to MesloLGS NF.

  3. Before and After:

    Before:

    After:

Bonus: Customizing Terminal Title

You might notice that the terminal title is not changed to an Apple symbol or any other custom title. This setting is not part of the theme but a simple terminal setting you can use even without Oh My Zsh. Read more here


By following these steps, you've enhanced your terminal's appearance and functionality, making it a more productive and visually appealing environment for your development work. Enjoy your new setup!

Happy Coding! Namaste 🙏

One breath at a time

0
Subscribe to my newsletter

Read articles from Siddu Hussain directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Siddu Hussain
Siddu Hussain