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

RFC: Options and groups #131

Closed
mvllow opened this issue Feb 24, 2023 · 5 comments · Fixed by #185
Closed

RFC: Options and groups #131

mvllow opened this issue Feb 24, 2023 · 5 comments · Fixed by #185

Comments

@mvllow
Copy link
Member

mvllow commented Feb 24, 2023

Currently there is some overlap between groups and highlight_groups, as well as some of our options.

Options

My initial thought is to deprecate the options below in favour of improving groups and contributing to https://github.com/rose-pine/neovim/wiki/Recipes.

bold_vert_split

{
	bold_vert_split = true,
	
	-- Is equal to

	highlight_groups = {
		VertSplit = { fg = "highlight_med", bg = "highlight_med" }
	}
}

dim_nc_background

We'll come back to this in the future.

Groups

Groups have proven to be quite beneficial for customising Rosé Pine.

{
	groups = {
		comment = "foam"
	},

	-- Is equal to

	highlight_groups = {
		Comment = { fg = "foam" },

		-- Highlight groups give the user more control
		Comment = { fg = "foam", bg = "foam", blend = 10, italic = true }
	},
}

I think it makes sense to deprecate duplicate groups:

  1. groups.base

    Setting groups.base = "none" seems like the only useful override but can also be achieved via disable_background = true

  2. groups.panel

    Similar to groups.base, removable via disable_float_background = true

  3. groups.base_nc and groups.panel_nc

    need some more thought

  4. groups.border

    Slightly more discoverable, but if we linked all borders to FloatBorder we could replace it with:

    - groups.border = "highlight_med"
    + highlight_groups["FloatBorder"] = { fg = "highlight_med", bg = "surface" }
  5. groups.comment

    - groups.comment = "muted"
    + highlight_groups["Comment"] = { fg = "muted" }
  6. groups.link

    - groups.link = "iris"
    + highlight_groups["@text.uri"] = { fg = "iris", sp = "iris", underline = true }
  7. groups.punctuation

    - groups.punctuation = "subtle"
    + highlight_groups["@punctuation"] = "subtle"

Closing thoughts

Mainly thinking out loud here. Having so many options for a theme feels silly. Open to any feedback and suggestions.

More highlights can be linked to similar existing highlights for proposals to be more viable.

@mvllow
Copy link
Member Author

mvllow commented Mar 30, 2023

I'm leaning against changing points 4-7. After some testing, relying on arbitrary highlight groups such as @text.uri to change all links does not seem intuitive. Need to put some more thought into this to see if any meaninful changes and simplifications can be made to justify any breaking changes (any deprecated options should be gracefully handled).

@FruityCat
Copy link
Contributor

Just to make sure I'm understanding correctly, you want to keep the groups and highlight groups tables but just want to get rid of the unneeded groups options (like comment ) and have those only done through highlight_groups?

@mvllow
Copy link
Member Author

mvllow commented Jul 11, 2023

That would be ideal, because you have more flexibility when setting highlight_groups whereas groups would contain anything that changes multiple highlight groups, e.g punctuation.

If these changes are made, I don’t think I would remove any previously working options but simply remove them from any documentation to avoid breaking changes.

@FruityCat
Copy link
Contributor

FruityCat commented Jul 12, 2023

Yeah I think that would absolutely be a good change.

One thing that would be nice as well is if highlight_groups could maintain their default behaviour for untouched options when being changed.

If I only want to, for example, enable italics on paramaters but not touch the default colour, currently I have to do ["@parameter"] = { fg = "iris", italic = true }, for it to maintain the colour set by rose pine. It would be nice if I could just change one aspect of a highlight_group without it changing all the others unintentionally. This means that ["@parameter"] = { italic = true }, would only enable highlights but not touch the default colours or whether it's bold or not.

Edit: Actually might just be able to implement this myself when I get some time.

@FruityCat
Copy link
Contributor

One thing that would be nice as well is if highlight_groups could maintain their default behaviour for untouched options when being changed.

If I only want to, for example, enable italics on paramaters but not touch the default colour, currently I have to do ["@parameter"] = { fg = "iris", italic = true }, for it to maintain the colour set by rose pine. It would be nice if I could just change one aspect of a highlight_group without it changing all the others unintentionally. This means that ["@parameter"] = { italic = true }, would only enable highlights but not touch the default colours or whether it's bold or not.

PR for this is now up. pull #171

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants