update lspconfig

This commit is contained in:
newbie 2023-12-19 07:16:27 +08:00
parent d6950258d7
commit 317c612f41

View File

@ -179,9 +179,10 @@ return {
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'buffer' }, { name = 'buffer' },
{ name = 'path' }, { name = 'path' },
{ name = 'cmdline' }, -- { name = 'cmdline' },
}), }),
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
["<CR>"] = cmp.mapping({ ["<CR>"] = cmp.mapping({
i = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }), i = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
c = function(fallback) c = function(fallback)
@ -268,7 +269,7 @@ return {
-- }) -- })
}, },
} }
cmp.setup.cmdline('/', { cmp.setup.cmdline({ '/', '?' }, {
view = { view = {
entries = { name = 'wildmenu', separator = '|' } entries = { name = 'wildmenu', separator = '|' }
}, },
@ -289,6 +290,38 @@ return {
end end
end, { "i", "s" }), end, { "i", "s" }),
["<n-p>"] = cmp.mapping(function()
if cmp.visible() then
cmp.select_prev_item()
elseif vim.fn["vsnip#jumpable"](-1) == 1 then
feedkey("<Plug>(vsnip-jump-prev)", "")
end
end, { "i", "s" }),
}),
})
cmp.setup.cmdline(':', {
view = {
entries = { name = 'wildmenu', separator = '|' }
},
sources = cmp.config.sources({
{ name = 'buffer' },
}),
mapping = cmp.mapping.preset.insert({
['<CR>'] = cmp.mapping.confirm({ select = false }),
["<c-n>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif vim.fn["vsnip#available"](1) == 1 then
feedkey("<Plug>(vsnip-expand-or-jump)", "")
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<n-p>"] = cmp.mapping(function() ["<n-p>"] = cmp.mapping(function()
if cmp.visible() then if cmp.visible() then
cmp.select_prev_item() cmp.select_prev_item()