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

[Feature]: Inherit globals from fzf-lua config #5

Open
sandersantema opened this issue Jan 29, 2025 · 2 comments
Open

[Feature]: Inherit globals from fzf-lua config #5

sandersantema opened this issue Jan 29, 2025 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@sandersantema
Copy link

Assuming it doesn't conflict with fzf-org's own options, I think it might be a nice idea to inherit the global fzf-lua options, i.e. those set as:

require('fzf').setup({
  defaults = { ... }
})

Currently this can be done as follows:

require('fzf-org').setup({
  defaults = require('fzf-lua').config.globals.defaults,
})

I've got no idea whether there is any precedent for this, but it seems like orgmode global options could be set in the same defaults table of the fzf setup which could be accessed using require('fzf-lua').config.globals.defaults.orgmode (assuming the table is called orgmode).
This might help with the "use fzf-lua’s own defaults system" mentioned in the development file, but I have no idea if this is the usual way to do this.

Thanks a lot for the plugin!

@0xzhzh
Copy link
Owner

0xzhzh commented Jan 30, 2025

@sandersantema , thanks for checking out the plugin and opening this issue!

I think what you're describing is along the lines of what I had in mind in DEVELOPMENT.org. But I was specifically talking about the actions configuration. I haven't tried the defaults thing yet, but are you sure that works? It doesn't seem documented anywhere.

I've got no idea whether there is any precedent for this

I think that's why I'm not super clear on what exactly. I don't have any idea about precedent either. It seems like fzf-lua only specifies two actions can be inherited by other providers, files and buffers:

https://github.com/ibhagwan/fzf-lua/blob/0f953fd7a35d22e1409d5ce77bbacef9cf07e2cb/lua/fzf-lua/defaults.lua#L115-L130

It has its own notion of defaults internally, and merges those with setup_opts and call_opts (with later opts taking precedence), but I haven't seen anything that suggests the defaults system is meant to be exposed for third-party providers. In fact, it's not clear to what I should be doing as third-party provider, but perhaps I just haven't looked hard enough.

Separately, all of the options in my plugin inherit from the orgmode configuration, but that's because everything in my plugin is implemented as a specialization of options that go through a single orgmode provider. I'm not sure fzf-lua does that.

@0xzhzh 0xzhzh added enhancement New feature or request help wanted Extra attention is needed labels Jan 30, 2025
@0xzhzh
Copy link
Owner

0xzhzh commented Jan 30, 2025

The right way to do this would be to file some issues and ask ibhagwan for advice. But I wanted to kick the tires on the plugin as written before doing that, and prioritize other features like nicer reloading and a live_grep-like interface for interactive orgmode searches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants