fix(ai): mappings for accept when ai_cmp=false

This commit is contained in:
Iordanis Petkakis 2024-12-19 12:20:58 +02:00
parent a3a28bf8e4
commit da77adfa60
3 changed files with 10 additions and 12 deletions

View file

@ -11,9 +11,7 @@ return {
virtual_text = {
enabled = not vim.g.ai_cmp,
key_bindings = {
accept = false, -- handled by nvim-cmp / blink.cmp
next = "<M-]>",
prev = "<M-[>",
accept = not vim.g.ai_cmp and "<M-l>" or false, -- handled by nvim-cmp / blink.cmp
},
},
},
@ -39,11 +37,13 @@ return {
optional = true,
dependencies = { "codeium.nvim" },
opts = function(_, opts)
if vim.g.ai_cmp then
table.insert(opts.sources, 1, {
name = "codeium",
group_index = 1,
priority = 100,
})
end
end,
},

View file

@ -11,9 +11,7 @@ return {
enabled = not vim.g.ai_cmp,
auto_trigger = true,
keymap = {
accept = false, -- handled by nvim-cmp / blink.cmp
next = "<M-]>",
prev = "<M-[>",
accept = not vim.g.ai_cmp and "<M-l>" or false, -- handled by nvim-cmp / blink.cmp
},
},
panel = { enabled = false },

View file

@ -8,7 +8,7 @@ return {
},
opts = {
keymaps = {
accept_suggestion = nil, -- handled by nvim-cmp / blink.cmp
accept_suggestion = not vim.g.ai_cmp and "<M-l>" or nil, -- handled by nvim-cmp / blink.cmp
},
disable_inline_completion = vim.g.ai_cmp,
ignore_filetypes = { "bigfile", "snacks_input", "snacks_notif" },