sayanarijit / xplr

A hackable, minimal, fast TUI file explorer
https://xplr.dev
MIT License
4.17k stars 75 forks source link

Implement a plugin manager #443

Closed sayanarijit closed 2 years ago

sayanarijit commented 2 years ago

Now that we got enough plugins, we need a plugin manager to make installing and managing xplr plugins simpler.

A few properties I'd like in the plugin manager:

sayanarijit commented 2 years ago

Feel free to comment your ideas.

dtomvan commented 2 years ago

In neovim I use packer.nvim, you give it a declarative config, and it will leverage git on your system and some neovim API calls to move plugins into paths where neovim can load them automatically.

erikLundstedt commented 2 years ago

fennel support for the pluggin manager

I should be able to give pointers on how to make it as easy as possible to use i would recomend something like this:

(syncPlugin {
               :name "name of plugin"
               :host :github
               :repo :username/plugin.xplr})

and here is the resulting/equivalent lua

syncPlugin(
                 {
                   name = "name of plugin",
                   host = "github", 
                   repo = "username/plugin.xplr"
                  }
)

this is modeled after use-package, a packagemanager for emacs

erikLundstedt commented 2 years ago

this is a great tool to check syntax stuff you dont need to learn fennel to support it I would probably recommend implementing the lua side first(and i saw now that the manager itself will be lua so that should support fennel allmost automaticaly)

dtomvan commented 2 years ago

How would you go about triggering the install/update/load/reload process? With keybinds?

Is there a proper way to "reload" everything, since resetting all state is impossible for how the rust backend works at the moment. Everything just gets loaded at startup time. Reloading == Loading again?

sayanarijit commented 2 years ago

You're right... It's not possible right now. I think we need to implement a config watcher natively like wezterm/alacrity.

erikLundstedt commented 2 years ago

i honestly usually prefer not having the config autoreload

there are a coupple times ive tried to edit something in the alacritty config, done a :w and ended up with a broken config

i dont have that issue with wezterm because i manually run a script to transpile (translate/compile) my fennel-code as i write those configs in fennel and have a makefile to compile it

sayanarijit commented 2 years ago

Got it... So autoreload feature can be on hold then...

erikLundstedt commented 2 years ago

Got it... So autoreload feature can be on hold then...

yes, but then im just a single user that tweaks quite a lot, and i sometimes get erroring configs because i save in the middle of implementing/adding something

once you actually implement it, make sure to add an option to turn it off, this should allso be something you can overwrite per-instance with an argument

dtomvan commented 2 years ago

I've started working on a plugin manager. Currently, it can only download, load and configure plugins. It does not remove unnecessary plugins (yet). My config got a whole lot simpler tho. Config: https://github.com/dtomvan/.config/blob/4c5621cdd3faa2e09dbb51b5652fed0868a8d196/xplr/.config/xplr/init.lua#L30

dtomvan commented 2 years ago

Oh, I forgot linking the repo. https://github.com/dtomvan/xpm.xplr

sayanarijit commented 2 years ago

Hey nice... Thanks for taking the initiative. Api looks good.

sayanarijit commented 2 years ago

Closing this as I think xpm.xplr on the right path. Most important requirements were implemented, others can be implemented as/if needed. Further progress can be track in the plugin repository.