bluz71 / vim-moonfly-colors

A dark charcoal theme for modern Neovim & classic Vim
MIT License
881 stars 64 forks source link

Change warning highlight color #32

Closed liketoeatcheese closed 1 year ago

liketoeatcheese commented 1 year ago

Hey mate,

First of all, love the theme, very pleasing to the eye.

To my question, is there a config somewhere to change the warning or error message color? I'm using MasonLSP if that matters. image I'd prefer some more pop up color like red or orange for error so I can pay attention to it.

bluz71 commented 1 year ago

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,
})
bluz71 commented 1 year ago

A new option now exists to set colored diagnostic virtual text:

vim.g.moonflyVirtualTextColor = true

No workarounds required anymore.