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

Allow user to override any entry in the default_theme #169

Merged
merged 2 commits into from Mar 20, 2022

Conversation

mehalter
Copy link
Member

This allows the user to override colors and highlight groups inside of init.lua

example:

local config = {
  default_theme = {
    colors = {
      bg = "#1e222a",
    },
    highlights = {
      TSField = { fg = "#C9CBFF", style = "italic" },
    },
  }
}

return config

Example using the color table:

return {
  default_theme = {
    colors = {
      bg = "#1e222a",
      lavender = "#C9CBFF", -- add a new color
    },
    highlights = function(highlights)
      local C = require "default_theme.colors"
      highlights.TSField = { fg = C.lavender, style = "italic" }

      return highlights
    end,
  },
}

@mehalter mehalter added the enhancement New feature or request label Mar 20, 2022
@mehalter mehalter self-assigned this Mar 20, 2022
@kabinspace kabinspace merged commit e6c2a5a into main Mar 20, 2022
@mehalter mehalter deleted the user_theme_config branch March 20, 2022 15:08
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

Successfully merging this pull request may close these issues.

None yet

2 participants