From 6bd3c20f7d2df141934b53de7c3c25d4e4b76387 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Sun, 17 Oct 2021 12:49:55 +0200 Subject: [PATCH] [nvim] feat: auto install lsp servers python, lua, bash, tex --- .config/nvim/lua/plugin/lsp_installer.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.config/nvim/lua/plugin/lsp_installer.lua b/.config/nvim/lua/plugin/lsp_installer.lua index fa6fc46..70e929f 100644 --- a/.config/nvim/lua/plugin/lsp_installer.lua +++ b/.config/nvim/lua/plugin/lsp_installer.lua @@ -15,6 +15,24 @@ lsp_installer.settings { } } +local servers = { + "bashls", + "jedi_language_server", + "texlab", + "sumneko_lua", +} + +for _, name in pairs(servers) do + local ok, server = lsp_installer.get_server(name) + -- Check that the server is supported in nvim-lsp-installer + if ok then + if not server:is_installed() then + print("Installing " .. name) + server:install() + end + end +end + lsp_installer.on_server_ready(function(server) local opts = {}