mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-21 16:39:06 +02:00
parent
8f113a514c
commit
89314cb2aa
1 changed files with 20 additions and 17 deletions
|
@ -80,10 +80,6 @@ return {
|
||||||
keymap = {
|
keymap = {
|
||||||
preset = "enter",
|
preset = "enter",
|
||||||
["<C-y>"] = { "select_and_accept" },
|
["<C-y>"] = { "select_and_accept" },
|
||||||
["<Tab>"] = {
|
|
||||||
LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
|
|
||||||
"fallback",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
---@param opts blink.cmp.Config | { sources: { compat: string[] } }
|
---@param opts blink.cmp.Config | { sources: { compat: string[] } }
|
||||||
|
@ -101,8 +97,9 @@ return {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- fix super-tab completion
|
-- add ai_accept to <Tab> key
|
||||||
if opts.keymap.preset == "super-tab" then
|
if not opts.keymap["<Tab>"] then
|
||||||
|
if opts.keymap.preset == "super-tab" then -- super-tab
|
||||||
opts.keymap["<Tab>"] = {
|
opts.keymap["<Tab>"] = {
|
||||||
function(cmp)
|
function(cmp)
|
||||||
if cmp.snippet_active() then
|
if cmp.snippet_active() then
|
||||||
|
@ -114,6 +111,12 @@ return {
|
||||||
LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
|
LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
|
||||||
"fallback",
|
"fallback",
|
||||||
}
|
}
|
||||||
|
else -- other presets
|
||||||
|
opts.keymap["<Tab>"] = {
|
||||||
|
LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
|
||||||
|
"fallback",
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- NOTE: compat with latest version. Currenlty 0.7.6
|
--- NOTE: compat with latest version. Currenlty 0.7.6
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue