Updated blink cmp

This commit is contained in:
2025-05-01 23:12:42 +02:00
parent 3cb6239f82
commit afea5116cc
2 changed files with 26 additions and 5 deletions

View File

@@ -4,6 +4,7 @@ return {
"rafamadriz/friendly-snippets", "rafamadriz/friendly-snippets",
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",
"Kaiser-Yang/blink-cmp-avante", "Kaiser-Yang/blink-cmp-avante",
"fang2hou/blink-copilot",
}, },
-- enabled = false, -- enabled = false,
version = "*", version = "*",
@@ -13,6 +14,12 @@ return {
use_nvim_cmp_as_default = true, use_nvim_cmp_as_default = true,
nerd_font_variant = "mono", nerd_font_variant = "mono",
}, },
signature = {
enabled = true,
window = {
show_documentation = false,
},
},
keymap = { keymap = {
preset = "default", preset = "default",
@@ -20,7 +27,7 @@ return {
["<C-e>"] = {}, ["<C-e>"] = {},
["<C-c>"] = { "show", "show_documentation", "hide_documentation" }, ["<C-c>"] = { "show", "show_documentation", "hide_documentation" },
["<NL>"] = { "select_and_accept" }, ["<CR>"] = { "select_and_accept", "fallback" },
["<Up>"] = { "select_prev", "fallback" }, ["<Up>"] = { "select_prev", "fallback" },
["<Down>"] = { "select_next", "fallback" }, ["<Down>"] = { "select_next", "fallback" },
@@ -55,8 +62,14 @@ return {
require("luasnip").jump(direction) require("luasnip").jump(direction)
end, end,
}, },
cmdline = {
completion = { menu = { auto_show = true } },
keymap = {
["<NL>"] = { "select_and_accept" },
},
},
sources = { sources = {
default = { "avante", "lsp", "snippets", "buffer", "path" }, default = { "avante", "lsp", "snippets", "copilot", "buffer", "path" },
providers = { providers = {
avante = { avante = {
module = "blink-cmp-avante", module = "blink-cmp-avante",
@@ -75,16 +88,22 @@ return {
module = "blink.cmp.sources.snippets", module = "blink.cmp.sources.snippets",
score_offset = 80, score_offset = 80,
}, },
copilot = {
name = "copilot",
module = "blink-copilot",
score_offset = 70,
async = true,
},
buffer = { buffer = {
name = "Buffer", name = "Buffer",
enabled = true, enabled = true,
module = "blink.cmp.sources.buffer", module = "blink.cmp.sources.buffer",
score_offset = 70, score_offset = 60,
}, },
path = { path = {
name = "Path", name = "Path",
module = "blink.cmp.sources.path", module = "blink.cmp.sources.path",
score_offset = 3, score_offset = 10,
opts = { opts = {
trailing_slash = false, trailing_slash = false,
label_trailing_slash = true, label_trailing_slash = true,

View File

@@ -3,15 +3,16 @@ return {
"zbirenbaum/copilot.lua", "zbirenbaum/copilot.lua",
cmd = "Copilot", cmd = "Copilot",
event = "InsertEnter", event = "InsertEnter",
dependencies = "AndreM222/copilot-lualine",
config = function() config = function()
require("copilot").setup({ require("copilot").setup({
panel = { panel = {
enabled = false,
keymap = { keymap = {
open = "<M-c>", open = "<M-c>",
}, },
}, },
suggestion = { suggestion = {
enabled = false,
auto_trigger = true, auto_trigger = true,
keymap = { keymap = {
accept = "<M-CR>", accept = "<M-CR>",
@@ -22,6 +23,7 @@ return {
javascript = true, javascript = true,
python = true, python = true,
markdown = true, markdown = true,
help = true,
json = true, json = true,
sh = function() sh = function()
if string.match(vim.fs.basename(vim.api.nvim_buf_get_name(0)), "^%.env.*") then if string.match(vim.fs.basename(vim.api.nvim_buf_get_name(0)), "^%.env.*") then