From a2bc422315b644cf82c1c38e69363535a41239c7 Mon Sep 17 00:00:00 2001 From: rootiest Date: Sun, 24 Nov 2024 20:20:37 -0500 Subject: [PATCH] refactor: streamline blink compatibility integration --- lua/plugins/cmp.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 63e9a77..ad1c716 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -32,10 +32,6 @@ if vim.g.useblinkcmp then { -- Blink completion import = 'lazyvim.plugins.extras.coding.blink', }, - { -- Blink compat - 'saghen/blink.compat', - opts = {}, - }, { 'saghen/blink.cmp', opts = { @@ -45,16 +41,7 @@ if vim.g.useblinkcmp then [''] = { 'hide', 'fallback' }, [''] = { - function(cmp) - if cmp.is_in_snippet() then - -- If the completion is in a snippet, accept it - return cmp.accept() - else - -- If the completion is not in a snippet, select the next one - return cmp.select_next() - end - end, - 'snippet_forward', + LazyVim.cmp.map({ 'snippet_forward', 'ai_accept' }), 'fallback', }, [''] = { 'snippet_backward', 'fallback' }, @@ -72,6 +59,19 @@ if vim.g.useblinkcmp then }, }, }, + { -- Blink compat + 'saghen/blink.compat', + optional = true, -- make optional so it's only enabled if any extras need it + opts = {}, + version = not vim.g.lazyvim_blink_main and '*', + }, + { -- Catppuccin integration + 'catppuccin', + optional = true, + opts = { + integrations = { blink_cmp = true }, + }, + }, } end