feat(cmp): added <s-CR> to confirm completion with replace

This commit is contained in:
Folke Lemaitre 2023-03-03 08:21:29 +01:00
parent 3c0f28331b
commit 3a52307505
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -58,6 +58,10 @@ return {
["<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.
["<S-CR>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },