Remove default C-e abort in cmp, and small refactorings

This commit is contained in:
Martin Larsson 2024-04-18 10:39:43 +02:00
parent 6ff0c4c42b
commit 1203083925

View file

@ -24,22 +24,23 @@ return {
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
},
{
{ name = "buffer" },
})
{ name = "nvim_lsp" },
},
{
{ name = "buffer" },
})
})
-- Set configuration for specific filetype.
cmp.setup.filetype("gitcommit", {
sources = cmp.config.sources({
{ name = "git" }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
}, {
sources = cmp.config.sources(
{
{ name = "git" }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
},
{
{ name = "buffer" },
})
})
@ -58,10 +59,9 @@ return {
sources = cmp.config.sources({
{ name = "path" }
}, {
{ name = "cmdline" }
}),
{ name = "cmdline" }
}),
matching = { disallow_symbol_nonprefix_matching = false }
})
end,
}