diff options
Diffstat (limited to 'lua/lvim/config/settings.lua')
-rw-r--r-- | lua/lvim/config/settings.lua | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lua/lvim/config/settings.lua b/lua/lvim/config/settings.lua index 42281ca1..b43b620e 100644 --- a/lua/lvim/config/settings.lua +++ b/lua/lvim/config/settings.lua @@ -74,6 +74,39 @@ M.load_default_options = function() ["[jt]sconfig.*.json"] = "jsonc", }, } + + local default_diagnostic_config = { + signs = { + active = true, + values = { + { name = "DiagnosticSignError", text = lvim.icons.diagnostics.Error }, + { name = "DiagnosticSignWarn", text = lvim.icons.diagnostics.Warning }, + { name = "DiagnosticSignHint", text = lvim.icons.diagnostics.Hint }, + { name = "DiagnosticSignInfo", text = lvim.icons.diagnostics.Information }, + }, + }, + virtual_text = true, + update_in_insert = false, + underline = true, + severity_sort = true, + float = { + focusable = true, + style = "minimal", + border = "rounded", + source = "always", + header = "", + prefix = "", + format = function(d) + local code = d.code or (d.user_data and d.user_data.lsp.code) + if code then + return string.format("%s [%s]", d.message, code):gsub("1. ", "") + end + return d.message + end, + }, + } + + vim.diagnostic.config(default_diagnostic_config) end M.load_headless_options = function() |