51 lines
1.4 KiB
Lua
51 lines
1.4 KiB
Lua
local lsp = require('lspconfig')
|
|
|
|
-- Use an on_attach function to configure after LSP attaches to buffer
|
|
local on_attach = function(client, bufnr)
|
|
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
|
|
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
|
end
|
|
|
|
-- Establish a set of capabilities so we can advertise nvim-cmp support.
|
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
|
|
-- Add nvim-cmp support to the capabilities.
|
|
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
|
|
|
|
-- zls = zig language server
|
|
lsp.zls.setup {
|
|
on_attach = on_attach,
|
|
flags = {
|
|
debounce_text_changes = 150
|
|
},
|
|
capabilities = capabilities
|
|
}
|
|
|
|
-- lua-language-server
|
|
lsp.sumneko_lua.setup {
|
|
settings = {
|
|
Lua = {
|
|
runtime = {
|
|
-- Tell the language server which version of Lua you're using (most
|
|
-- likely LuaJIT in the case of Neovim)
|
|
version = 'LuaJIT',
|
|
},
|
|
diagnostics = {
|
|
-- Get the language server to recognize the `vim` global
|
|
globals = {'vim'},
|
|
},
|
|
workspace = {
|
|
-- Make the server aware of Neovim runtime files
|
|
library = vim.api.nvim_get_runtime_file("", true),
|
|
},
|
|
-- Do not send telemetry data containing a randomized but unique
|
|
-- identifier
|
|
telemetry = {
|
|
enable = false,
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
-- texlab = latex language server
|
|
lsp.texlab.setup{}
|