Skip to content

Commit

Permalink
plugins/nvim-cmp: fix example for mappings option
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage committed Jan 8, 2024
1 parent 813702c commit 0f1c0bd
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions plugins/completion/nvim-cmp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 })";
};
};

Expand Down

0 comments on commit 0f1c0bd

Please sign in to comment.