Skip to content
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

merge several "yazi.toml" files #1338

Closed
1 task
teto opened this issue Jul 24, 2024 · 3 comments
Closed
1 task

merge several "yazi.toml" files #1338

teto opened this issue Jul 24, 2024 · 3 comments
Labels
feature New feature request

Comments

@teto
Copy link

teto commented Jul 24, 2024

Please describe the problem you're trying to solve

I generate part of my config with nix https://nixos.org/. It has several advantages, one of which is for general toggle of a plugin.
For instance I have a nix setting yazi.enableOuchPlugin = true that enables the yazi plugin https://github.com/ndtoan96/ouch.yazi:
it puts the plugin files where expected (in ~/.config/yazi/plugins/ouch.yazi), makes "ouch" available to the plugin and enables the config advised in the plugin, i.e. the previewers and loaders.

The drawback is that generating ~/.config/yazi/yazi.toml via nix, the file becomes read-only and any change to the config becomes bothersome because it takes several seconds for nix to regenerate the config.

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

What I try to when possible do is to get the best of both worlds by merging:

  • a configuration generated by nix
  • an imperative configuration I can quickly edit/save/restart the software

Now I dont know how to do this with yazi, I dont think it's possible ?

Outside of my specific nix usecase, maybe this feature could be used by plugins to embed their own configuration ?
The possible ways to do it I could think of:

  1. add an "include" directive in yazi.toml
  2. have a "config.d" folder like for ssh, where all files in this folder are loaded
  3. have plugins embed their own yazi.toml that can be merged
  4. have a lua API to load the different configuration files (keymap/yazi.toml etc)
  1. is probably the easiest to develop and integrate

Additional context

#623 might be related

@teto teto added the feature New feature request label Jul 24, 2024
@sxyazi
Copy link
Owner

sxyazi commented Jul 25, 2024

I think introducing config merging for a performance-first file manager is a bit overkill (it will require reading more files and doing more merges), and it could also cause more confusion - I've explained my thoughts in more detail in another issue here, #989 (comment)

@sxyazi sxyazi added the waiting on op Waiting for more information from the original poster label Jul 25, 2024
@teto
Copy link
Author

teto commented Jul 25, 2024

is it possible via the API to add previewers / loaders ? I could live with that generating a script that changes my config afterwards.

@github-actions github-actions bot removed the waiting on op Waiting for more information from the original poster label Jul 25, 2024
@sxyazi
Copy link
Owner

sxyazi commented Dec 15, 2024

is it possible via the API to add previewers / loaders

Closing in favor of #2047

@sxyazi sxyazi closed this as completed Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
None yet
Development

No branches or pull requests

2 participants