summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/lsp_config.lua
diff options
context:
space:
mode:
authorWriterV2 <primary-v2@protonmail.com>2026-04-13 20:00:10 +0200
committerWriterV2 <primary-v2@protonmail.com>2026-04-13 20:03:35 +0200
commitfc96e7432f30ecb6d469937ee253d2e69ba3536c (patch)
tree96f3c57d9b655063782fef2342f8dc833166e89f /.config/nvim/lua/lsp_config.lua
parentb6e9a54f81de6254f85e7559ddf0256eb048fe5c (diff)
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
Diffstat (limited to '.config/nvim/lua/lsp_config.lua')
-rw-r--r--.config/nvim/lua/lsp_config.lua23
1 files changed, 17 insertions, 6 deletions
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", "<C-l>", "<Plug>(vsnip-jump-next)", { noremap = false })
vim.api.nvim_set_keymap("s", "<C-l>", "<Plug>(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 {}