From 0e48d46372f9a29a3c6fc486e3db50e021dc0150 Mon Sep 17 00:00:00 2001 From: sloane <1699281+sloanelybutsurely@users.noreply.github.com> Date: Fri, 19 Jul 2024 09:21:13 -0400 Subject: [PATCH] use lsp-zero --- .config/nvim/lazy-lock.json | 5 ++++- .config/nvim/lua/config/lazy.lua | 3 ++- .config/nvim/lua/plugins/elixir.lua | 31 --------------------------- .config/nvim/lua/plugins/lsp.lua | 33 +++++++++++++++++++---------- 4 files changed, 28 insertions(+), 44 deletions(-) delete mode 100644 .config/nvim/lua/plugins/elixir.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 157b338..709def3 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,10 +1,13 @@ { - "elixir-tools.nvim": { "branch": "main", "commit": "5e7596be469be0800e9cbe3415de971f7286c3d0" }, + "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "lazy.nvim": { "branch": "main", "commit": "c92c6b5fd2b3a13c8999ab8379e43a79c9406e59" }, + "lsp-zero.nvim": { "branch": "v3.x", "commit": "87701af045b3032515776abeb47eb8c2ddb5e679" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mini.icons": { "branch": "main", "commit": "c291191e2a2a99f8aeea5e4d6406af54d11c9608" }, "nerdtree": { "branch": "master", "commit": "fbb71fcd90602e3ec77f40b864b5f9b437c496c5" }, + "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" }, "nvim-lspconfig": { "branch": "master", "commit": "df9c116cbcf0aa7e58f2b36b0296fa687e87f36f" }, "nvim-treesitter": { "branch": "master", "commit": "de8d91d0efb9016004f04279aae115edb4ef5bf2" }, "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua index c3c7f1a..c1a885b 100644 --- a/.config/nvim/lua/config/lazy.lua +++ b/.config/nvim/lua/config/lazy.lua @@ -28,5 +28,6 @@ require("lazy").setup({ { import = "plugins" }, }, -- automatically check for plugin updates - checker = { enabled = true }, + checker = { enabled = false }, + change_detection = { enabled = false }, }) diff --git a/.config/nvim/lua/plugins/elixir.lua b/.config/nvim/lua/plugins/elixir.lua deleted file mode 100644 index 94978cf..0000000 --- a/.config/nvim/lua/plugins/elixir.lua +++ /dev/null @@ -1,31 +0,0 @@ -return { - 'elixir-tools/elixir-tools.nvim', - version = '*', - event = { 'BufReadPre', 'BufNewFile' }, - config = function() - local elixir = require('elixir') - local elixirls = require('elixir.elixirls') - - elixir.setup { - nextls = {enable = true}, - elixirls = { - enable = true, - settings = elixirls.settings { - dialyzerEnabled = false, - enableTestLenses = false, - }, - on_attach = function(client, bufnr) - vim.keymap.set('n', 'fp', ':ElixirFromPipe', { buffer = true, noremap = true }) - vim.keymap.set('n', 'tp', ':ElixirToPipe', { buffer = true, noremap = true }) - vim.keymap.set('v', 'em', ':ElixirExpandMacro', { buffer = true, noremap = true }) - end, - }, - projectionist = { - enable = true - } - } - end, - dependencies = { - 'nvim-lua/plenary.nvim', - }, -} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 585b492..c38330b 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -1,20 +1,31 @@ return { { - 'williamboman/mason.nvim', - cmd = { - 'Mason', - 'MasonUpdate', - 'MasonInstall', - 'MasonUninstall', - 'MasonUninstallAll', - 'MasonLog' - }, + 'VonHeikemen/lsp-zero.nvim', + branch = 'v3.x', dependencies = { - 'williamboman/mason-lspconfig.nvim', 'neovim/nvim-lspconfig', + 'williamboman/mason.nvim', + 'williamboman/mason-lspconfig.nvim', + 'hrsh7th/nvim-cmp', + 'hrsh7th/cmp-nvim-lsp', + 'L3MON4D3/LuaSnip', }, config = function () - require('mason').setup() + local lsp_zero = require('lsp-zero') + + lsp_zero.on_attach(function (client, bufnr) + lsp_zero.default_keymaps({ buffer = bufnr }) + end) + + require('mason').setup({}) + require('mason-lspconfig').setup({ + ensure_installed = {}, + handlers = { + function (server_name) + require('lspconfig')[server_name].setup({}) + end, + }, + }) end }, }