plugins/nvim-cmp: fix example for mappings option

This commit is contained in:
Gaetan Lepage 2024-01-08 08:30:29 +01:00 committed by Gaétan Lepage
parent 813702c5e2
commit 0f1c0bda6d

View file

@ -82,25 +82,19 @@ in {
)
);
example = {
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<C-e>" = "cmp.mapping.close()";
"<Tab>" = {
modes = ["i" "s"];
action = ''
function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expandable() then
luasnip.expand()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif check_backspace() then
fallback()
else
fallback()
end
end
'';
action = "cmp.mapping.select_next_item()";
};
"<S-Tab>" = {
modes = ["i" "s"];
action = "cmp.mapping.select_prev_item()";
};
"<CR>" = "cmp.mapping.confirm({ select = true })";
};
};