From f73837a4ff81e54c1644ef2cc731a98628e5f748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Sat, 21 Oct 2023 18:04:58 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(nvim):=20cmp=20mappings=20no?= =?UTF-8?q?t=20working?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/nvim/lua/plugins/extras/cmp.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.config/nvim/lua/plugins/extras/cmp.lua b/.config/nvim/lua/plugins/extras/cmp.lua index 6660753e..31cc967a 100644 --- a/.config/nvim/lua/plugins/extras/cmp.lua +++ b/.config/nvim/lua/plugins/extras/cmp.lua @@ -61,6 +61,21 @@ return { opts.mapping = cmp.mapping.preset.insert({ [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = function(fallback) + cmp.abort() + fallback() + end, }) opts.window = { completion = cmp.config.window.bordered(),