feat: add enabled field for styles class

- updated README.md to reflect new option

Defaults to true. If enabled is false remove all styles. Allows for
easier modification for users who do not want any styles with the
colorscheme.
This commit is contained in:
iton0 2024-09-18 22:18:18 -04:00
parent be02e3baf6
commit 0ff0f10a31
3 changed files with 21 additions and 0 deletions

View file

@ -271,6 +271,13 @@ require('solarized').setup({
})
```
You can also disable all highlight group styles.
```lua
require('solarized').setup({
styles = { enabled = false } },
})
```
## Config Highlights
The `highlights` config allows you to customize the highlights groups.

View file

@ -11,6 +11,7 @@
---@field enabled? boolean
---@class solarized.styles
---@field enabled? boolean
---@field types? vim.api.keyset.highlight
---@field functions? vim.api.keyset.highlight
---@field parameters? vim.api.keyset.highlight

View file

@ -10,6 +10,19 @@ M.config = require 'solarized.config'
M.setup = function(config)
M.config = vim.tbl_deep_extend('force', M.config, config)
if M.config.styles.enabled == false then
M.config.styles = {
types = { italic = false, bold = false },
functions = { italic = false, bold = false },
parameters = { italic = false, bold = false },
comments = { italic = false, bold = false },
strings = { italic = false, bold = false },
keywords = { italic = false, bold = false },
variables = { italic = false, bold = false },
constants = { italic = false, bold = false },
}
end
end
M.load = function()