Skip to content

Latest commit

 

History

History
234 lines (176 loc) · 4.89 KB

File metadata and controls

234 lines (176 loc) · 4.89 KB

Terminal Setup Guide - iTerm2 + Oh My Zsh + Powerlevel10k

This guide documents the best-in-class terminal setup we configured.


What We Installed

  1. Oh My Zsh - Framework for managing zsh configuration
  2. Powerlevel10k - Beautiful, fast theme with icons
  3. zsh-autosuggestions - Fish-style command suggestions (gray text, press → to accept)
  4. zsh-syntax-highlighting - Highlights valid/invalid commands as you type
  5. fzf - Fuzzy finder for searching command history (Ctrl+R)
  6. eza - Modern replacement for ls with icons and colors
  7. bat - Modern replacement for cat with syntax highlighting
  8. tldr - Simplified man pages

Installation Steps (For Future Reference)

1. Install Oh My Zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

2. Install Powerlevel10k Theme

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

3. Install zsh-autosuggestions Plugin

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

4. Install zsh-syntax-highlighting Plugin

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

5. Install fzf (Fuzzy Finder)

brew install fzf
$(brew --prefix)/opt/fzf/install

Say yes to all prompts.

6. Install eza (Better ls)

brew install eza

7. Install bat (Better cat)

brew install bat

8. Install tldr (Simple Man Pages)

brew install tldr

9. Configure .zshrc

Replace your ~/.zshrc with this configuration:

# Path to your oh-my-zsh installation
export ZSH="$HOME/.oh-my-zsh"

# Theme
ZSH_THEME="powerlevel10k/powerlevel10k"

# Plugins
plugins=(
  git
  docker
  aws
  terraform
  colored-man-pages
  zsh-autosuggestions
  zsh-syntax-highlighting
)

source $ZSH/oh-my-zsh.sh

# Custom aliases
alias ll="eza -la --icons"
alias ls="eza --icons"
alias cat="bat"

# fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

10. Reload Your Shell

source ~/.zshrc

11. Configure Powerlevel10k (First Time Only)

p10k configure

Follow the wizard and choose your preferred style.


How to Use Your New Terminal

Autosuggestions (zsh-autosuggestions)

  • Start typing a command you've used before
  • Gray text appears suggesting the rest
  • Press (right arrow) to accept the suggestion
  • Press Ctrl+→ to accept one word at a time

Fuzzy Search (fzf)

  • Press Ctrl+R to search command history
  • Start typing to filter
  • Use ↑/↓ to navigate results
  • Press Enter to execute

Better ls Command (eza)

ls          # List files with icons
ll          # List all files in long format with icons

Better cat Command (bat)

cat file.py  # Shows syntax highlighting

Simpler Man Pages (tldr)

tldr tar     # Quick examples instead of full man page

Syntax Highlighting

  • Valid commands appear in green
  • Invalid commands appear in red
  • As you type!

Customization

Change Your Prompt Style

p10k configure

Add More Oh My Zsh Plugins

Edit ~/.zshrc and add plugins to the plugins=() array.

Popular plugins:

  • gitignore - Generate .gitignore files
  • npm - npm command aliases
  • python - Python virtualenv support
  • vscode - VS Code aliases

Full list: https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins

Add Custom Aliases

Edit ~/.zshrc and add aliases at the bottom:

alias gc="git commit"
alias gp="git push"
alias gs="git status"

Then reload: source ~/.zshrc


Troubleshooting

Icons Not Showing

Make sure you installed the Meslo Nerd Font and restarted iTerm2:

p10k configure
# Choose "Yes" to install font, then fully quit and restart iTerm2

Plugins Not Working

Check they're installed:

ls ~/.oh-my-zsh/custom/plugins/

Should show:

  • zsh-autosuggestions
  • zsh-syntax-highlighting

If missing, reinstall using commands in Step 3 and 4 above.

Autosuggestions Too Light (Can't See Them)

Edit iTerm2 preferences:

  • iTerm2 → Preferences → Profiles → Colors
  • Select "ANSI Colors" → "Bright Black"
  • Make it darker

Uninstalling (If Needed)

Remove Oh My Zsh

uninstall_oh_my_zsh

Remove Homebrew Packages

brew uninstall eza bat tldr fzf

Resources


Your terminal is now configured like a pro! 🚀