-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add extraConfig
option
#17
base: main
Are you sure you want to change the base?
Conversation
This look great :) plugins being dependent on each other could be a whole other discussion on its own. Did someone ever stumble on such a situation? |
01c1e95
to
a5ff27a
Compare
a5ff27a
to
f455270
Compare
Thanks :)
As far as I am aware, there are no yazi plugins that do this. I think it is probably safe to assume we will not need to worry about it because I am not sure why a plugin would need
I have renamed
As far as I am aware, there are no yazi plugins that depend on other yazi plugins. |
One more thing, mainly as a reminder for myself: |
This is true for |
The user can set However having the extraConfig available to the user as well seems like a good way to allow users to separate out each plugin more cleanly. Could you maybe add a description and option for the dynamically generated extraConfig as well :). So that if we eventually decide to build docs for this it is already documented. |
42912e3
to
8396494
Compare
My mistake, I was not really aware there was a distinction between
Sure, but where should I put this? I cannot figure out where it goes. I have tried putting it in a few places but I get errors every time, usually errors about it already being defined. The most recent commit to this PR has what I tried last. |
Oops. already answered this, but then didn´t send my message. |
9a5c3e4
to
3b832b5
Compare
3b832b5
to
f5249f2
Compare
Oh I see, so you want each plugin to have its own I have added an |
Just checked it out locally. Apart from generating a newline per plugin (which I think is fine) |
I have rebased with your fix |
Should be ready to be merged @lordkekz |
Currently, there is no way to for users to add extra code to
programs.yazi.initLua
if they are using any of the plugins that depend on usingrequire()
and running a setup function in init.lua, namely full-border, relative-motions, and starship.In addition, using more than one of these plugins causes a conflict when nix tries to evaluate it.
This PR remedies both of these problems.
I added an
extraConfig
option for any extra Lua code that a user wishes to include after the setup functions, similar to various other programs that have home manager modules.I also added an option,
requiredPlugins
, for plugins that need to berequire
d and run a setup function. It takes a list of attrsets that have two attributes,name
, the plugin's name, andsetup
, for any options that need to be passed tosetup()
. I was not sure what to name this, and I am more than happy to change it if you think a different name would suit it better.