cd /news/developer-tools/zsh-completiton-with-substring-match… · home › topics › developer-tools › article
[ARTICLE · art-150926] src=brontosaurusrex.github.io ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

Zsh completiton with substring matching

A Zsh configuration combining the built-in completion system's matcher-list with the fzf-tab plugin enables case-insensitive substring matching on Tab completion, letting users type any middle fragment of a filename rather than its prefix. The setup adds the zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z} l:|=* r:|=*' line to ~/.zshrc, so typing 'hx zero' matches GROUND_ZERO.md and 'hx fuego' matches 2026-10-14-hyprfuego.md. fzf-tab, hosted at github.com/Aloxaf/fzf-tab, layers an interactive fuzzy-search picker over the candidates Zsh supplies, where Enter inserts the filename and a second Enter runs the command.

read1 min views1 publishedOct 15, 2026

AI wrote this:

I wanted to type part of a filename, press Tab, and get the right file—even when that text appears in the middle.

Two things make this comfortable: Zsh’s matching rules and the fzf-tab picker.

Add this to ~/.zshrc, after your existing completion setup:

| zstyle ‘:completion:’ matcher-list ‘m:{a-zA-Z}={A-Za-z} l: | = r: | =*’ | This enables case-insensitive substring completion. For example:

hx zero → hx GROUND_ZERO.md hx fuego → hx 2026-10-14-hyprfuego.md

No need to type the beginning, remember the capitalization, or work around a date prefix. This part uses Zsh’s built-in completion system.

fzf-tab (https://github.com/Aloxaf/fzf-tab) adds an interactive fuzzy search menu to Tab completion. It uses the candidates supplied by Zsh.

If several filenames contain zero, typing: hx zero

opens a picker. Keep typing to filter the results, use the arrow keys to choose, and press Enter to insert the filename.

You can also start without a fragment:

hx

Then type something like shapes inside the picker to find a matching file. Enter inserts it; another Enter runs the command. Esc cancels.

── more in #developer-tools 4 stories · sorted by recency
── more on @zsh 3 stories trending now
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-completiton-with…] indexed:0 read:1min 2026-10-15 · —