Skip to content

Instantly share code, notes, and snippets.

@naoufalelh
Created December 21, 2025 23:16
Show Gist options
  • Select an option

  • Save naoufalelh/e981bcc650ec78c5228d9df8b314f30e to your computer and use it in GitHub Desktop.

Select an option

Save naoufalelh/e981bcc650ec78c5228d9df8b314f30e to your computer and use it in GitHub Desktop.
Ultimate Zsh Setup for Engineers

Ultimate Zsh Setup for Engineers

Configure my zsh terminal with a modern, productivity-focused setup for software engineering.

Requirements

1. Oh-My-Zsh Plugins to Install

Install these plugins to ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/:

  • zsh-autosuggestions - Real-time command suggestions from history (ghost text)
  • zsh-syntax-highlighting - Syntax coloring as you type (green=valid, red=invalid)
  • zsh-completions - Enhanced tab completions for 260+ commands
  • zsh-history-substring-search - Search history with arrow keys by partial match

2. Modern CLI Tools to Install via Homebrew

brew install fzf zoxide eza bat ripgrep fd git-delta
Tool Purpose
fzf Fuzzy finder for files, history, everything
zoxide Smart cd replacement - learns your frequent directories
eza Modern ls with icons, colors, git status
bat cat with syntax highlighting
ripgrep Ultra-fast grep replacement
fd Fast, user-friendly find replacement
git-delta Beautiful git diffs with syntax highlighting

3. Configure ~/.zshrc

Enable plugins in the plugins array:

plugins=(
  git
  zsh-autosuggestions
  zsh-syntax-highlighting
  zsh-completions
  zsh-history-substring-search
)

Add keyboard shortcuts for macOS:

# Option + Left/Right: Jump words
bindkey "\e[1;3D" backward-word
bindkey "\e[1;3C" forward-word
bindkey "^[b" backward-word
bindkey "^[f" forward-word

# Home/End keys
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line

# Option + Backspace: Delete word
bindkey "^[^?" backward-kill-word

# Delete key
bindkey "^[[3~" delete-char

Add tool integrations:

# fzf integration (Ctrl+R for history, Ctrl+T for files)
source <(fzf --zsh)

# zoxide (use 'z' to jump directories)
eval "$(zoxide init zsh)"

Add aliases:

# eza (modern ls)
alias ls="eza --icons --group-directories-first"
alias ll="eza -la --icons --group-directories-first --git"
alias lt="eza --tree --level=2 --icons"
alias la="eza -a --icons --group-directories-first"

# bat (modern cat)
alias cat="bat --paging=never"

# fd (modern find)
alias find="fd"

# Git shortcuts
alias gs="git status"
alias gp="git pull"
alias gpu="git push"
alias gl="git log --oneline --graph --decorate -10"

# Navigation
alias ..="cd .."
alias ...="cd ../.."
alias reload="source ~/.zshrc"

# Preview with fzf + bat
alias preview="fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}'"

History substring search bindings:

bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down

4. Configure Git to use Delta

git config --global core.pager delta
git config --global interactive.diffFilter "delta --color-only"
git config --global delta.navigate true
git config --global delta.side-by-side true
git config --global delta.line-numbers true

5. For iTerm2 Users (Optional)

Recommend enabling "Natural Text Editing" preset:

  • iTerm2 → Settings → Profiles → Keys → Key Mappings → Presets → Natural Text Editing

Expected Result

After setup, the user should have:

  • ✅ Ghost text suggestions while typing commands
  • ✅ Syntax highlighting (green=valid, red=error)
  • ✅ Ctrl+R for fuzzy history search
  • ✅ Ctrl+T for fuzzy file search
  • z <folder> to smart-jump to directories
  • ✅ Beautiful ls with icons and git status
  • ✅ Syntax-highlighted cat output
  • ✅ Side-by-side git diffs with syntax highlighting
  • ✅ Option+Arrow for word jumping
  • ✅ History search with up/down arrows

Verification

After making changes, test with:

zsh -c 'source ~/.zshrc && echo "SUCCESS"'

Then instruct user to open a new terminal to see all changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment