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

Make highlights more configurable #4

Open
0xzhzh opened this issue Jan 26, 2025 · 5 comments
Open

Make highlights more configurable #4

0xzhzh opened this issue Jan 26, 2025 · 5 comments
Labels
enhancement New feature or request

Comments

@0xzhzh
Copy link
Owner

0xzhzh commented Jan 26, 2025

The current highlighting system consists of some highlight groups I picked on a whim, and are not configurable, nor do they match the highlight groups used in nvim-orgmode.

Following discussion in #2, we can make the highlights of each headline level match how they look in nvim-orgmode. However, I’m personally not sure I want to make this the default because I’m not sure if I want a bunch of different colors in my fzf window.

@ficcdaf
Copy link

ficcdaf commented Jan 27, 2025

Leaving it off by default sounds like a safe bet, just having the option in the config would be great. Do you want me to try implementing this or would you do it?

@0xzhzh
Copy link
Owner Author

0xzhzh commented Jan 28, 2025

I'm still not sure exactly what mechanism we should use yet. Personally, I lean toward having a section in the config like:

orgmode = {
  highlight_groups = {
    category = "Variable",
    headline1 = "etc",
  }
}

because that's very declarative etc.

But that's not what fzf-lua does: https://github.com/ibhagwan/fzf-lua?tab=readme-ov-file#highlights it defines its own collection of highlight groups. I'm starting to lean towards doing what fzf-lua does to stay consistent (and linking fzf-org's highlight groups to fzf-lua's highlight groups by default).

@0xzhzh 0xzhzh added the enhancement New feature or request label Jan 30, 2025
@ficcdaf
Copy link

ficcdaf commented Jan 30, 2025

I think creating distinct highlight groups and linking them to either FzfLua or orgmode's highlight groups would be the best way forward. It also makes it much easier for a color scheme to add support for this plugin (I maintain one, and tend to add support for all the plugins I use, so perhaps I'm a bit biased on this, haha).

Tbh, I think that adding a config option to change the highlight groups unnecessarily add to the startup time. Users that want to change the highlights can easily do so via Neovim's API, as long as you list the names of the highlight groups in the readme.

If you take this approach, make sure not to overwrite the highlight group if it's already set by the user. org-bullets.nvim has easy code for that if you need a reference.

Since I have experience working with HL groups I'd be happy to try implementing this if you want. Just let me know.

@0xzhzh
Copy link
Owner Author

0xzhzh commented Jan 30, 2025

Sure, that sounds reasonable. I'd greatly appreciate your contribution! (I personally hate fussing with highlights 🙃)

@ficcdaf
Copy link

ficcdaf commented Jan 30, 2025

No worries, I'm happy to contribute! Adding this to my agenda and I'll get started on it when I have a bit of time.

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

No branches or pull requests

2 participants