diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index acd433d..d3a7f13 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -11,14 +11,12 @@ "lazy.nvim": { "branch": "main", "commit": "c501b429cf995c645454539b924aaefae45bb9eb" }, "leap.nvim": { "branch": "main", "commit": "eca8108dcd5f41fbde2a674dceb58b81ed887dc8" }, "lsp-zero.nvim": { "branch": "v3.x", "commit": "16de3b18c5f7b6230d89b8e64ce9a4801b6f8d08" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, - "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" }, "mini.bufremove": { "branch": "main", "commit": "e6044aa28e61d4dd9ec86194d6f81743eced0c1c" }, "mini.diff": { "branch": "main", "commit": "6c1708a42ccb204d0c62d968eceb0203e037e61d" }, "mini.surround": { "branch": "main", "commit": "c40ac9c0060467a82430fab12d30395c5768b5e4" }, "nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" }, "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, - "nvim-lspconfig": { "branch": "master", "commit": "f43135c38a37c588053ad5e209c7460f43f6340c" }, + "nvim-lspconfig": { "branch": "master", "commit": "3ff0322f35393648e34e49fa4dbd94a034311e1f" }, "oil.nvim": { "branch": "master", "commit": "65c53dbe4f2140236590a7568a5f22a77d16be39" }, "onedark.nvim": { "branch": "master", "commit": "8e4b79b0e6495ddf29552178eceba1e147e6cecf" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 8a13c28..6f071f7 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -116,8 +116,6 @@ return require("lazy").setup({ { "https://github.com/VonHeikemen/lsp-zero.nvim", dependencies = { - "https://github.com/williamboman/mason.nvim", - "https://github.com/williamboman/mason-lspconfig.nvim", "https://github.com/neovim/nvim-lspconfig", "https://github.com/hrsh7th/nvim-cmp", "https://github.com/hrsh7th/cmp-nvim-lsp", @@ -127,31 +125,24 @@ return require("lazy").setup({ }, event = "VeryLazy", config = function() - require("mason").setup({ - PATH = "append", -- Prefer system installed language servers - }) - require("mason-lspconfig").setup({ - ensure_installed = { - -- :help lspconfig-all - "gopls", - "lua_ls", - "pyright", - "rust_analyzer", - "terraformls", - "tsserver", - }, - handlers = { - require("lsp-zero").default_setup, - }, + local lsp_zero = require("lsp-zero") + local cmp = require("cmp") + local cmp_action = lsp_zero.cmp_action() + + lsp_zero.setup_servers({ + -- Requires language servers to be already installed + -- :help lspconfig-all + "gopls", + "lua_ls", + "pyright", + "rust_analyzer", + "terraformls", + "tsserver", }) - -- HACK Manually start LSP server after lazy load - -- TODO use lazy.nvim LazyFile when available + -- HACK manually start LSP server after lazy load vim.cmd("filetype detect") - local cmp = require("cmp") - local cmp_action = require("lsp-zero").cmp_action() - cmp.setup({ sources = { { name = "nvim_lsp" }, @@ -165,7 +156,7 @@ return require("lazy").setup({ }), }) - require("lsp-zero").on_attach(function(client, bufnr) + lsp_zero.on_attach(function(client, bufnr) local opts = { buffer = bufnr } -- TODO clean up? vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)