{"slug": "zsh-completiton-with-substring-matching", "title": "Zsh completiton with substring matching", "summary": "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.", "body_md": "AI wrote this:\n\nI wanted to type part of a filename, press Tab, and get the right file—even when that text appears in the middle.\n\nTwo things make this comfortable: Zsh’s matching rules and the fzf-tab picker.\n\nAdd this to ~/.zshrc, after your existing completion setup:\n\n| zstyle ‘:completion:*’ matcher-list ‘m:{a-zA-Z}={A-Za-z} l: | =* r: | =*’ | \n\nThis enables case-insensitive substring completion. For example:\n\nhx zero → hx GROUND_ZERO.md hx fuego → hx 2026-10-14-hyprfuego.md\n\nNo need to type the beginning, remember the capitalization, or work around a date prefix. This part uses Zsh’s built-in completion system.\n\nfzf-tab (https://github.com/Aloxaf/fzf-tab) adds an interactive fuzzy search menu to Tab completion. It uses the candidates supplied by Zsh.\n\nIf several filenames contain zero, typing:\n\nhx zero\n\nopens a picker. Keep typing to filter the results, use the arrow keys to choose, and press Enter to insert the filename.\n\nYou can also start without a fragment:\n\nhx\n\nThen type something like shapes inside the picker to find a matching file. Enter inserts it; another Enter runs the command. Esc cancels.", "url": "https://wpnews.pro/news/zsh-completiton-with-substring-matching", "canonical_source": "http://brontosaurusrex.github.io/2026/10/15/zsh-completiton-with-substring-matching/", "published_at": "2026-10-15 20:29:00+00:00", "updated_at": "2026-10-15 20:55:39.074689+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Zsh", "fzf-tab", "Aloxaf"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/zsh-completiton-with-substring-matching", "markdown": "https://wpnews.pro/news/zsh-completiton-with-substring-matching.md", "text": "https://wpnews.pro/news/zsh-completiton-with-substring-matching.txt", "jsonld": "https://wpnews.pro/news/zsh-completiton-with-substring-matching.jsonld"}}