From afea5116cc068b39244aa839e5e21965c1295bd7 Mon Sep 17 00:00:00 2001 From: Taken Date: Thu, 1 May 2025 23:12:42 +0200 Subject: [PATCH] Updated blink cmp --- lua/taken/plugins/blink.lua | 27 +++++++++++++++++++++++---- lua/taken/plugins/copilot.lua | 4 +++- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/lua/taken/plugins/blink.lua b/lua/taken/plugins/blink.lua index 13fc4c5..af481f7 100644 --- a/lua/taken/plugins/blink.lua +++ b/lua/taken/plugins/blink.lua @@ -4,6 +4,7 @@ return { "rafamadriz/friendly-snippets", "L3MON4D3/LuaSnip", "Kaiser-Yang/blink-cmp-avante", + "fang2hou/blink-copilot", }, -- enabled = false, version = "*", @@ -13,6 +14,12 @@ return { use_nvim_cmp_as_default = true, nerd_font_variant = "mono", }, + signature = { + enabled = true, + window = { + show_documentation = false, + }, + }, keymap = { preset = "default", @@ -20,7 +27,7 @@ return { [""] = {}, [""] = { "show", "show_documentation", "hide_documentation" }, - [""] = { "select_and_accept" }, + [""] = { "select_and_accept", "fallback" }, [""] = { "select_prev", "fallback" }, [""] = { "select_next", "fallback" }, @@ -55,8 +62,14 @@ return { require("luasnip").jump(direction) end, }, + cmdline = { + completion = { menu = { auto_show = true } }, + keymap = { + [""] = { "select_and_accept" }, + }, + }, sources = { - default = { "avante", "lsp", "snippets", "buffer", "path" }, + default = { "avante", "lsp", "snippets", "copilot", "buffer", "path" }, providers = { avante = { module = "blink-cmp-avante", @@ -75,16 +88,22 @@ return { module = "blink.cmp.sources.snippets", score_offset = 80, }, + copilot = { + name = "copilot", + module = "blink-copilot", + score_offset = 70, + async = true, + }, buffer = { name = "Buffer", enabled = true, module = "blink.cmp.sources.buffer", - score_offset = 70, + score_offset = 60, }, path = { name = "Path", module = "blink.cmp.sources.path", - score_offset = 3, + score_offset = 10, opts = { trailing_slash = false, label_trailing_slash = true, diff --git a/lua/taken/plugins/copilot.lua b/lua/taken/plugins/copilot.lua index 943e4f2..54578d0 100644 --- a/lua/taken/plugins/copilot.lua +++ b/lua/taken/plugins/copilot.lua @@ -3,15 +3,16 @@ return { "zbirenbaum/copilot.lua", cmd = "Copilot", event = "InsertEnter", - dependencies = "AndreM222/copilot-lualine", config = function() require("copilot").setup({ panel = { + enabled = false, keymap = { open = "", }, }, suggestion = { + enabled = false, auto_trigger = true, keymap = { accept = "", @@ -22,6 +23,7 @@ return { javascript = true, python = true, markdown = true, + help = true, json = true, sh = function() if string.match(vim.fs.basename(vim.api.nvim_buf_get_name(0)), "^%.env.*") then