HomeContact
Programmer's Toolkit
My Terminal Setup: iTerm2 + ZSH + Powerlevel10k
Ishaq Sahibole
Ishaq Sahibole
January 20, 2024
2 min

Table Of Contents

01
My Terminal Emulator
02
My Shell (ZSH)
03
Installing Zsh
04
Configuring with Oh-My-Zsh
05
Zsh Plugins
06
Powerlevel10k
07
Visual Studio Code Terminal Config
My Terminal Setup: iTerm2 + ZSH + Powerlevel10k

My Terminal Emulator

I use iTerm2 as my default Terminal on the Mac.It significantly enhances my development workflow, especially with its convenient shortcuts for managing multiple panes during server operations.

To download iTerm2 on your Mac click here.

My Shell (ZSH)

For my shell, I opt for ZSH, short for Z Shell. ZSH is an extended version of the familiar Bourne shell (sh), offering additional functionalities through support for plugins and themes.

Installing Zsh

If you’re on a Mac, the easiest way to install ZSH is through Homebrew. A single command will do the trick:

brew install zsh

Make ZSH your default shell with:

chsh -s /usr/local/bin/zsh

For older Mac OS High Sierra and earlier versions, use:

chsh -s /bin/zsh

Configuring with Oh-My-Zsh

To streamline the configuration of plugins and styling for ZSH, I turn to Oh-My-Zsh. It’s a framework designed to manage ZSH configurations efficiently.

Install Oh-My-Zsh using CURL:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

.zshrc Configuration

I use the .zshrc file to configure plugins and themes, as opposed to the .bash_profile file used for the Bash shell.

Zsh Plugins

Git:

For Git functionality, search for plugins section and update as below in .zshrc file: plugins=(git)

To apply zsh configuration changes, please run the below command

source ~/.zshrc

Docker:

Enable Docker auto-completion with: plugins=(git docker)

To apply zsh configuration changes, please run the below command

source ~/.zshrc

Zsh Autosuggestions:

Implement fast and unobtrusive auto-suggestions with the ‘zsh-autosuggestions’ plugin:

git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions

Enable Zsh Autosuggestions with: plugins=(git docker zsh-autosuggestions)

To apply zsh configuration changes, please run the below command

source ~/.zshrc

Zsh Syntax Highlighting:

Bring syntax coloring similar to Fish with the ‘zsh-syntax-highlighting’ plugin:

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

Enable Zsh Autosuggestions with: plugins=(git docker zsh-autosuggestions zsh-syntax-highlighting)

To apply zsh configuration changes, please run the below command

source ~/.zshrc

Congratulations! With these essential plugins configured, it’s time to add style to your ZSH shell.

Powerlevel10k

Upgrade your ZSH appearance with Powerlevel10k, an improved version of Powerlevel9k.

Font Installation:

Start by installing the required fonts:

  • Source Code Pro
  • Source Code Pro + Font Awesome (Required for Font Awesome icons)
  • Other Powerline Fonts

Open the downloaded fonts and press “Install Font.” Set the chosen font in iTerm2 (iTerm → Settings → Profiles → Text → Font).

Restart iTerm2 for all changes to take effect.

Enjoy an enhanced terminal experience with iTerm2, ZSH, and the power-packed set of plugins and themes!

By default, word jumps (option + → or ←) and word deletions (option + backspace) do not work. To enable these, go to (iTerm → Settings → Profiles → Keys → Presets… → Natural Text Editing)

Visual Studio Code Terminal Config

Configuring a customized font can disrupt the integrated terminal in Visual Studio Code unless you adjust the appropriate settings. To resolve this, navigate to the VS Code preferences and modify the following key-value pairs:

For Source Code Pro with Font Awesome:

"terminal.integrated.fontFamily": "'SourceCodePro+Powerline+Awesome Regular'"

Make sure to include the single quotes. Restart VS Code after making the configuration change.

For Source Code Pro:

"terminal.integrated.fontFamily": "Source Code Pro for Powerline"

For Meslo:

"terminal.integrated.fontFamily": "Meslo LG M for Powerline"

Once you have the required fonts installed, proceed to install Powerlevel10k using git and Oh-My-Zsh:

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

Next, set the ZSH_THEME in your ~/.zshrc file to “powerlevel10k/powerlevel10k” and reload your terminal for the changes to take effect:

echo 'ZSH_THEME="powerlevel10k/powerlevel10k"' >> ~/.zshrc
source ~/.zshrc

Tags

iTerm2Powerlevel10kZSH

Share

Ishaq Sahibole

Ishaq Sahibole

Full Stack Developer

Passionate Web Developer with a love for programming, dedicated to crafting seamless and visually appealing digital experiences.

Expertise

React
Golang
MongoDB
SQLServer
Microservices

Social Media

githublinkedin

Related Posts

Mac OSX: Install NVM, Node and Yarn
Mac OSX: Install NVM, Node and Yarn
January 23, 2024
1 min

Quick Links

HomeContact Us

Social Media