6bd3c20f7d
python, lua, bash, tex
48 lines
1.1 KiB
Lua
48 lines
1.1 KiB
Lua
-- Author : swytch
|
|
-- Created : Saturday Sept. 11, 2021 22:12:33 CET
|
|
-- License : GPLv3
|
|
-- Description : nvim-lsp-installer plugin config file
|
|
|
|
local lsp_installer = require("nvim-lsp-installer")
|
|
|
|
lsp_installer.settings {
|
|
ui = {
|
|
icons = {
|
|
server_installed = "✓",
|
|
server_pending = "➜",
|
|
server_uninstalled = "✗"
|
|
}
|
|
}
|
|
}
|
|
|
|
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 = {}
|
|
|
|
-- (optional) Customize the options passed to the server
|
|
-- if server.name == "tsserver" then
|
|
-- opts.root_dir = function() ... end
|
|
-- end
|
|
|
|
-- This setup() function is exactly the same as lspconfig's setup function (:help lspconfig-quickstart)
|
|
server:setup(opts)
|
|
vim.cmd [[ do User LspAttachBuffers ]]
|
|
end)
|