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

View file

@ -121,29 +121,6 @@ in
''; '';
} }
{
plugin = pkgs.vimUtils.buildVimPlugin {
name = "diagflow";
src = pkgs.fetchFromGitHub {
owner = "dgagn";
repo = "diagflow.nvim";
rev = "fc09d55d2e60edc8ed8f9939ba97b7b7e6488c99";
hash = "sha256-2WNuaIEXcAgUl2Kb/cCHEOrtehw9alaoM96qb4MLArw=";
};
};
type = "lua";
config = ''
require('diagflow').setup {
scope = "line",
gap_size = 0,
max_width = 50,
max_height = 20,
show_borders = true,
toggle_event = { "InsertEnter", "InsertLeave" },
}
'';
}
{ {
plugin = pkgs.vimUtils.buildVimPlugin { plugin = pkgs.vimUtils.buildVimPlugin {
name = "dieter-nvim"; name = "dieter-nvim";

View file

@ -149,14 +149,17 @@ local setupGroups = function(c)
CursorLine = { bg = c.highlight_subtle }, CursorLine = { bg = c.highlight_subtle },
DiagnosticError = { fg = c.diagnostic_error, italic = true }, DiagnosticError = { fg = c.diagnostic_error, italic = true },
DiagnosticHint = { fg = c.diagnostic_hint, italic = true },
DiagnosticInfo = { fg = c.diagnostic_info, italic = true },
DiagnosticWarn = { fg = c.diagnostic_warn, italic = true },
DiagnosticFloatingError = { fg = c.diagnostic_error, bg = c.popup_error_bg }, DiagnosticFloatingError = { fg = c.diagnostic_error, bg = c.popup_error_bg },
DiagnosticFloatingWarn = { fg = c.diagnostic_warning, bg = c.popup_warning_bg },
DiagnosticFloatingInfo = { fg = c.diagnostic_info, bg = c.popup_info_bg },
DiagnosticFloatingHint = { fg = c.diagnostic_hint, bg = c.popup_hint_bg }, DiagnosticFloatingHint = { fg = c.diagnostic_hint, bg = c.popup_hint_bg },
DiagnosticFloatingInfo = { fg = c.diagnostic_info, bg = c.popup_info_bg },
DiagnosticFloatingWarn = { fg = c.diagnostic_warning, bg = c.popup_warning_bg },
DiagnosticUnderlineError = { fg = c.foreground, undercurl = true, sp = c.diagnostic_error }, DiagnosticUnderlineError = { fg = c.foreground, undercurl = true, sp = c.diagnostic_error },
DiagnosticUnderlineWarn = { fg = c.foreground, undercurl = true, sp = c.diagnostic_warn }, DiagnosticUnderlineHint = { fg = c.foreground, undercurl = true, sp = c.diagnostic_hint },
DiagnosticUnderlineInfo = { fg = c.foreground, undercurl = true, sp = c.diagnostic_info }, DiagnosticUnderlineInfo = { fg = c.foreground, undercurl = true, sp = c.diagnostic_info },
DiagnosticUnderlinehint = { fg = c.foreground, undercurl = true, sp = c.diagnostic_hint }, DiagnosticUnderlineWarn = { fg = c.foreground, undercurl = true, sp = c.diagnostic_warn },
DiagnosticSignError = { fg = c.diagnostic_error }, DiagnosticSignError = { fg = c.diagnostic_error },
DiagnosticSignHint = { fg = c.diagnostic_hint }, DiagnosticSignHint = { fg = c.diagnostic_hint },

View file

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