@@ -28,18 +28,13 @@ cmp.setup({
28
28
formatting = {
29
29
format = lspkind .cmp_format ({ preset = " codicons" }),
30
30
},
31
- mapping = {
32
- [" <C-b>" ] = cmp .mapping (cmp .mapping .scroll_docs (- 4 ), { " i" , " c" }),
33
- [" <C-f>" ] = cmp .mapping (cmp .mapping .scroll_docs (4 ), { " i" , " c" }),
34
- [" <C-Space>" ] = cmp .mapping (cmp .mapping .complete (), { " i" , " c" }),
35
- [" <C-y>" ] = cmp .config .disable , -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
36
- [" <C-e>" ] = cmp .mapping ({
37
- i = cmp .mapping .abort (),
38
- c = cmp .mapping .close (),
39
- }),
31
+ mapping = cmp .mapping .preset .insert ({
32
+ [" <C-b>" ] = cmp .mapping .scroll_docs (- 4 ),
33
+ [" <C-f>" ] = cmp .mapping .scroll_docs (4 ),
34
+ [" <C-Space>" ] = cmp .mapping .complete (),
35
+ [" <C-y>" ] = cmp .config .disable ,
40
36
[" <CR>" ] = cmp .mapping .confirm ({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
41
-
42
- [" <Tab>" ] = cmp .mapping (function (fallback )
37
+ [" <Tab>" ] = function (fallback )
43
38
if cmp .visible () then
44
39
cmp .select_next_item ()
45
40
elseif luasnip .expandable () then
@@ -51,18 +46,17 @@ cmp.setup({
51
46
else
52
47
fallback ()
53
48
end
54
- end , { " i" , " s" }),
55
-
56
- [" <S-Tab>" ] = cmp .mapping (function (fallback )
49
+ end ,
50
+ [" <S-Tab>" ] = function (fallback )
57
51
if cmp .visible () then
58
52
cmp .select_prev_item ()
59
53
elseif luasnip .jumpable (- 1 ) then
60
54
luasnip .jump (- 1 )
61
55
else
62
56
fallback ()
63
57
end
64
- end , { " i " , " s " }),
65
- },
58
+ end
59
+ }) ,
66
60
sources = {
67
61
{ name = " nvim_lsp" },
68
62
{ name = " nvim_lua" },
0 commit comments