gwm-cli 1.6.0

git worktree manager — TUI + CLI, native libgit2, per-repo bootstrap
Documentation
---
title: Fuzzy filter
description: The `/` filter bar — nucleo-matcher, sticky filters, Esc semantics.
---

# Fuzzy filter

Press `/` to open an inline filter bar at the bottom of the worktree table. As you type, the table narrows in real time using [`nucleo-matcher`](https://docs.rs/nucleo-matcher) — the same fuzzy engine used by Helix and Zellij. Matches are ranked by how tight the hit is (contiguous substring beats spread-out subsequence), so the most likely candidate sits on top.

![The `/` fuzzy filter narrowing the list live](./_assets/filter.gif)

## flow

```
/                            → filter bar opens
auth                         → table now shows feat-99-user-authentication only
<Enter>                       → filter sticks, navigation back on the table
<Esc>                         → clears filter, full list back
```

## sticky filters

The filter is sticky between `Enter` and `Esc`:

- `j` / `k` / `gg` / `G` continue to work on the **filtered subset** — selection stays inside the visible rows.
- The table title shows `worktrees (N/M)` (visible / total) so you always know how much is hidden.
- Hit `/` again to re-open the bar and **refine** the existing query — the bar pre-fills with the current filter.
- `Esc` from the list view clears the sticky filter before it considers quitting, so you cannot accidentally quit when you meant to drop the filter.

## matching rules

`nucleo-matcher` is a smart-case subsequence matcher:

- All lowercase query → case-insensitive (`auth` matches `Authentication`)
- Mixed-case query → case-sensitive (`Auth` only matches `Auth…`)
- Spaces in the query are **AND** separators (`mig db` matches `chore-12-db-migration` because both `mig` and `db` are present, in any order)
- Contiguous substrings score higher than spread-out subsequences (`auth` beats `aXuXtXh`)

The matcher works on the worktree name (path basename), not on the branch name. If your branch convention is `<type>/#<N>-<slug>` and `[worktree].path_pattern = "{type}-{issue}-{desc}"` (the default), they're equivalent.

## picker mode

When you launch `gwm switch` (or hit bare `gcd` with the [shell-init helper](/getting-started/shell-init) installed), the same filter bar opens **immediately** at startup — the picker is the filter view by default. Create / delete / bootstrap keys are disabled in picker mode; `Enter` confirms the highlighted row and prints its path on stdout, `Esc` / `q` / `Ctrl-C` cancels with exit code `1`.

## related

- [Keybindings → list view]/tui/keybindings#list-view-default — every key the filter view listens to
- [Getting Started → Shell init]/getting-started/shell-init — wire up `gcd` for one-keystroke worktree jumping