Skip to content

Instantly share code, notes, and snippets.

@martinbuberl
Last active December 5, 2025 11:21
Show Gist options
  • Select an option

  • Save martinbuberl/a6fa5568d178365dfb6d117a0da8fe07 to your computer and use it in GitHub Desktop.

Select an option

Save martinbuberl/a6fa5568d178365dfb6d117a0da8fe07 to your computer and use it in GitHub Desktop.
Latest Zsh Profile File (~/.zshrc)
printf "\33c\e[3J" # clear terminal (removes "Last login" message)
echo ".zshrc loaded ..."
# enable zsh history
HISTSIZE=20000 # in-memory history
SAVEHIST=20000 # saved to ~/.zsh_history
HISTFILE=~/.zsh_history
# zsh history options
setopt SHARE_HISTORY # share history across shells
setopt INC_APPEND_HISTORY # write commands immediately
setopt HIST_IGNORE_DUPS # ignore immediate duplicates
setopt HIST_IGNORE_ALL_DUPS # remove older duplicates
setopt HIST_REDUCE_BLANKS # trim extra spaces
setopt HIST_VERIFY # show before running when expanded with !
# history key bindings
bindkey '^[[A' history-beginning-search-backward # up arrow
bindkey '^[[B' history-beginning-search-forward # down arrow
# Homebrew
eval "$(/opt/homebrew/bin/brew shellenv)" # add Homebrew to $PATH
# enable zsh completion
if [[ -d "$HOME/.docker/completions" ]]; then
fpath=("$HOME/.docker/completions" $fpath) # enable Docker CLI completions
fi
autoload -Uz compinit
compinit
# zsh completion options
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # case-insensitive completion
zstyle ':completion:*' menu select # show completion menu immediately
zstyle ':completion:*' list-colors '' # list suggestions in colors
setopt completeinword # complete from the middle of a word
setopt globdots # include hidden files in globbing (e.g. .env)
# To enable pnpm completion, run the following commands:
# $ pnpm completion zsh > ~/.pnpm-completion.zsh
if [[ -r ~/.pnpm-completion.zsh ]]; then
source ~/.pnpm-completion.zsh
fi
# enable zsh autosuggestions
# install zsh-autosuggestions via Homebrew "brew install zsh-autosuggestions"
if [[ -r /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]]; then
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
fi
# asdf
# install asdf as a universal version manager via Homebrew "brew install asdf"
# (see https://asdf-vm.com/guide/getting-started.html#_1-install-asdf);
if [[ -r /opt/homebrew/opt/asdf/libexec/asdf.sh ]]; then
. /opt/homebrew/opt/asdf/libexec/asdf.sh # load asdf (installed via Homebrew)
fi
# pnpm
# add pnpm home to $PATH
export PNPM_HOME="$HOME/Library/pnpm"
export PATH="$PNPM_HOME:$PATH"
# pnpm comes bundled with newer Node versions (>=16.9), you can enable it via
# Corepack (see https://nodejs.org/api/corepack.html); run the following lines,
# to enable it and add pnpm to the root configuration file "~/package.json":
# $ corepack enable
# $ corepack use pnpm
if command -v npm >/dev/null 2>&1; then
export PATH="$(npm root -g)/corepack/shims:$PATH" # add pnpm shims to global path
fi
# Cursor
# add "cursor" command (Cursor IDE)
# to launch Cursor from the command line, open the Command Palette (Command+Shift+P)
# and run the "install 'cursor' command";
export PATH="$HOME/.local/bin:$PATH" # add Cursor CLI to $PATH
# Antigravity
export PATH="$HOME/.antigravity/antigravity/bin:$PATH"
# enable zsh syntax highlighting
# install zsh-syntax-highlighting via Homebrew "brew install zsh-syntax-highlighting"
if [[ -r /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]]; then
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
fi
# shortens the promt prompt from "username@computer ~ %" to "~ $"
export PS1="%~ $ "
# removes duplicates in $PATH
typeset -U path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment