A Smart Terminal

iTerm2 is a terminal emulator for macOS that does amazing things which default terminal can't do.
iTerm new look with syntax-highlighting and auto-suggestion
iTerm new look with syntax-highlighting and auto-suggestion

For developers who spend countless hours in the terminal, having a powerful and customizable environment is essential. iTerm2 transforms the standard terminal experience with features that boost productivity and make command-line work more enjoyable.

Key Features

iTerm2 offers several advantages over the default macOS Terminal:

  • Split-pane views for multiple terminal sessions
  • Robust search functionality
  • Command history and autocomplete
  • Custom color schemes and themes
  • Integrated password manager
  • SSH connection manager
  • Customizable keyboard shortcuts

Installation Guide

Prerequisites

First, install Homebrew - The Package Manager for macOS:

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

Follow the post-installation instructions to add Homebrew to your PATH.

Core Components

  1. Install iTerm2:
brew install --cask iterm2
  1. Install Oh My Zsh for terminal customization:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  1. Install Powerlevel10k Theme:
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k"
  1. Download and install SourceCodePro font from here

  2. Download Snazzy.itermcolors theme

Configuration

Theme Setup

  1. Open iTerm2 Preferences (Cmd + ,)
  2. Navigate to Profiles → Colors
  3. Click “Color Presets” → Import
  4. Select downloaded Snazzy.itermcolors

Font Configuration

  1. Open iTerm2 Preferences
  2. Go to Profiles → Text
  3. Select “SourceCodePro” as Font Family
  4. Set font size to 12-14pt

Powerlevel10k Setup

  1. Edit your .zshrc:
ZSH_THEME="powerlevel10k/powerlevel10k"
  1. Restart iTerm2 and follow the configuration wizard

Essential Plugins

Auto-Suggestions

Install the plugin:

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

Add to your .zshrc:

plugins=(
          git
          zsh-autosuggestions
        ) 

Syntax Highlighting

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git  ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-syntax-highlighting
echo "source ${ZSH:-~/.oh-my-zsh}/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc

ZSH Completions

git clone https://github.com/zsh-users/zsh-completions.git  ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions

fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
autoload -U compinit && compinit
source "$ZSH/oh-my-zsh.sh"

Keyboard Shortcuts

  • Split Pane Horizontally: Cmd + Shift + D
  • Split Pane Vertically: Cmd + D
  • Navigate Panes: Cmd + [Arrow Keys]
  • Search: Cmd + F
  • Clear Buffer: Cmd + K
  • Full Screen: Cmd + Enter

Troubleshooting

Common Issues

  1. Font Icons Not Showing

    • Verify font installation
    • Restart iTerm2
    • Check font settings in preferences
  2. Plugin Not Working

    • Verify plugin installation path
    • Check .zshrc configuration
    • Run source ~/.zshrc
  3. Theme Issues

    • Ensure Powerlevel10k is properly installed
    • Run p10k configure to reconfigure

For additional help, visit: