diff --git a/neovim/lua/plugins.lua b/neovim/lua/plugins.lua index 8addcfb..20a7047 100644 --- a/neovim/lua/plugins.lua +++ b/neovim/lua/plugins.lua @@ -189,6 +189,12 @@ return require("packer").startup({ -- Configure language servers use("neovim/nvim-lspconfig") + -- Install language servers + use({ + "williamboman/nvim-lsp-installer", + requires = "neovim/nvim-lspconfig", + }) + -- Better display of diagnostics use("folke/trouble.nvim") diff --git a/neovim/lua/plugins/lsp.lua b/neovim/lua/plugins/lsp.lua index f20f9f2..40c87f7 100644 --- a/neovim/lua/plugins/lsp.lua +++ b/neovim/lua/plugins/lsp.lua @@ -207,4 +207,17 @@ function M.config_null_ls() }) end) end + +function M.config_lsp_intaller() + utils.try_require("nvim-lsp-installer", function(lsp_installer) + lsp_installer.on_server_ready(function(server) + server:setup({ + on_attach = default_attach, + }) + end) + end, function() + print("nvim-lsp-installer not installed") + end) +end + return M diff --git a/neovim/plugin/lsp.lua b/neovim/plugin/lsp.lua index 79575a2..48c0ffc 100644 --- a/neovim/plugin/lsp.lua +++ b/neovim/plugin/lsp.lua @@ -3,6 +3,7 @@ local lsp_config = require("plugins.lsp") -- Configure my various lsp stuffs lsp_config.config_null_ls() +lsp_config.config_lsp_intaller() lsp_config.config_lsp() lsp_config.config_lsp_ui()