Skip to content

Instantly share code, notes, and snippets.

@kyeongan
Last active April 16, 2025 16:27
Show Gist options
  • Save kyeongan/f9e71cbcfb3599d354b834d5b5d8087a to your computer and use it in GitHub Desktop.
Save kyeongan/f9e71cbcfb3599d354b834d5b5d8087a to your computer and use it in GitHub Desktop.
Zsh config
# Load Homebrew environment variables
export HOMEBREW_NO_INSTALL_CLEANUP=1
eval "$(/opt/homebrew/bin/brew shellenv)"
export GREP_OPTIONS='--color=auto'
# Optimize History Behavior
setopt HIST_IGNORE_ALL_DUPS # Ignore duplicates in history
setopt HIST_SAVE_NO_DUPS # Do not write duplicate commands to history
setopt HIST_REDUCE_BLANKS # Remove unnecessary spaces in commands
setopt SHARE_HISTORY # Share history across multiple terminals
setopt INC_APPEND_HISTORY # Append history incrementally (without waiting for session exit)
setopt EXTENDED_HISTORY # Save timestamp and execution time in history
# Completion & Prompt Optimization
setopt AUTO_LIST # Automatically list choices on ambiguous completion
setopt COMPLETE_IN_WORD # Allow completion in the middle of a word
setopt NO_ALWAYS_LAST_PROMPT # Don't move the cursor to the end of the line
unsetopt MENU_COMPLETE # Disable menu-based completion
# Shell History Configuration
export HISTSIZE=100000 # Number of commands to keep in memory
export HISTFILESIZE=200000 # Maximum number of commands in history file
export HISTFILE=~/.zhistory # History file location
# Zsh Prompt
PROMPT='%F{yellow}%n@%F{green}%m:%F{cyan}%~%F{white}%# '
@kyeongan
Copy link
Author

Minimal .zshrc — macOS + Homebrew Friendly

A clean and practical Zsh configuration, designed for developers who prefer lightweight setups over bulky frameworks like oh-my-zsh.

💡 Features
• ✅ Homebrew-aware:
Loads the correct environment for Homebrew-installed tools.
• 🔥 Optimized Shell History:
Deduplicated, timestamped, and shared across terminal sessions.
• ⚡ Improved Completion:
Middle-word completion, auto-listing choices, and smart cursor behavior.
• 🎨 Readable Prompt for Dark Terminals:
A simple, color-coded prompt with better contrast:

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