cd /news/ai-tools/zsh-setup ยท home โ€บ topics โ€บ ai-tools โ€บ article
[ARTICLE ยท art-20379] src=gist.github.com pub= topic=ai-tools verified=true sentiment=ยท neutral

zsh setup

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.

read4 min publishedJun 2, 2026

| # โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• | | | # SETUP โ€” install everything this file depends on | | | # โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• | | | # Core tools (one line). Run once on a fresh machine: | | | # | | | # brew install starship fzf zoxide eza bat | | | # | | | # starship โ€” the prompt | | | # fzf โ€” fuzzy finder (Ctrl+R history, Ctrl+T files) | | | # zoxide โ€” smart cd (z <partial> jumps to frequent dirs) | | | # eza โ€” modern ls (NOT exa, which is unmaintained) | | | # bat โ€” cat with syntax highlighting | | | # โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• | | | # โ”€โ”€ History โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ | | | # 100k entries, shared live across tabs, no duplicates kept. | | | # SHARE_HISTORY already implies incremental append, so INC_APPEND is dropped. | | | HISTSIZE=100000 | | | SAVEHIST=100000 | | | HISTFILE=~/.zsh_history | | | setopt SHARE_HISTORY # all open shells read/write the same history live | | | setopt HIST_IGNORE_ALL_DUPS # drop older duplicate when a new dup is added | | | setopt HIST_REDUCE_BLANKS # collapse superfluous whitespace before saving | | | setopt HIST_FIND_NO_DUPS # skip dups when cycling through history search | | | # โ”€โ”€ Completions โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ | | | # Rebuild the completion dump at most once every 24h instead of every launch. | | | # -C skips the security check and just loads the cached dump (the fast path). | | | autoload -Uz compinit | |

| if [[ -n ~/.zcompdump(#qN.mh+24) ]]; then | |
| compinit # cache is stale (older than 24h) -> full rebuild | |

| else | | | compinit -C # cache is fresh -> load without rescanning | | | fi | | | zstyle ':completion:' matcher-list 'm:{a-z}={A-Z}' # case-insensitive matching | | | zstyle ':completion:' menu select # arrow-key menu selection | | | # โ”€โ”€ Cursor movement โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ | | | # Option+Arrow jumps by word, Option+Backspace deletes a word. | | | # Two keycode variants because terminals disagree on what they emit. | |

| bindkey '^[[1;3D' backward-word # Option+Left | |
| bindkey '^[[1;3C' forward-word # Option+Right | |
| bindkey '^[^?' backward-kill-word # Option+Backspace | |
| bindkey '^[[1;9D' backward-word # Alt+Left (some terminals) | |
| bindkey '^[[1;9C' forward-word # Alt+Right (some terminals) | |

| # โ”€โ”€ Prompt and shell tooling โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ | | | # 2>/dev/null hides errors if a binary is missing, at the cost of silent | | | # breakage. If your prompt ever looks wrong, drop the redirect to see why. | |

| eval "$(starship init zsh)" 2>/dev/null # prompt | |
| eval "$(fzf --zsh)" 2>/dev/null # Ctrl+R fuzzy history, Ctrl+T files | |
| eval "$(zoxide init zsh)" 2>/dev/null # smart cd: `z <partial>` | |

| # โ”€โ”€ Aliases: navigation โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ | | | alias ..='cd ..' | | | alias ...='cd ../..' | | | alias ....='cd ../../..' | | | # โ”€โ”€ Aliases: file listing (eza, colorful, dirs first) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ | |

| alias ls='eza --color --group-directories-first' | |
| alias la='eza --color -la --group-directories-first' | |
| alias ll='eza --color -l --group-directories-first' | |
| alias lt='eza --color --tree --level=2' | |

| # โ”€โ”€ Aliases: git โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ | | | alias gs='git status' | | | alias gd='git diff' | | | alias gds='git diff --staged' | | | alias ga='git add' | | | alias gaa='git add --all' | | | alias gc='git commit' | | | alias gcm='git commit -m' | | | alias gp='git push' | | | alias gpl='git pull' | | | alias gl='git log --oneline --graph --all' | | | alias gco='git checkout' | | | alias gsw='git switch' | | | alias gb='git branch' | | | alias gst='git stash' | | | alias gstp='git stash pop' | |

| # โ”€โ”€ Aliases: bat (syntax-highlighted cat) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ | |
| alias c='bat --style=plain' | |

| alias b='bat' | | | # โ”€โ”€ Editor โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ | | | export EDITOR="nano" | | | export VISUAL="nano" | | | # โ”€โ”€ Locale โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ | | | export LANG=en_US.UTF-8 | | | # โ”€โ”€ Quality of life โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ | | | setopt AUTO_CD # type a directory name to cd into it | | | alias path='echo $PATH | tr ":" "\n"' # print PATH one entry per line | | | alias reload='source ~/.zshrc' # re-source after edits | | | alias hosts='sudo nano /etc/hosts' # edit the hosts file |

โ”€โ”€ more in #ai-tools 4 stories ยท sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain โ€” perfect for shipping the agent you just read about.

$git push zahid main
โ†’ Live at https://your-agent.zahid.host โœ“
Get free account โ†’ Pricing
from โ‚ฌ0/mo ยท no card required
LIVE [news/zsh-setup] indexed:0 read:4min 2026-06-02 ยท โ€”