config.nvim/lua/plugins/lspinstall.lua

16 lines
495 B
Lua
Raw Normal View History

2021-09-07 23:26:21 +08:00
local function setup_servers()
2021-09-08 19:57:41 +08:00
require'lspinstall'.setup()
local servers = require'lspinstall'.installed_servers()
for _, server in pairs(servers) do
require'lspconfig'[server].setup{}
end
2021-09-07 23:26:21 +08:00
end
2021-09-08 19:57:41 +08:00
setup_servers()
2021-09-07 23:26:21 +08:00
-- Automatically reload after `:LspInstall <server>` so we don't have to restart neovim
2021-09-08 19:57:41 +08:00
require'lspinstall'.post_install_hook = function ()
setup_servers() -- reload installed servers
vim.cmd("bufdo e") -- this triggers the FileType autocmd that starts the server
2021-09-07 23:26:21 +08:00
end