update diagnostic signs configuration

Refactor the diagnostic signs setup to use a structured
table for severity levels, improving clarity and maintainability.
This commit is contained in:
Ray Elliott 2025-12-08 00:10:32 +00:00
parent fc250c0be2
commit e94c3cb923
1 changed files with 8 additions and 8 deletions

View File

@ -52,7 +52,14 @@ vim.diagnostic.config({
return string.format("%s: %s", diagnostic.source or "", diagnostic.message)
end,
},
signs = true, -- Keep signs in signcolumn
signs = {
text = {
[vim.diagnostic.severity.ERROR] = "E",
[vim.diagnostic.severity.WARN] = "W",
[vim.diagnostic.severity.HINT] = "H",
[vim.diagnostic.severity.INFO] = "I",
},
},
underline = true, -- Underline problematic text
update_in_insert = false, -- Don't update diagnostics while typing
severity_sort = true, -- Sort by severity (errors first)
@ -63,10 +70,3 @@ vim.diagnostic.config({
prefix = '',
},
})
-- Diagnostic signs in signcolumn
local signs = { Error = "E", Warn = "W", Hint = "H", Info = "I" }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end