Closed xfzv closed 3 years ago
Hey @xfzv, unfortunately this isn't possible at the current time. It would be possible if the zoxide repo contains a bin itself.
zgenom bin ajeetdsouza/zoxide path/to/zoxide # this would install zoxide in this shell.
zgenom load ajeetdsouza/zoxide # this should then configure the shell so that zoxide works.
zinit installs zoxide by loading it from GitHub relases. (That's what the from"gh-r"
says)
I'm not sure if I want to support GitHub releases since I don't consider a rust binary a zsh plugin.
There's also no need to install zoxide as a zsh plugin since it just executes eval "$(zoxide init zsh)"
.
If I use zoxide I would add zoxide init zsh > $ZGEN_DIR/zoxide.zsh
in my zshrc after zgenom save
.
and then source $ZGEN_DIR/zoxide.zsh
after the if zgenom saved ... fi
block.
Executing binaries at startup is quite slow. This way you'd only execute the binary when you've used zgenom reset
before and else use a cached zoxide init file.
You should call zgenom reset every time you update zoxide though since a new version could create a new init file. (Or you call zoxide init zsh > $ZGEN_DIR/zoxide.zsh
manually)
I'm not sure if I want to support GitHub releases since I don't consider a rust binary a zsh plugin.
I agree.
Until now I was relying on zinit to handle zoxide because it was more convenient for me (I'm using both Arch Linux and Gentoo):
% zinit update --all
, I wouldn't depend on AUR/Gentoo overlay maintainers reactivityI noticed that it was recently moved from the AUR to Arch Linux community repository. I might install it from dm9pZCAq overlay on Gentoo, for now ebuilds have been updated one or two days after the initial release which is totally fine.
Anyway, thank you for the detailed answer!
Feel free to close this.
Alright, feel free to open another issue in case you have more questions or suggestions 👍
Hey @xfzv in case you're still interested in installing zoxide with zgenom:
I always had the idea of extensions for zgenom floating in the back of my mind.
Since zgenom just calls functions named zgenom-*
under the hood basically an extension is just writing a function matching this pattern.
Now I also added a way to add completion for those functions.
The first extension is zgenom-ext-release. You can use it to download assets from GitHub Releases and add them to your PATH.
PS: for now you need to use zgenom #71.
I'm using ajeetdsouza/zoxide.
With zinit, the binary can be loaded and updated without having zoxide installed system-wide using (source):
works but only if zoxide is installed system-wide.
Can we achieve something similar with zgenom?
Keep up the good work!