Skip to content

Instantly share code, notes, and snippets.

@n1snt
Last active October 18, 2026 12:35
Show Gist options
  • Select an option

  • Save n1snt/2cccc8aa5f7b645a7628d3512c70deb6 to your computer and use it in GitHub Desktop.

Select an option

Save n1snt/2cccc8aa5f7b645a7628d3512c70deb6 to your computer and use it in GitHub Desktop.
Oh my ZSH 2026 updated setup guide

Oh my zsh Setup (Fast + Minimal)

Oh My Zsh

Install Zsh

Ubuntu

sudo apt update
sudo apt install zsh curl git

Set Zsh as default shell:

chsh -s $(which zsh)

Restart your terminal.


Install Zinit (Plugin Manager)

Zinit is used as a fast and lightweight plugin manager that loads Zsh plugins asynchronously to significantly reduce shell startup time.

bash -c "$(curl -fsSL https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)"

Install Starship Prompt

Starship is used as a fast, cross-shell prompt that provides a minimal, customizable, and performant terminal prompt.

Ubuntu

curl -sS https://starship.rs/install.sh | sh

macOS

brew install starship

Configure .zshrc

Open .zshrc.

nvim ~/.zshrc

Replace contents with:

# ---------- Zinit ----------
export ZINIT_HOME="$HOME/.local/share/zinit/zinit.git"

if [[ -r "$ZINIT_HOME/zinit.zsh" ]]; then
    source "$ZINIT_HOME/zinit.zsh"
fi

# ---------- Prompt ----------
export STARSHIP_LOG=error
eval "$(starship init zsh)"

# ---------- Completion ----------
autoload -Uz compinit

# Use a cached completion dump
mkdir -p "${XDG_CACHE_HOME:-$HOME/.cache}"
compinit -d "${XDG_CACHE_HOME:-$HOME/.cache}/zcompdump"

# Better completion UX
zstyle ':completion:*' menu select
zstyle ':completion:*' rehash true
zstyle ':completion:*' verbose yes

# Case-insensitive + partial matching
zstyle ':completion:*' matcher-list \
    'm:{a-z}={A-Za-z}' \
    'r:|=*' \
    'l:|=* r:|=*'

# Group matches
zstyle ':completion:*' group-name ''

# Group descriptions
zstyle ':completion:*:descriptions' format '%F{yellow}%d%f'

# Colored completion menus
zstyle ':completion:*' list-colors ''

# Better process completion
zstyle ':completion:*:*:*:*:processes' command \
    'ps -u $USER -o pid,user,comm -w -w'

# ---------- Plugins ----------

# Fish-style suggestions
zinit light zsh-users/zsh-autosuggestions

# Syntax highlighting (must be last)
zinit light zsh-users/zsh-syntax-highlighting

# ---------- History ----------
HISTFILE="$HOME/.zsh_history"
HISTSIZE=5000
SAVEHIST=5000

setopt APPEND_HISTORY
setopt SHARE_HISTORY
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_REDUCE_BLANKS
setopt HIST_IGNORE_SPACE
setopt EXTENDED_HISTORY

# ---------- Shell ----------
setopt AUTO_CD
setopt INTERACTIVE_COMMENTS
setopt AUTO_PUSHD
setopt PUSHD_IGNORE_DUPS
setopt PUSHD_SILENT

# ---------- Lazy NVM ----------
export NVM_DIR="$HOME/.nvm"

load-nvm() {
    unset -f node npm npx nvm
    [[ -s "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh"
}

for cmd in node npm npx nvm; do
    eval "$cmd() {
        load-nvm
        command $cmd \"\$@\"
    }"
done


# Local bin
export PATH="$HOME/.local/bin:$PATH"

Reload shell:

source ~/.zshrc

Bonus if using Ghostty

macos-icon = retro
window-padding-x = 1
window-padding-y = 1
copy-on-select = clipboard
window-theme = dark
clipboard-read = allow

theme = Brogrammer
background = #131313
foreground = #d6dbe5
selection-background = #1f1f1f
selection-foreground = #d6dbe5
cursor-color = #b9b9b9
cursor-text = #101010
palette = 0=#1f1f1f
palette = 1=#f81118
palette = 2=#2dc55e
palette = 3=#ecba0f
palette = 4=#2a84d2
palette = 5=#4e5ab7
palette = 6=#1081d6
palette = 7=#d6dbe5
palette = 8=#d6dbe5
palette = 9=#de352e
palette = 10=#1dd361
palette = 11=#f3bd09
palette = 12=#1081d6
palette = 13=#5350b9
palette = 14=#0f7ddb
palette = 15=#ffffff

References

@codewurstler

Copy link
Copy Markdown

Thank you!

@thubamamba

Copy link
Copy Markdown

Dope, thank you for this.

@amirnajaffi

Copy link
Copy Markdown

Remove these lines because zsh-autocomplete runs compinit automatically:

autoload -Uz compinit
compinit -C

Also, zsh-autosuggestions works for me with this:

zinit ice wait lucid atload"_zsh_autosuggest_start"

@Inirit

Inirit commented Oct 18, 2026

Copy link
Copy Markdown

This isn't OMZ.

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