From fc96e7432f30ecb6d469937ee253d2e69ba3536c Mon Sep 17 00:00:00 2001 From: WriterV2 Date: Mon, 13 Apr 2026 20:00:10 +0200 Subject: Neovim: Update to 0.12 features and other changes - Remove redundant treesitter configuration - Replace Paq with built-in plugin manager Pack - Replace fidget with prints on `LspProgress` event - Fix rust-analyzer clippy check on save --- .config/nvim/lua/lsp_config.lua | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to '.config/nvim/lua/lsp_config.lua') diff --git a/.config/nvim/lua/lsp_config.lua b/.config/nvim/lua/lsp_config.lua index 20eecd1..6ca0202 100644 --- a/.config/nvim/lua/lsp_config.lua +++ b/.config/nvim/lua/lsp_config.lua @@ -47,6 +47,7 @@ cmp.setup({ }) }) + -- Jump forward or backward to snippet placeholders in insert mode vim.api.nvim_set_keymap("i", "", "(vsnip-jump-next)", { noremap = false }) vim.api.nvim_set_keymap("s", "", "(vsnip-jump-next)", { noremap = false }) @@ -75,7 +76,6 @@ cmp.setup.cmdline(':', { -- add additional completion capabilities local capabilities = require('cmp_nvim_lsp').default_capabilities() - -- attaches settings after language server attaches to current buffer local on_attach = function(client, bufnr) local bufopts = { noremap = true, silent = true, buffer = bufnr } @@ -102,6 +102,21 @@ for _, method in ipairs({ 'textDocument/diagnostic', 'workspace/diagnostic' }) d return default_diagnostic_handler(err, result, context, config) end end +-- +-- show nvim-lsp progress +vim.api.nvim_create_autocmd('LspProgress', { + callback = function(ev) + local value = ev.data.params.value + vim.api.nvim_echo({ { value.message or 'done' } }, false, { + id = 'lsp.' .. ev.data.params.token, + kind = 'progress', + source = 'vim.lsp', + title = value.title, + status = value.kind ~= 'end' and 'running' or 'success', + percent = value.percentage, + }) + end, +}) -- Language Servers @@ -111,7 +126,7 @@ vim.lsp.config('rust_analyzer', { on_attach = on_attach, settings = { ["rust-analyzer"] = { - checkOnSave = { + check = { command = "clippy" }, assist = { @@ -258,7 +273,3 @@ vim.lsp.config('expert', { filetypes = { 'elixir', 'eelixir', 'heex' }, }) vim.lsp.enable('expert') - - --- show nvim-lsp progress -require "fidget".setup {} -- cgit v1.2.3