Closed coder3101 closed 2 years ago
That plugin is not required since this theme does support the Neovim 0.6 and later Diagnostic module.
Please remove that plugin with this theme.
I tried to use the plugin because the this theme did not automatically made the LSP diagnostics coloured. Even in the Readme screenshot the error at line 19 is not coloured.
In the screenshot I disabled the underline setting due to personal preference.
If however, I enable Diagnostic underlines (for example):
vim.diagnostic.config({
underline = true,
})
This is the result I obtain:
Notice the sign column has a yellow triangle and the warning itself has yellow undercurls.
The virtual text itself is in subtle grey because I do not want the text itself to distract from the code. If however you also want the virtual text coloured then just add the following to your Neovim init.lua
:
local custom_highlight = vim.api.nvim_create_augroup("CustomHighlight", {})
vim.api.nvim_create_autocmd("ColorScheme", {
pattern = "nightfly",
callback = function()
vim.api.nvim_set_hl(0, "DiagnosticVirtualTextError", { link = "NightflyRed" })
vim.api.nvim_set_hl(0, "DiagnosticVirtualTextWarn", { link = "NightflyYellow" })
vim.api.nvim_set_hl(0, "DiagnosticVirtualTextInfo", { link = "NightflyBlue" })
vim.api.nvim_set_hl(0, "DiagnosticVirtualTextHint", { link = "NightflyWhite" })
end,
group = custom_highlight,
})
With that change, this is the style I now get:
The virtual text is now using the appropriate yellow color (in your case).
That change will override individual highlight groups with a user preference. This is now documented in the new overriding highlights section.
Cheers.
Just to add for others, You have to create the auto command before setting the color scheme.
A new option now exits to set colored diagnostic virtual text:
vim.g.nightflyVirtualTextColor = true
No workarounds required anymore. It turns out that a few folks wanted colored diagnostic virtual text.
I tried to use https://github.com/folke/lsp-colors.nvim but there is no color for LSP. I want errors to look red, warnings with yellow and so on.