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