How to make `programs.zoxide.enable = true;` work?

Hello! According to the home-manager docs, I just need to set programs.zoxide.enable to true
since programs.zoxide.enableZshIntegration has the default value true (and I’m using zsh). However, how is it supposed to work? I expected that cd will be “replaced” by zoxide, so I’m able to just do cd <dir> after I did cd <path-to-dir> but that’s not the case.

How is programs.zoxide.enableZshIntegration supposed to work?

programs.zoxide.enableZshIntegration causes eval "$(${cfg.package}/bin/zoxide init zsh ${cfgOptions})" being appended to the zsh-init via the programs.zsh.initExtra option, which requires programs.zsh.enable being true to do anything.

The generated script would then cause 2 aliases getting defined:

  • z
  • zi

At least this is what I read from the first cursory skimming over the HM implementation, Zoxide docs, and commands outputs.

I do not see that taking over cd is mentioned anywhere in the zoxide docs, nor any examples.

1 Like

Oh damn, yes. You’re right. I just saw, that I have an old command there which replaces cd… sorry. My bad!