iTerm2
Here's a step-by-step guide to help you set up a nice iTerm2 configuration on your Mac. This setup will focus on aesthetics, productivity, and usability. Weβll cover installing iTerm2, customizing its appearance, adding features, and using some popular tools to enhance your terminal experience.
Step 1: Install iTerm2
Download iTerm2:
Visit the iTerm2 website and download the latest stable release.
Install iTerm2:
Open the downloaded file and drag the iTerm2 app to your Applications folder.
Step 2: Basic iTerm2 Configuration
Launch iTerm2:
Open iTerm2 from your Applications folder.
Set iTerm2 as Default Terminal:
Go to
iTerm2
>Make iTerm2 Default Term
in the menu bar.
Check for Updates:
Go to
iTerm2
>Check for Updates
to ensure you have the latest version.
Step 3: Customize Appearance
Install Powerline Fonts:
Open a new terminal window in iTerm2 and run the following command to clone the Powerline fonts repository:
git clone https://github.com/powerline/fonts.git --depth=1
Navigate to the cloned directory and run the installation script:
cd fonts ./install.sh
After installation, you can remove the cloned repository:
cd .. rm -rf fonts
Choose a Color Scheme:
iTerm2 supports custom color schemes. You can download schemes from iTerm2 Color Schemes.
To import a color scheme, go to
iTerm2
>Preferences
>Profiles
>Colors
tab, and clickColor Presets
>Import
. Select the downloaded.itermcolors
file.
Set a Font:
Go to
iTerm2
>Preferences
>Profiles
>Text
.Choose a Powerline-compatible font like "MesloLGS NF" from the dropdown.
Transparency and Blur:
Go to
iTerm2
>Preferences
>Profiles
>Window
.Adjust the transparency slider and enable blur for a nice effect.
Step 4: Enhance Functionality
Install Oh My Zsh:
Install Zsh if you havenβt already by running:
brew install zsh
Then install Oh My Zsh using the following command:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Choose a Zsh Theme:
Oh My Zsh comes with many themes. You can set a theme by editing the
~/.zshrc
file:nano ~/.zshrc
Find the line
ZSH_THEME="robbyrussell"
and change it to your desired theme, e.g.,agnoster
for a Powerline-like theme:ZSH_THEME="agnoster"
Install Zsh Plugins:
zsh-syntax-highlighting: Highlights command syntax.
brew install zsh-syntax-highlighting
Add the following to your
.zshrc
:source $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
zsh-autosuggestions: Suggests commands as you type.
brew install zsh-autosuggestions
Add the following to your
.zshrc
:source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh
Configure Plugins in Zsh:
Edit your
.zshrc
file to include plugins:plugins=(git zsh-syntax-highlighting zsh-autosuggestions)
Reload Zsh Configuration:
After making changes, reload your terminal configuration:
source ~/.zshrc
Step 5: Use Tmux for Multiplexing
Install Tmux:
Install Tmux via Homebrew:
brew install tmux
Configure Tmux:
Create a configuration file:
touch ~/.tmux.conf
Add some basic configurations:
# Increase history size set -g history-limit 10000 # Enable mouse mode set -g mouse on # Set prefix to Ctrl-a unbind C-b set-option -g prefix C-a bind-key C-a send-prefix
Use Tmux:
Start a new Tmux session:
tmux
Detach from the session with
Ctrl-a d
.Reattach with:
tmux attach-session -t <session-name>
Step 6: Additional Tips
Hotkeys:
Go to
iTerm2
>Preferences
>Keys
to configure key mappings for easier navigation.
Window Management:
Use
Cmd-d
to split panes vertically andCmd-Shift-d
to split horizontally.
Profile Switching:
Create multiple profiles for different tasks, accessible from
iTerm2
>Preferences
>Profiles
.
Automation and Scripting:
Explore iTerm2βs scripting capabilities to automate tasks using Python or AppleScript.
Last updated