Fix cmp-mappings after breaking update

main
Steffen Rademacker 2 years ago
parent 80af144c3e
commit 9ac95fc018

@ -9,10 +9,11 @@ cmp.setup({
vim.fn["vsnip#anonymous"](args.body) vim.fn["vsnip#anonymous"](args.body)
end end
}, },
mapping = { mapping = cmp.mapping.preset.insert({
['<cr>'] = cmp.mapping.confirm({ select = true }), ['<cr>'] = cmp.mapping.confirm({ select = true }),
}, }),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ {
name = 'buffer', name = 'buffer',
option = { option = {
@ -21,7 +22,6 @@ cmp.setup({
end end
}, },
}, },
{ name = 'nvim_lsp' },
{ name = 'path' }, { name = 'path' },
{ name = 'vsnip' }, { name = 'vsnip' },
{ name = 'tmux', option = { all_panes = true } }, { name = 'tmux', option = { all_panes = true } },
@ -30,8 +30,8 @@ cmp.setup({
formatting = { formatting = {
format = function(entry, vim_item) format = function(entry, vim_item)
vim_item.menu = ({ vim_item.menu = ({
buffer = "[Buffer]",
nvim_lsp = "[LSP]", nvim_lsp = "[LSP]",
buffer = "[Buffer]",
path = "[Path]", path = "[Path]",
vsnip = "[Snippet]", vsnip = "[Snippet]",
tmux = "[tmux]", tmux = "[tmux]",
@ -43,12 +43,14 @@ cmp.setup({
}) })
cmp.setup.cmdline(':', { cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline({}),
sources = { sources = {
{ name = 'cmdline' } { name = 'cmdline' }
} }
}) })
cmp.setup.cmdline('/', { cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline({}),
sources = { sources = {
{ name = 'buffer' } { name = 'buffer' }
} }

Loading…
Cancel
Save