Page cover

🍎Enhancing Your MacOS Terminal Experience

Enhancing Your MacOS Terminal Experience with iTerm2

Elevate your terminal experience on MacOS by following this quick tutorial on installing iTerm2 and applying a custom color scheme. This will not only improve the aesthetics of your terminal but also potentially make it easier to read and work with.

Step 1: Install Homebrew

Homebrew is a package manager for MacOS that simplifies the process of installing software on MacOS. Run the following command in your terminal to install Homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Step 2: Install iTerm2

With Homebrew installed, you can easily install iTerm2 by running:

brew install --cask iterm2

Step 3: Download and Apply iTerm2 Color Scheme

  1. Choose your desired iTerm2 color scheme from iTerm2 Color Schemes.

  2. Download the theme file and save it using the following extension: .itermcolors.

  3. Open iTerm2.

  4. Go to iTerm > Preferences > Profiles > Colors tab.

  5. Click on Color Presets... at the bottom right > Import...

  6. Select your downloaded .itermcolors file.

  7. Once imported, select it from the list of Color Presets.

Step 4: Install Oh My Zsh

using the following command:

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

Step 5: Install Syntax Highlighting and Auto-Suggestions Plugins

  1. Syntax Highlighting:

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

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

After cloning, add zsh-syntax-highlighting and zsh-autosuggestions to the plugins section in ~/.zshrc.

plugins=(git zsh-syntax-highlighting zsh-autosuggestions)

Step 6: Install and Configure the Powerlevel10k Theme

  1. Clone the Powerlevel10k repository:

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
  1. Update the ZSH_THEME line in your ~/.zshrc file to use Powerlevel10k:

ZSH_THEME="powerlevel10k/powerlevel10k"
  1. Apply the changes by sourcing ~/.zshrc:

source ~/.zshrc

Step 7: Install a Nerd Font

To fully enjoy Powerlevel10k, you'll need a Nerd Font. Choose and download your preferred Nerd Font from Nerd Fonts. Install the font on your system then set it from iTerm2 preferences.

Step 8: Beautifying the ls Command with colorls Ruby gem

Install colorls:

sudo gem install colorls

To avoid typing colorls every time, we'll create an alias in the .zshrc file. This will allow us to use ls as a substitute command. Open ~/.zshrc and add:

alias ls='colorls'

Apply Changes: For the alias to take effect, source your .zshrc file by running:

source ~/.zshrc

Et voilΓ !

Reference:

Last updated