ajeetdsouza / zoxide

A smarter cd command. Supports all major shells.
MIT License
22.92k stars 556 forks source link

[Feature Request] Zoxide Library #283

Closed jtrv closed 2 years ago

jtrv commented 3 years ago

It would be awesome to integrate zoxide in other rust tools especially file managers like joshuto. Would it be possible to make a zoxide library similar to the way skim is both a cli and a library?

Linking this issue for reference

ajeetdsouza commented 2 years ago

Hey, apologies for the delayed response. joshuto looks great!

zoxide does a file read upon query and a file write upon add. Are you planning on calling the library function in your main thread? If not, it may not matter whether you use the library or spawn a child process. Plus, you can batch calls to zoxide add (it takes multiple paths), making it still faster.

I'm not very convinced about turning zoxide into a library for the sake of one application. I resonate with the creator of fzf here (https://github.com/junegunn/fzf/issues/2097):

Most importantly, it's hard to justify the effort of building a library unless enough people are using it. I'm seeing a lot of upvotes on this issue, so if anybody plans to use zoxide as a library in another project, please do post here!

ajeetdsouza commented 2 years ago

@JacobTravers I'm closing this issue since there's no plan for this at the moment, but I've replied on the issue you linked.