nvim: Use new fancy built-in diagnostics

This commit is contained in:
Daniel Lundin 2025-02-09 14:08:55 +01:00
parent 7a40103f75
commit 8f1ef592cd
Signed by: dln
SSH key fingerprint: SHA256:dQy1Xj3UiqJYpKR5ggQ2bxgz4jCH8IF+k3AB8o0kmdI
3 changed files with 32 additions and 44 deletions
home/common/nvim

View file

@ -92,23 +92,31 @@ vim.o.updatetime = 250
vim.o.grepprg = [[rg --glob "!.jj" --glob "!.git" --no-heading --vimgrep --follow $*]]
vim.opt.grepformat = vim.opt.grepformat ^ { "%f:%l:%c:%m" }
vim.fn.sign_define(
"DiagnosticSignError",
{ text = "", hl = "DiagnosticSignError", texthl = "DiagnosticSignError", culhl = "DiagnosticSignErrorLine" }
)
vim.fn.sign_define(
"DiagnosticSignWarn",
{ text = "", hl = "DiagnosticSignWarn", texthl = "DiagnosticSignWarn", culhl = "DiagnosticSignWarnLine" }
)
vim.fn.sign_define(
"DiagnosticSignInfo",
{ text = "", hl = "DiagnosticSignInfo", texthl = "DiagnosticSignInfo", culhl = "DiagnosticSignInfoLine" }
)
vim.fn.sign_define(
"DiagnosticSignHint",
{ text = "", hl = "DiagnosticSignHint", texthl = "DiagnosticSignHint", culhl = "DiagnosticSignHintLine" }
)
-- Diagnostics
vim.diagnostic.config {
severity_sort = true,
signs = {
linehl = {
[vim.diagnostic.severity.ERROR] = "DiagnosticSignErrorLine",
[vim.diagnostic.severity.WARN] = "DiagnosticSignWarnLine",
[vim.diagnostic.severity.INFO] = "DiagnosticSignInfoLine",
[vim.diagnostic.severity.HINT] = "DiagnostigSignHintLine",
},
numhl = {
[vim.diagnostic.severity.ERROR] = "DiagnosticSignError",
[vim.diagnostic.severity.WARN] = "DiagnosticSignWarn",
[vim.diagnostic.severity.INFO] = "DiagnosticSignInfo",
[vim.diagnostic.severity.HINT] = "DiagnostigSignHint",
},
text = {
[vim.diagnostic.severity.ERROR] = "",
[vim.diagnostic.severity.WARN] = "",
[vim.diagnostic.severity.INFO] = "",
[vim.diagnostic.severity.HINT] = "",
},
},
virtual_lines = true,
}
-- Make <Tab> work for snippets
vim.keymap.set({ "i", "s" }, "<Tab>", function()