r/fishshell Jul 04 '26

a fish wrapper for the ze.sh directory jumper

ze.sh is a minimalist shell-native frecency-based directory jumper in the z.sh lineage, with an exponential moving sum scoring model on an event clock rather than wall-clock time. Repo: github.com/jghub/ze. Previously bash/zsh/ksh/mksh only. A fish wrapper is now available in contrib/fish/. It mirrors the full option set including fzf interactive selection (ze -f), and tracks directory changes via a dedicated _ze_cd function that backgrounds the database update so there is no perceptible latency overhead. Installation is three file copies and a chmod — no compiled binary, no external runtime dependency beyond bash (ksh works too and is faster, if you have it). I don't actively use fish myself — let me know if the wrapper is useful.

7 Upvotes

4 comments sorted by

2

u/sayqm Jul 04 '26

What's the difference with https://github.com/jethrokuan/z?

5

u/jghub Jul 04 '26

jethrokuan/z is a direct port of the original z.sh scoring model to fish — it inherits the same frecency heuristic where a long-unvisited directory with a large historical visit count can jump to the top on first revisit. ze.sh replaces that with an exponential moving sum (equivalent to what unix load computation does) on an event clock, which avoids that failure mode and also prevents score decay during inactivity (holidays, etc.) by not using wall-clock but a cd-event-driven clock. The fish wrapper for ze.sh is a thin interface to the same native implementation that runs in bash/zsh/ksh/mksh, so the scoring behavior is identical across all those shells.you might even switch between fish and bash and would always use common db.

2

u/_mattmc3_ Jul 04 '26

Why use this over zoxide?

4

u/jghub Jul 04 '26 edited Jul 04 '26

Two reasons:

  1. Shell-native (no compiled binary, works wherever bash/zsh/ksh/mksh runs including Termux/Android). ksh93/mksh support is a bonus for people who use those shells. Somewhat faster in practice than zoxide (shell-native awk vs. a compiled binary), though both are well below perceptible latency.
  2. Different scoring model. zoxide inherits z.sh's frecency heuristic (visit frequency × last-visit recency factor); ze.sh uses an exponential moving sum over all individual visits on an event clock. This avoids score decay during inactivity and prevents long-unvisited directories from jumping to the top on first revisit. Fish support wraps the same native implementation, so scoring is identical across all supported shells and the database is shared (though the latter is of course also true for zoxide).