From 1815d988489f7e1ea840db4c4a373d6c8491b2a8 Mon Sep 17 00:00:00 2001 From: Leonhard Kost Date: Tue, 8 Jul 2025 15:10:33 +0200 Subject: [PATCH] Improve diagnostic looks --- modules/home-manager/nixvim/keymaps.nix | 7 +++++++ modules/home-manager/nixvim/plugins/lsp.nix | 23 +++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/modules/home-manager/nixvim/keymaps.nix b/modules/home-manager/nixvim/keymaps.nix index 317990c..f715318 100644 --- a/modules/home-manager/nixvim/keymaps.nix +++ b/modules/home-manager/nixvim/keymaps.nix @@ -7,6 +7,13 @@ options.silent = true; } + { + mode = "n"; + key = "q"; + action.__raw = "vim.diagnostic.setloclist"; + options.desc = "Open diagnostics quickfix list"; + } + { mode = "n"; key = ""; diff --git a/modules/home-manager/nixvim/plugins/lsp.nix b/modules/home-manager/nixvim/plugins/lsp.nix index 57ad80d..87588a9 100644 --- a/modules/home-manager/nixvim/plugins/lsp.nix +++ b/modules/home-manager/nixvim/plugins/lsp.nix @@ -1,5 +1,28 @@ { programs.nixvim = { + diagnostic.settings = { + severity_sort = true; + float = { + border = "rounded"; + source = "if_many"; + }; + signs.text.__raw = "{ + [vim.diagnostic.severity.ERROR] = '󰅚 ', + [vim.diagnostic.severity.WARN] = '󰀪 ', + [vim.diagnostic.severity.INFO] = '󰋽 ', + [vim.diagnostic.severity.HINT] = '󰌶 ', + }"; + virtual_text = { + source = "if_many"; + spacing = 2; + format.__raw = " + function(diagnostic) + return diagnostic.message + end + "; + }; + }; + plugins = { lsp = { enable = true;