Configure iTerm2 and Zsh

To configure the environments as below:

  • Oh My Zsh
  • Powerline font
  • agnoster theme
  • Zsh extensions
    • zsh-syntax-highlighting
    • zsh-autosuggestions

Install Oh My Zsh

1
2
3
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Or
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

Set Theme

Open ~/.zhsrc, set ZSH_THEME as agnoster.

theme

Set iTerm2 Colors

Open iTerm2 and open its Preferences... or press + ,, follow the path Profiles > Open Profiles > Edit Profiles > Colors and select a color.

Colors

Install & Set Powerline font

Install

1
2
3
git clone https://github.com/powerline/fonts.git --depth=1
cd fonts
./install.sh

Set

From Profiles > Open Profiles > Edit Profiles > Text of iTerm2’s preferences, set font as Powerline.

iTerm2 font

Set Transparency & Background

From Profiles > Open Profiles > Edit Profiles > Window of iTerm2’s preferences, set transparency and background.

iTerm2 transparency & background

Install Zsh Extensions

  1. Install from official website.

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

    $ZSH_CUSTOM is ~/.oh-my-zsh/custom.

  2. Open ~/.zshrc, find plugins and change it.

    1
    2
    3
    4
    5
    6
    # Which plugins would you like to load?
    # Standard plugins can be found in $ZSH/plugins/
    # Custom plugins may be added to $ZSH_CUSTOM/plugins/
    # Example format: plugins=(rails git textmate ruby lighthouse)
    # Add wisely, as too many plugins slow down shell startup.
    plugins=(git zsh-syntax-highlighting zsh-autosuggestions)
  3. Activate

    1
    source ~/.zshrc

References


Configure iTerm2 and Zsh
http://wasprime.github.io/Configuration/iTerm2/Configure-iTerm2-and-Zsh/
Author
wasPrime
Posted on
April 9, 2023
Updated on
May 3, 2023
Licensed under