You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
1.6 KiB
72 lines
1.6 KiB
--INFO: Setup various LSP servers, and completion engines
|
|
--TODO: use nvim-lsp-installer?
|
|
local cmp = require('cmp')
|
|
|
|
cmp.setup({
|
|
snippet = {
|
|
expand = function(args)
|
|
vim.fn['vsnip#anonymous'](args.body)
|
|
end
|
|
},
|
|
mapping = {
|
|
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
|
|
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
|
['<Tab>'] = function(fallback)
|
|
if cmp.visible() then
|
|
cmp.select_next_item()
|
|
else
|
|
fallback()
|
|
end
|
|
end
|
|
},
|
|
sources = cmp.config.sources({
|
|
{ name = 'nvim_lsp' },
|
|
{ name = 'nvim_lua' },
|
|
{ name = 'vsnip' },
|
|
{ name = 'buffer' }
|
|
})
|
|
})
|
|
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
|
|
|
require('lspconfig').clangd.setup({
|
|
capabilities = capabilities
|
|
})
|
|
|
|
require('lspconfig').denols.setup({
|
|
cmd = {'deno', 'lsp'},
|
|
capabilities = capabilities
|
|
})
|
|
|
|
require('lspconfig').vls.setup({
|
|
cmd = {'/usr/local/bin/vls'},
|
|
capabilities = capabilities
|
|
})
|
|
|
|
--TODO: clean this up
|
|
local runtime_path = vim.split(package.path, ';')
|
|
table.insert(runtime_path, "lua/?.lua")
|
|
table.insert(runtime_path, "lua/?/init.lua")
|
|
local sumneko_root_path = '/home/ruthenic/lua-language-server/bin/Linux/'
|
|
require('lspconfig').sumneko_lua.setup({
|
|
cmd = {sumneko_root_path .. "lua-language-server", "-E", sumneko_root_path .. "main.lua"},
|
|
settings = {
|
|
Lua = {
|
|
runtime = {
|
|
version = 'LuaJIT',
|
|
path = runtime_path,
|
|
},
|
|
diagnostics = {
|
|
globals = {'vim', 'use'},
|
|
},
|
|
workspace = {
|
|
library = vim.api.nvim_get_runtime_file("", true),
|
|
},
|
|
telemetry = {
|
|
enable = false,
|
|
},
|
|
},
|
|
},
|
|
capabilities = capabilities
|
|
})
|
|
|