From 0fcde3f233cc72a47c96efbf83b59d7a59fd433b Mon Sep 17 00:00:00 2001 From: Minijackson Date: Mon, 31 Mar 2025 23:38:47 +0200 Subject: nixvim-dev: remove lsp-lines, migrate ;sd mapping, new ;sT mapping lsp-lines was upstreamed to neovim --- common/nixvim.nix | 26 ++++++++++++++++++++++++++ usecases/desktop/development/nixvim-dev.nix | 12 ------------ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/common/nixvim.nix b/common/nixvim.nix index 768540e..abcd4d6 100644 --- a/common/nixvim.nix +++ b/common/nixvim.nix @@ -65,6 +65,8 @@ inputs: colorschemes.melange.enable = true; + diagnostics.virtual_lines = true; + keymaps = let toggle = key: option: { @@ -304,6 +306,30 @@ inputs: action = "Trouble qflist toggle"; options.desc = "Quickfix List (Trouble)"; } + + { + key = "sd"; + action = '' + function() + local new_config = not vim.diagnostic.config().virtual_lines + vim.diagnostic.config({ virtual_lines = new_config }) + end + ''; + mode = "n"; + lua = true; + options.desc = "LSP toggle inline diagnostics"; + } + { + key = "sT"; + action = '' + function() + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) + end + ''; + mode = "n"; + lua = true; + options.desc = "LSP toggle inline text"; + } ]; # TODO: diff --git a/usecases/desktop/development/nixvim-dev.nix b/usecases/desktop/development/nixvim-dev.nix index a20e0a8..fbfe106 100644 --- a/usecases/desktop/development/nixvim-dev.nix +++ b/usecases/desktop/development/nixvim-dev.nix @@ -57,12 +57,6 @@ _inputs: options.desc = "LSP definitions"; } - { - key = "sd"; - action = "require('lsp_lines').toggle"; - lua = true; - options.desc = "LSP toggle inline diagnostics"; - } { key = "sE"; action = "require('telescope.builtin').diagnostics"; @@ -160,12 +154,6 @@ _inputs: }; }; - lsp-lines = { - enable = true; - # TODO: seems buggy with multiple sources? - # currentLine = true; - }; - rustaceanvim = { enable = true; settings.server = { -- cgit v1.2.3