mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
feat: lazy view
This commit is contained in:
parent
a612e6f6f4
commit
a87982ff15
4 changed files with 322 additions and 0 deletions
57
lua/lazy/view/colors.lua
Normal file
57
lua/lazy/view/colors.lua
Normal file
|
@ -0,0 +1,57 @@
|
|||
local M = {}
|
||||
|
||||
M.colors = {
|
||||
Error = "Error",
|
||||
H1 = "Title",
|
||||
H2 = "Title",
|
||||
Muted = "Comment",
|
||||
Normal = "NormalFloat",
|
||||
ProgressDone = {
|
||||
bold = true,
|
||||
default = true,
|
||||
fg = "#ff007c",
|
||||
},
|
||||
ProgressTodo = "LineNr",
|
||||
Special = "@punctuation.special",
|
||||
}
|
||||
|
||||
M.did_setup = true
|
||||
|
||||
function M.set_hl()
|
||||
for hl_group, opts in pairs(M.colors) do
|
||||
hl_group = "Lazy" .. hl_group
|
||||
|
||||
if type(opts) == "string" then
|
||||
opts = {
|
||||
link = opts,
|
||||
}
|
||||
end
|
||||
|
||||
opts.default = true
|
||||
|
||||
vim.api.nvim_set_hl(0, hl_group, opts)
|
||||
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,
|
||||
})
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "VeryLazy",
|
||||
callback = function()
|
||||
M.set_hl()
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
Loading…
Add table
Add a link
Reference in a new issue