mirror of
https://github.com/nix-community/nixvim.git
synced 2026-09-24 15:30:15 -05:00
plugins/nvim-cmp: fix example for mappings option
This commit is contained in:
committed by
Gaétan Lepage
parent
813702c5e2
commit
0f1c0bda6d
@@ -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 })";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user