{"slug": "zsh-setup", "title": "zsh setup", "summary": "A developer has published a comprehensive Zsh shell configuration that integrates Starship, Fzf, Zoxide, Eza, and Bat into a single setup file. The configuration includes a shared 100,000-entry history across all open shells, case-insensitive tab completions with arrow-key menu selection, and Option/Alt key bindings for word-level cursor movement. The setup also provides aliases for navigation, file listing with Eza, Git commands, and syntax-highlighted file viewing with Bat.", "body_md": "| # ══════════════════════════════════════════════════════════════════════ | |\n| # SETUP — install everything this file depends on | |\n| # ══════════════════════════════════════════════════════════════════════ | |\n| # Core tools (one line). Run once on a fresh machine: | |\n| # | |\n| # brew install starship fzf zoxide eza bat | |\n| # | |\n| # starship — the prompt | |\n| # fzf — fuzzy finder (Ctrl+R history, Ctrl+T files) | |\n| # zoxide — smart cd (`z <partial>` jumps to frequent dirs) | |\n| # eza — modern ls (NOT exa, which is unmaintained) | |\n| # bat — cat with syntax highlighting | |\n| # ══════════════════════════════════════════════════════════════════════ | |\n| # ── History ─────────────────────────────────────────────────────────── | |\n| # 100k entries, shared live across tabs, no duplicates kept. | |\n| # SHARE_HISTORY already implies incremental append, so INC_APPEND is dropped. | |\n| HISTSIZE=100000 | |\n| SAVEHIST=100000 | |\n| HISTFILE=~/.zsh_history | |\n| setopt SHARE_HISTORY # all open shells read/write the same history live | |\n| setopt HIST_IGNORE_ALL_DUPS # drop older duplicate when a new dup is added | |\n| setopt HIST_REDUCE_BLANKS # collapse superfluous whitespace before saving | |\n| setopt HIST_FIND_NO_DUPS # skip dups when cycling through history search | |\n| # ── Completions ─────────────────────────────────────────────────────── | |\n| # Rebuild the completion dump at most once every 24h instead of every launch. | |\n| # -C skips the security check and just loads the cached dump (the fast path). | |\n| autoload -Uz compinit | |\n| if [[ -n ~/.zcompdump(#qN.mh+24) ]]; then | |\n| compinit # cache is stale (older than 24h) -> full rebuild | |\n| else | |\n| compinit -C # cache is fresh -> load without rescanning | |\n| fi | |\n| zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' # case-insensitive matching | |\n| zstyle ':completion:*' menu select # arrow-key menu selection | |\n| # ── Cursor movement ─────────────────────────────────────────────────── | |\n| # Option+Arrow jumps by word, Option+Backspace deletes a word. | |\n| # Two keycode variants because terminals disagree on what they emit. | |\n| bindkey '^[[1;3D' backward-word # Option+Left | |\n| bindkey '^[[1;3C' forward-word # Option+Right | |\n| bindkey '^[^?' backward-kill-word # Option+Backspace | |\n| bindkey '^[[1;9D' backward-word # Alt+Left (some terminals) | |\n| bindkey '^[[1;9C' forward-word # Alt+Right (some terminals) | |\n| # ── Prompt and shell tooling ────────────────────────────────────────── | |\n| # 2>/dev/null hides errors if a binary is missing, at the cost of silent | |\n| # breakage. If your prompt ever looks wrong, drop the redirect to see why. | |\n| eval \"$(starship init zsh)\" 2>/dev/null # prompt | |\n| eval \"$(fzf --zsh)\" 2>/dev/null # Ctrl+R fuzzy history, Ctrl+T files | |\n| eval \"$(zoxide init zsh)\" 2>/dev/null # smart cd: `z <partial>` | |\n| # ── Aliases: navigation ────────────────────────────────────────────── | |\n| alias ..='cd ..' | |\n| alias ...='cd ../..' | |\n| alias ....='cd ../../..' | |\n| # ── Aliases: file listing (eza, colorful, dirs first) ──────────────── | |\n| alias ls='eza --color --group-directories-first' | |\n| alias la='eza --color -la --group-directories-first' | |\n| alias ll='eza --color -l --group-directories-first' | |\n| alias lt='eza --color --tree --level=2' | |\n| # ── Aliases: git ───────────────────────────────────────────────────── | |\n| alias gs='git status' | |\n| alias gd='git diff' | |\n| alias gds='git diff --staged' | |\n| alias ga='git add' | |\n| alias gaa='git add --all' | |\n| alias gc='git commit' | |\n| alias gcm='git commit -m' | |\n| alias gp='git push' | |\n| alias gpl='git pull' | |\n| alias gl='git log --oneline --graph --all' | |\n| alias gco='git checkout' | |\n| alias gsw='git switch' | |\n| alias gb='git branch' | |\n| alias gst='git stash' | |\n| alias gstp='git stash pop' | |\n| # ── Aliases: bat (syntax-highlighted cat) ──────────────────────────── | |\n| alias c='bat --style=plain' | |\n| alias b='bat' | |\n| # ── Editor ─────────────────────────────────────────────────────────── | |\n| export EDITOR=\"nano\" | |\n| export VISUAL=\"nano\" | |\n| # ── Locale ─────────────────────────────────────────────────────────── | |\n| export LANG=en_US.UTF-8 | |\n| # ── Quality of life ────────────────────────────────────────────────── | |\n| setopt AUTO_CD # type a directory name to cd into it | |\n| alias path='echo $PATH | tr \":\" \"\\n\"' # print PATH one entry per line | |\n| alias reload='source ~/.zshrc' # re-source after edits | |\n| alias hosts='sudo nano /etc/hosts' # edit the hosts file |", "url": "https://wpnews.pro/news/zsh-setup", "canonical_source": "https://gist.github.com/mluggy/c7224b485ea6300e7c187456b48bf31f", "published_at": "2026-06-02 06:46:46+00:00", "updated_at": "2026-06-03 12:44:04.302863+00:00", "lang": "en", "topics": ["ai-tools"], "entities": ["starship", "fzf", "zoxide", "eza", "bat"], "alternates": {"html": "https://wpnews.pro/news/zsh-setup", "markdown": "https://wpnews.pro/news/zsh-setup.md", "text": "https://wpnews.pro/news/zsh-setup.txt", "jsonld": "https://wpnews.pro/news/zsh-setup.jsonld"}}