From a77cccf2c99bd3b22d6c42a60481064592f3d70f Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 28 Sep 2021 00:07:38 +0100 Subject: [PATCH] chore(nvim): update lspinstall config --- nvim/.config/nvim/lua/opdavies/init.lua | 35 +++++++++++++------------ 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/nvim/.config/nvim/lua/opdavies/init.lua b/nvim/.config/nvim/lua/opdavies/init.lua index 17c4f0d..189dca3 100644 --- a/nvim/.config/nvim/lua/opdavies/init.lua +++ b/nvim/.config/nvim/lua/opdavies/init.lua @@ -15,28 +15,29 @@ configs.setup { } -- LSP +local function setup_servers() + require'lspinstall'.setup() + local servers = require'lspinstall'.installed_servers() + for _, server in pairs(servers) do + require'lspconfig'[server].setup{} + end +end -local lspconfig = require'lspconfig' ---local completion = require'completion' +setup_servers() ---local function custom_on_attach(client) - --print('Attaching to ' .. client.name) - --completion.on_attach(client) ---end +-- Automatically reload after `:LspInstall ` so we don't have to restart neovim +require'lspinstall'.post_install_hook = function () + setup_servers() + vim.cmd("bufdo e") +end ---local default_config = { - --on_attach = custom_on_attach, +--lspconfig.intelephense.setup{ + --filetypes = { "install", "inc", "module", "php", "test", "theme" }, --} -lspconfig.intelephense.setup{ - filetypes = { "install", "inc", "module", "php", "test", "theme" }, -} - -lspconfig.tsserver.setup{ - filetypes = { "js", "jsx", "vue" }, -} - -require'lspconfig'.vuels.setup{} +--lspconfig.tsserver.setup{ + --filetypes = { "js", "jsx", "ts", "vue" }, +--} vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( vim.lsp.diagnostic.on_publish_diagnostics, {