From d0dd2c9e2540e1fe29f673d32aff27e4591d5297 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Fri, 11 Apr 2025 15:43:10 +0200 Subject: LSP and plugin improvements --- config/nvim/lua/lsp.lua | 23 ++++++++++++++++++++++- config/nvim/lua/plugins.lua | 22 +++++----------------- 2 files changed, 27 insertions(+), 18 deletions(-) (limited to 'config/nvim/lua') diff --git a/config/nvim/lua/lsp.lua b/config/nvim/lua/lsp.lua index e74a330..7dfb050 100644 --- a/config/nvim/lua/lsp.lua +++ b/config/nvim/lua/lsp.lua @@ -11,8 +11,29 @@ lspconfig.dartls.setup(coq.lsp_ensure_capabilities({})) lspconfig.rust_analyzer.setup(coq.lsp_ensure_capabilities({ -- Server-specific settings. See `:help lspconfig-setup` settings = { - ['rust-analyzer'] = {}, + ['rust-analyzer'] = { + imports = { + granularity = { + group = "module", + }, + prefix = "self", + }, + cargo = { + buildScripts = { + enable = true, + }, + }, + procMacro = { + enable = true + }, + checkOnSave = { + command = "clippy" + } + }, }, + on_attach = function(client, bufnr) + vim.lsp.inlay_hint.enable(true, { bufnr = bufnr }) + end })) lspconfig.lua_ls.setup(coq.lsp_ensure_capabilities({})) diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index e4dadf6..882c76d 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -56,7 +56,6 @@ require('lazy').setup({ -- Syntaxes 'ARM9/snes-syntax-vim', 'https://git.sr.ht/~torresjrjr/gemini.vim', - { 'folke/neodev.nvim', opts = {} }, --'Debugging { @@ -77,21 +76,6 @@ require('lazy').setup({ config = true }, 'michaeljsmith/vim-indent-object', - { - 'Pocco81/auto-save.nvim', - opts = { - condition = function(buf) - local fn = vim.fn - local utils = require('auto-save.utils.data') - - if fn.getbufvar(buf, '&modifiable') == 1 - and utils.not_in(fn.getbufvar(buf, '&filetype'), {'oil'}) then - return true - end - return false - end, - } - }, { 'danymat/neogen', config = true @@ -103,7 +87,11 @@ require('lazy').setup({ -- LSP 'neovim/nvim-lspconfig', - 'folke/neodev.nvim', + { + "folke/lazydev.nvim", + ft = "lua", + opts = {}, + }, -- Tools 'mbbill/undotree', -- cgit