Change warning highlight color
liketoeatcheese opened this issue · comments
liketoeatcheese commented
Dennis B commented
Refer to the Overriding Highlights section.
What you want is probably something like this; set this is before setting the colorscheme
:
local augroup = vim.api.nvim_create_augroup
local autocmd = vim.api.nvim_create_autocmd
local highlight = vim.api.nvim_set_hl
local custom_highlight = augroup("CustomHighlight", {})
autocmd("ColorScheme", {
pattern = "moonfly",
callback = function()
highlight(0, "DiagnosticVirtualTextError", { link = "MoonflyRed" })
highlight(0, "DiagnosticVirtualTextWarn", { link = "MoonflyYellow" })
highlight(0, "DiagnosticVirtualTextInfo", { link = "MoonflyBlue" })
highlight(0, "DiagnosticVirtualTextHint", { link = "MoonflyWhite" })
end,
group = custom_highlight,
})
Dennis B commented
A new option now exists to set colored diagnostic virtual text:
vim.g.moonflyVirtualTextColor = true
No workarounds required anymore.