---
title: "iTerm2 Hacking Notes"
date: 2021-12-17T23:00:50.000Z
author: Z.SHINCHVEN
tags: [iterm2]
canonical: https://atlassc.net/2021/12/18/iterm2-hacking-notes
---
> `iTerm2` has always been my favorite terminal. I use it for everything from my development work to regular usage. Here's my note to setup my iTerm2 preferences.

## Installation

```bash
brew install iterm2
```

## Install Newest `zsh` Release From `HomeBrew`

[zsh](https://support.apple.com/kb/HT208050) is the default shell for macOS since macOS 10.14. Its version is managed by OS, I would like to use the latest version, so I choose install it from `HomeBrew`.

```bash
brew install zsh ## Install `zsh`
where zsh ## find installation path
chsh -s /opt/homebrew/bin/zsh ## change shell to `zsh` installed from HomeBrew
```

## Install `Starship`

> [Starship](https://starship.rs/) is a minimal, blazing-fast, and infinitely customizable prompt for any shell!

I use it for:
- Git prompt
- Development environment prompt
- Shell Theme

```bash
brew install starship
echo 'eval "$(starship init zsh)"' >> ~/.zshrc
source ~/.zshrc
```

## zsh Plugins

```bash
brew install zsh-autosuggestions
echo "source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh" >> ~/.zshrc
brew install zsh-syntax-highlighting
echo "source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ~/.zshrc
source ~/.zshrc
```

## Color Schemes

[Iterm2-color-schemes](https://iterm2colorschemes.com/)

### Import Color Schemes

- Download color schemes by clone the repository.

```bash
git clone https://github.com/mbadolato/iTerm2-Color-Schemes.git
```

- Press `⌘ + ,` to open iTerm2 preferences.
- Select `Profiles` tab.
- Select `Colors` tab.
- Find `Color Presets...` at the right bottom.
- Scroll to the end of `Color Presets...`'s options to find `Import...`.
- Import all `.itermcolors` files from the `scheme` directory of the cloned repository.

### Minimal Tab

Minimal Tab shows the same color of current profile's color preset.

- Press `⌘ + ,` to open iTerm2 preferences.
- Select `Appearance` tab.
- Find `Theme` in `General` secondary tab.
- Select `Minimal`.

## Transparency

- Press `⌘ + i` to open preferences.
- Select `Window` tab.
- Set `Transparency` and `Blur`.

## Font

I'd prefer `JetBrainsMono Nerd Font`.

Nerd fonts for terminal can be install from HomeBrew:

```bash
brew tap homebrew/cask-fonts
brew install font-jetbrains-mono-nerd-font
```

### Set Font for Profiles

- Press `⌘ + ,` to open iTerm2 preferences.
- Select `Profiles` tab.
- Select `Text` tab.
- Select font at `Font` section.

## Natural Text Editing

I would prefer `⌘ + arrow` to move cursor, so I have to switch the terminal input `Key Mappings` preset to `Natural Text Editing`.

- Press `⌘ + ,` to open iTerm2 preferences.
- Select `Keys` tab.
- Select `Key Mapping` secondary tab.
- Find `Presets...` at left bottom.
- Select `Natural Text Editing`.
