From 03fd58499ee115e1e7c3d75a539b66d853f1167f Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Fri, 13 May 2022 04:28:33 -0700 Subject: [PATCH] nvim: lspconfig updates --- .config/nvim/lua/blake/lsp.lua | 35 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/.config/nvim/lua/blake/lsp.lua b/.config/nvim/lua/blake/lsp.lua index ebcc2c6..114a9d8 100644 --- a/.config/nvim/lua/blake/lsp.lua +++ b/.config/nvim/lua/blake/lsp.lua @@ -10,19 +10,7 @@ end -- <<< -- lspinstall >>> M.lspinstall = function() -- - 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 - setup_servers() - -- Automatically reload after `:LspInstall ` so we don't have to restart neovim - require'lspinstall'.post_install_hook = function () - setup_servers() -- reload installed servers - vim.cmd("bufdo e") -- this triggers the FileType autocmd that starts the server - end + require("nvim-lsp-installer").setup() end -- <<< -- treesitter >>> @@ -255,23 +243,24 @@ M.lspconfig = function() -- Use a loop to conveniently call 'setup' on multiple servers and -- map buffer local keybindings when the language server attaches local lsp_servers = { - -- = '', (needs to be in path) - clangd = 'clangd', - html = 'vscode-html-language-server', - bashls = 'bash-language-server', - rust_analyzer = 'rust-analyzer', - dockerls = 'docker-langserver', - yamlls = 'yaml-language-server', + -- 'lsp_name', + 'clangd', + 'bashls', + 'rust_analyzer', + 'dockerls', + 'yamlls', + 'html', + 'cssls', + 'eslint', + 'jsonls', } - for lsp, exe in pairs(lsp_servers) do - if (vim.fn.executable(exe) == 1) then + for _, lsp in pairs(lsp_servers) do nvim_lsp[lsp].setup { on_attach = on_attach, flags = { debounce_text_changes = 150, } } - end end -- <<<