mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-24 00:29:43 -04:00
Added lazy lsp loading
This commit is contained in:
parent
0551732884
commit
f656be8083
2 changed files with 13 additions and 21 deletions
|
|
@ -38,34 +38,23 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Load LSP's
|
-- Load LSP's
|
||||||
local nvim_lsp = require('lspconfig')
|
|
||||||
|
|
||||||
local function on_attach(client, bufnr)
|
local function on_attach(client, bufnr)
|
||||||
client.server_capabilities.document_formatting = false
|
client.server_capabilities.document_formatting = false
|
||||||
require('lsp_signature').on_attach()
|
require('lsp_signature').on_attach()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Add / Remove LSP's HERE
|
require('lazy-lsp').setup {
|
||||||
local servers = {
|
default_config = {
|
||||||
tsserver = { cmd = { "tsserver", "--stdio" } },
|
on_attach = on_attach,
|
||||||
pyright = { cmd = { "pyright-langserver", "--stdio" } },
|
},
|
||||||
lua_ls = { cmd = { "lua-language-server" } },
|
configs = {
|
||||||
rnix = { cmd = { "rnix-lsp" } },
|
tsserver = { cmd = { "tsserver", "--stdio" } },
|
||||||
|
pyright = { cmd = { "pyright-langserver", "--stdio" } },
|
||||||
--[[ TODO: Fix these by adding a server_configurations.md
|
lua_ls = { cmd = { "lua-language-server" } },
|
||||||
vscode_html = { cmd = { "vscode-html-language-server", "--stdio" } },
|
rnix = { cmd = { "rnix-lsp" } },
|
||||||
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.
|
-- 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')
|
vim.cmd('highlight! link LspDiagnosticsVirtualTextError LspDiagnosticsVirtualTextErrorTransparent')
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,9 @@ return packer.startup(function(use)
|
||||||
-- LSP Config
|
-- LSP Config
|
||||||
use 'neovim/nvim-lspconfig'
|
use 'neovim/nvim-lspconfig'
|
||||||
use 'kabouzeid/nvim-lspinstall'
|
use 'kabouzeid/nvim-lspinstall'
|
||||||
|
use { 'dundalek/lazy-lsp.nvim',
|
||||||
|
requires = { 'neovim/nvim-lspconfig' }
|
||||||
|
}
|
||||||
|
|
||||||
use {'hrsh7th/nvim-compe',
|
use {'hrsh7th/nvim-compe',
|
||||||
config = function()
|
config = function()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue