lazy.nvim/lua/lazy/view/colors.lua

62 lines
1.4 KiB
Lua
Raw Normal View History

2022-11-21 06:25:21 +08:00
local M = {}
M.colors = {
H1 = "IncSearch", -- home button
H2 = "Bold", -- titles
Comment = "Comment",
2022-11-21 06:25:21 +08:00
Normal = "NormalFloat",
Commit = "@variable.builtin", -- commit ref
CommitIssue = "Number",
CommitType = "Title", -- conventional commit type
CommitScope = "Italic", -- conventional commit scope
Prop = "Conceal", -- property
Value = "@string", -- value of a property
NoCond = "DiagnosticWarn", -- unloaded icon for a plugin where `cond()` was false
2022-12-26 16:37:26 +08:00
ProgressDone = "Constant", -- progress bar done
ProgressTodo = "LineNr", -- progress bar todo
2022-11-21 06:25:21 +08:00
Special = "@punctuation.special",
ReasonRuntime = "@macro",
ReasonPlugin = "Special",
ReasonEvent = "Constant",
ReasonKeys = "Statement",
ReasonStart = "@field",
ReasonSource = "Character",
ReasonFt = "Character",
ReasonCmd = "Operator",
ReasonImport = "Identifier",
2022-11-29 17:30:14 +08:00
Button = "CursorLine",
ButtonActive = "Visual",
TaskOutput = "MsgArea", -- task output
TaskError = "ErrorMsg", -- task errors
Dir = "@text.reference", -- directory
Url = "@text.reference", -- url
2022-11-21 06:25:21 +08:00
}
2022-11-21 06:34:35 +08:00
M.did_setup = false
2022-11-21 06:25:21 +08:00
function M.set_hl()
2022-12-26 16:37:26 +08:00
for hl_group, link in pairs(M.colors) do
vim.api.nvim_set_hl(0, "Lazy" .. hl_group, {
link = link,
default = true,
})
2022-11-21 06:25:21 +08:00
end
end
function M.setup()
if M.did_setup then
return
end
M.did_setup = true
M.set_hl()
vim.api.nvim_create_autocmd("ColorScheme", {
callback = function()
M.set_hl()
end,
})
end
return M