Table of Contents
1. Installing iTerm2
$ brew install --cask iterm2
Why iTerm2 over default Terminal?
- Split panes functionality
- Better search capabilities
- Hotkey window
- Customizable triggers
- Better color scheme support
- Improved tab features
- Built-in password manager
Key iTerm2 Features to Enable:
- Go to Preferences → Profiles → Keys → Load Preset... → Natural Text Editing
- Enable GPU rendering: Preferences → Advanced → Use GPU renderer
- Enable unlimited scrollback: Preferences → Profiles → Terminal → Scrollback Buffer → Unlimited scrollback
Useful iTerm2 Shortcuts:
Cmd + D
: Split pane verticallyCmd + Shift + D
: Split pane horizontallyCmd + ]
/Cmd + [
: Switch between panesCmd + Shift + H
: Show paste history
2. Package Management Setup
Install Homebrew
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" # Add to PATH (replace [username] with your username) $ echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/[username]/.zprofile $ eval "$(/opt/homebrew/bin/brew shellenv)"
Why Homebrew?
- Central package management
- Easy installation/uninstallation
- Automatic dependency handling
- Simple updating of packages
- Large package repository
3. Shell Framework Setup
Install Git (if not installed)
$ brew install git
Install Oh My Zsh
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Why Oh My Zsh?
- Better plugin management
- Improved theme support
- Built-in aliases
- Better completion system
- Active community
Install PowerLevel10k Theme
$ git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
# Edit ~/.zshrc: ZSH_THEME="powerlevel10k/powerlevel10k"
Why PowerLevel10k?
- Faster than other prompts
- Highly customizable
- Git status integration
- Directory truncation
- Command execution time
- Error status display
Install Required Font
$ brew tap homebrew/cask-fonts $ brew install --cask font-meslo-lg-nerd-font
Configure iTerm2 to use this font: Preferences → Profiles → Text → Font → MesloLGS NF
4. Essential Development Tools
Modern CLI Tools
# Install improved alternatives to traditional Unix tools $ brew install eza # Modern replacement for ls $ brew install bat # Better cat with syntax highlighting $ brew install ripgrep # Faster grep $ brew install fd # Better find $ brew install fzf # Fuzzy finder $ brew install delta # Better git diff $ brew install tldr # Simplified man pages $ brew install jq # JSON processor
Usage Examples:
# eza (better ls) $ eza --icons # List with icons $ eza -l --git # List with git status $ eza --tree # Tree view # bat (better cat) $ bat file.txt # View file with syntax highlighting $ bat -A file.txt # Show all characters # ripgrep (better grep) $ rg "pattern" # Search for pattern $ rg -i "pattern" # Case-insensitive search # fd (better find) $ fd "*.js" # Find all JavaScript files $ fd -H "pattern" # Include hidden files # fzf (fuzzy finder) $ vim $(fzf) # Open file in vim $ history | fzf # Search command history
5. Essential Zsh Plugins
Install Auto-suggestions
$ git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Install Syntax Highlighting
$ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Install History Substring Search
$ git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search
Update ~/.zshrc plugins:
plugins=( git zsh-autosuggestions zsh-syntax-highlighting zsh-history-substring-search web-search copypath dirhistory docker npm pip python sudo )
Plugin Explanations:
zsh-autosuggestions
: Shows command suggestions based on historyzsh-syntax-highlighting
: Real-time syntax highlighting for commandszsh-history-substring-search
: Better history search with arrow keysweb-search
: Search web from terminal (e.g.,google query
)copypath
: Copy current directory pathdirhistory
: Navigate directory historydocker
: Docker commands completionsudo
: Press esc twice to add sudo to previous command
6. Productivity Enhancements
Install Additional Tools
$ brew install atuin # Better shell history $ brew install zoxide # Smarter cd command $ brew install starship # Cross-shell prompt $ brew install direnv # Directory-specific environments
Configure Enhanced History with Atuin
eval "$(atuin init zsh)"
Add Useful Aliases (add to ~/.zshrc)
# Directory navigation alias ..='cd ..' alias ...='cd ../..' alias ll='eza -l --icons --git' alias la='eza -la --icons --git' alias lt='eza --tree --icons' # Git shortcuts alias gs='git status' alias gc='git commit' alias gp='git push' alias gl='git pull' # Development alias py='python3' alias pip='pip3' alias serve='python3 -m http.server'
7. Final Configurations
Configure PowerLevel10k
$ p10k configure
Add to ~/.zshrc
# Better history HISTSIZE=1000000 SAVEHIST=1000000 setopt HIST_IGNORE_ALL_DUPS setopt HIST_FIND_NO_DUPS # Better directory switching setopt AUTO_CD # Better completion setopt COMPLETE_ALIASES
8. Maintenance
Keep your setup updated:
# Update Homebrew packages $ brew update && brew upgrade # Update Oh My Zsh $ omz update # Update all custom plugins $ cd ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions && git pull $ cd ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting && git pull
After making any changes to ~/.zshrc, reload:
$ source ~/.zshrc
This setup provides:
- Modern, fast terminal experience
- Intelligent command suggestions
- Better visualization of commands and output
- Improved productivity tools
- Enhanced development workflow
- Better history management
- Customizable appearance
Remember to:
- Backup your configurations
- Keep everything updated
- Customize based on your workflow
- Read the documentation of tools you use most