diff --git a/lua/my_lspinstall.lua b/lua/my_lspinstall.lua index 0647ab8..5f70ec4 100644 --- a/lua/my_lspinstall.lua +++ b/lua/my_lspinstall.lua @@ -77,6 +77,27 @@ local on_attach = function(client, bufnr) end local lsp_installer = require("nvim-lsp-installer") + +local servers = { + "pyright", + "cmake", + "clangd", + "jsonls", + "groovyls", + "sumneko_lua", + "dockerls", +} + +for _, name in pairs(servers) do + local server_is_found, server = lsp_installer.get_server(name) + if server_is_found then + if not server:is_installed() then + print("Installing " .. name) + server:install() + end + end +end + lsp_installer.on_server_ready(function(server) local opts = { on_attach = on_attach,