feat(completions): unify cd/z completions across CWD, CDPATH, and zoxide #13

Merged
rootiest merged 5 commits from cd-completions into main 2026-05-12 03:58:42 +00:00
Owner

Summary

  • Previously, tab completion and auto-suggestions for cd/z were inconsistent — only one or two of CWD, CDPATH, and zoxide frecency results would work at a time
  • Adds _zoxide_z_complete in functions/zoxide.fish that merges all three sources into a single completion list
  • Adds completions/zoxide.fish for full tab completion of the zoxide CLI subcommands (add, query, remove, import, init)
  • Refactors conf.d/zoxide.fish to wire the new completer to both z and cd
  • Updates README to document the unified completion behavior and cleans up structural issues in the Personalization/Dependencies sections

Manual Verification

  • Open a new Fish shell and type cd + Tab — confirm completions include entries from the current directory, CDPATH directories, and zoxide history all in one list
  • Type z + Tab — confirm the same unified completion list appears
  • Navigate to a few directories, then type cd <partial-name> of a recently visited directory and confirm zoxide matches appear as dimmed auto-suggestions
  • Type zoxide + Tab — confirm subcommands (add, query, remove, import, init) are offered
  • Type zoxide query - + Tab — confirm -i/--interactive, -l/--list, -s/--score flags are offered
  • Confirm cdi / zi still opens the interactive fzf selector as before
  • On a machine without zoxide installed, confirm Fish starts cleanly with no errors
## Summary - Previously, tab completion and auto-suggestions for `cd`/`z` were inconsistent — only one or two of CWD, CDPATH, and zoxide frecency results would work at a time - Adds `_zoxide_z_complete` in `functions/zoxide.fish` that merges all three sources into a single completion list - Adds `completions/zoxide.fish` for full tab completion of the `zoxide` CLI subcommands (`add`, `query`, `remove`, `import`, `init`) - Refactors `conf.d/zoxide.fish` to wire the new completer to both `z` and `cd` - Updates README to document the unified completion behavior and cleans up structural issues in the Personalization/Dependencies sections ## Manual Verification - [x] Open a new Fish shell and type `cd ` + Tab — confirm completions include entries from the current directory, CDPATH directories, and zoxide history all in one list - [x] Type `z ` + Tab — confirm the same unified completion list appears - [x] Navigate to a few directories, then type `cd <partial-name>` of a recently visited directory and confirm zoxide matches appear as dimmed auto-suggestions - [x] Type `zoxide ` + Tab — confirm subcommands (`add`, `query`, `remove`, `import`, `init`) are offered - [x] Type `zoxide query -` + Tab — confirm `-i`/`--interactive`, `-l`/`--list`, `-s`/`--score` flags are offered - [x] Confirm `cdi` / `zi` still opens the interactive fzf selector as before - [x] On a machine without zoxide installed, confirm Fish starts cleanly with no errors
rootiest added 2 commits 2026-05-12 03:29:37 +00:00
Consolidates and expands the .gitignore to ignore various temporary and
testing directories. This allows for local experimentation with new
ideas
and the preservation of disabled functions without the risk of
accidentally committing them to the repository.
Previous to this commit, tab completion and auto-suggestions for cd/z
were inconsistent — only one or two of: CWD, CDPATH, and zoxide frecency
results would work at a time, with different sourced matches shown in
tab completion, shown in auto-suggest, and execution after pressing
<Enter>.

- Add _zoxide_z_complete in functions/zoxide.fish that merges all three
  sources into a single completion list (CWD via __fish_complete_cd,
  CDPATH via __fish_complete_directories, zoxide via query -l capped at
25)
- Wire the new completer to both z and cd via complete directives in
  conf.d/zoxide.fish, replacing the previous incomplete approach
- Add completions/zoxide.fish for full tab completion of the zoxide CLI
  itself (add, query, remove, import, init subcommands)
- Update README to document the unified completion behavior and fix
  structural issues in Personalization/Attribution/Dependencies sections
rootiest added 1 commit 2026-05-12 03:37:30 +00:00
cdi was documented and expected to work as an interactive zoxide
directory picker but was never defined as a function, causing it
to silently fail. Wraps zi so completions are inherited correctly.
rootiest added 1 commit 2026-05-12 03:47:32 +00:00
- Add copyright + SPDX header to functions/zoxide.fish and
  conf.d/zoxide.fish (modified from original, owned by Rootiest)
- Add sourced-from attribution to completions/zoxide.fish
  (unmodified from icezyclon/zoxide.fish, MIT)
rootiest added 1 commit 2026-05-12 03:57:51 +00:00
Silent degradation is cleaner; the shell already handles the
missing binary gracefully without any output.
rootiest merged commit 233d75434c into main 2026-05-12 03:58:42 +00:00
rootiest deleted branch cd-completions 2026-05-12 03:58:42 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rootiest/fish-config#13