Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ All options are optional — defaults work out of the box.
require("lume").setup({
transparent = false, -- set to true to use your terminal's background
italics = true, -- set to false to disable italic comments/keywords
custom_highlights = function(colors, variant)
-- colors contains: backgrounds, foregrounds, accents, ansi, special
-- variant is "dark" (or "light" when a light theme is added)
return {
Normal = { bg = "#1E1F2E" },
MiniDiffSignAdd = { fg = colors.accents.sage },
}
end,
})
```

Expand Down
1 change: 1 addition & 0 deletions lua/lume/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local M = {}
local defaults = {
transparent = false,
italics = true,
custom_highlights = nil,
}

M.config = vim.deepcopy(defaults)
Expand Down
13 changes: 13 additions & 0 deletions lua/lume/theme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ function M.apply(config)
load_module(mod, false)
end

-- Apply custom highlights
if config.custom_highlights then
local custom = config.custom_highlights
if type(custom) == "function" then
custom = custom(p, "dark")
end
if type(custom) == "table" then
for k, v in pairs(custom) do
groups[k] = vim.tbl_extend("force", groups[k] or {}, v)
end
end
end

for group, settings in pairs(groups) do
vim.api.nvim_set_hl(0, group, settings)
end
Expand Down
Loading