From 0f1c0bda6dad29b2609cafcea512866b86aa2be5 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 8 Jan 2024 08:30:29 +0100 Subject: [PATCH] plugins/nvim-cmp: fix example for mappings option --- plugins/completion/nvim-cmp/default.nix | 26 ++++++++++--------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/plugins/completion/nvim-cmp/default.nix b/plugins/completion/nvim-cmp/default.nix index 9575b949..d2e58643 100644 --- a/plugins/completion/nvim-cmp/default.nix +++ b/plugins/completion/nvim-cmp/default.nix @@ -82,25 +82,19 @@ in { ) ); example = { - "" = "cmp.mapping.confirm({ select = true })"; + "" = "cmp.mapping.scroll_docs(-4)"; + "" = "cmp.mapping.scroll_docs(4)"; + "" = "cmp.mapping.complete()"; + "" = "cmp.mapping.close()"; "" = { 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()"; }; + "" = { + modes = ["i" "s"]; + action = "cmp.mapping.select_prev_item()"; + }; + "" = "cmp.mapping.confirm({ select = true })"; }; };