iTerm2
Last updated
Last updated
iTerm2 is an open source replacement for Apple's Terminal. It's highly customizable and comes with a lot of useful features.
The Ultimate Guide to Your Terminal Makeover
Fonts should be installed as described in Essentials section.
From iTerm2 Menu, select:
Make iTerm2 Default Term
Install Shell Integration - Select Download and Run Installer
Or, run curl -L https://iterm2.com/shell_integration/install_shell_integration_and_utilities.sh | zsh
Follow the screenshots and apply settings as shown:
Go into Preferences and uncheck the indicators: Profiles > Terminal > Show mark indicators
. It will conflict with our starship prompt.
Click Configure Status Bar
button, and then Advanced
button
enable iterm2 Session Restoration
Add kubecontext Status Bar component
iTerm2 > Preferences > Profiles > Session > Configure Status Bar
Drag a new Interpolated String component to Active Components.
Select the new component and click Configure Component.
Set String Value to \(user.kubecontext)
Under Preferences → Profile → ("Default") → Keys → Key Mappings:
Click the Presets
dropdown and select Natural Text Editing
. When prompted: Load Preset
click Remove
button.
Under Preference → Profile → Default → Colors → Color Presets:
Install Color Preset: Download Clovis-iTerm2-Color-Scheme or one-dark file to ~/Downloads
folder, import the .itermcolors
file, then select the Clovis-iTerm2-Color-Scheme
preset you just installed.
you have to rename
~/Downloads/Clovis-iTerm2-Color-Scheme.txt
file to~/Downloads/Clovis-iTerm2-Color-Scheme.itermcolors
before importing.
Some iTerm2 users have reported not being able to see the suggestions If this affects you, the problem is likely caused by incorrect color settings for Dark Theme. In order to correct this, go into iTerm2's setting, navigate to Preference → Profile → Default → Colors, and make sure that the colors for
Basic Colors → Background
andANSI Colors → Black: Bright
are different.
From Preference → Profile → Default → Colors, Adjust Black Bright
under ANSI colors
:
Under Preference → Profile → Default → Text:
Select Font: Meslo LGM Nerd Font Mono
, FiraCode Nerd Font Mono
Or Hack Nerd Font Mono
and Check Use ligatures
Under Preferences → Profiles → General → Working Directory → Advanced Configuration, set:
We will be using starship for prompt.
You can further configure Prompt by editing ~/.config/starship.toml
. We provide Preset starship.toml with some cool icons and kubecontext enabled.
Usage:
We will be replacing ls with eza Features: Colours, Grid view, Long view, Tree view, Git integration, Filtering and Icons Note: The icon characters must be present in the font you are using in your terminal
Usage:
We also added following alias to our alias file, which is sourced from ~/.zshrc
We will be installing zsh-completions , zsh-autosuggestions and zsh-syntax-highlighting
Search previous used commands using Arrows
Add following to ~/.zshrc
Search Previous Used Commands using arrows. up and down arrows - history search
in iTerm2
split screen horizontally
go to the bottom screen and split it vertically
I was using top screen for the work with yaml files and kubectl.
Left bottom screen was running:
watch kubectl get pods
Right bottom screen was running:
watch "kubectl get events --sort-by='{.lastTimestamp}' | tail -6"
With such setup it was easy to observe in real time how my pods are being created.
Order of shell expectation ~/.zprofile
then ~/.zshrc
Arrows | Result |
---|---|
↑ ↓
History Search
^ i
Completion Search
⌥ + ← →
Jump Word
⌘ + ← →
Jump line beginning / end