From 77ea888a7732a6fc600468c4680f5515c481ba11 Mon Sep 17 00:00:00 2001 From: ziro Date: Sun, 3 Jul 2022 17:36:04 +0700 Subject: [PATCH] + DDC behaviour --- .config/vim/vim_plug | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.config/vim/vim_plug b/.config/vim/vim_plug index 3ccb080..184f77d 100644 --- a/.config/vim/vim_plug +++ b/.config/vim/vim_plug @@ -312,6 +312,10 @@ let g:ale_linters = { lua <'] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [''] = cmp.mapping(function(fallback) + if cmp.visible() and not cmp.confirm() then + cmp.abort() + else + fallback() + end + end, {"i", "s"}), [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() - elseif vim.fn["vsnip#available"](1) == 1 then - feedkey("(vsnip-expand-or-jump)", "") elseif has_words_before() then cmp.complete() else @@ -348,8 +356,6 @@ lua <"] = cmp.mapping(function() if cmp.visible() then cmp.select_prev_item() - elseif vim.fn["vsnip#jumpable"](-1) == 1 then - feedkey("(vsnip-jump-prev)", "") end end, { "i", "s" }), }),