Added lazy lsp loading

This commit is contained in:
Bryan Ramos 2023-04-21 18:33:58 -04:00
parent 0551732884
commit f656be8083
2 changed files with 13 additions and 21 deletions

View file

@ -38,34 +38,23 @@
}
-- Load LSP's
local nvim_lsp = require('lspconfig')
local function on_attach(client, bufnr)
client.server_capabilities.document_formatting = false
require('lsp_signature').on_attach()
end
-- Add / Remove LSP's HERE
local servers = {
require('lazy-lsp').setup {
default_config = {
on_attach = on_attach,
},
configs = {
tsserver = { cmd = { "tsserver", "--stdio" } },
pyright = { cmd = { "pyright-langserver", "--stdio" } },
lua_ls = { cmd = { "lua-language-server" } },
rnix = { cmd = { "rnix-lsp" } },
--[[ TODO: Fix these by adding a server_configurations.md
vscode_html = { cmd = { "vscode-html-language-server", "--stdio" } },
vscode_css = { cmd = { "vscode-css-language-server", "--stdio" } },
vscode_markdown = { cmd = { "vscode-markdown-language-server", "--stdio" } },
vscode_json = { cmd = { "vscode-json-language-server", "--stdio" } },
vscode_eslint = { cmd = { "vscode-eslint-language-server", "--stdio" } }, ]]--
},
}
for lsp, config in pairs(servers) do
nvim_lsp[lsp].setup {
cmd = config.cmd,
on_attach = on_attach,
}
end
-- TODO: This is supposed to change the opacity for the LSP in-line error messages but it is not.
vim.cmd('highlight! link LspDiagnosticsVirtualTextError LspDiagnosticsVirtualTextErrorTransparent')

View file

@ -94,6 +94,9 @@ return packer.startup(function(use)
-- LSP Config
use 'neovim/nvim-lspconfig'
use 'kabouzeid/nvim-lspinstall'
use { 'dundalek/lazy-lsp.nvim',
requires = { 'neovim/nvim-lspconfig' }
}
use {'hrsh7th/nvim-compe',
config = function()