mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-28 11:30:06 +02:00
plugins/nvim-cmp: fix example for mappings option
This commit is contained in:
parent
813702c5e2
commit
0f1c0bda6d
1 changed files with 10 additions and 16 deletions
|
@ -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 })";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue