mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-11 09:54:34 +02:00
refactor: still not ideal...
This commit is contained in:
parent
b2e012cb83
commit
0270a39a7b
6 changed files with 89 additions and 59 deletions
|
@ -38,7 +38,7 @@ return {
|
|||
auto_show = true,
|
||||
},
|
||||
ghost_text = {
|
||||
enabled = true,
|
||||
enabled = vim.g.ai_cmp,
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -59,6 +59,13 @@ return {
|
|||
|
||||
keymap = {
|
||||
preset = "enter",
|
||||
["<tab>"] = {
|
||||
"snippet_forward",
|
||||
function()
|
||||
return LazyVim.cmp.ai_accept()
|
||||
end,
|
||||
"fallback",
|
||||
},
|
||||
},
|
||||
},
|
||||
---@param opts blink.cmp.Config
|
||||
|
|
|
@ -12,34 +12,34 @@ return {
|
|||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-cmp",
|
||||
dependencies = {
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
},
|
||||
opts = function(_, opts)
|
||||
opts.snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
}
|
||||
table.insert(opts.sources, { name = "luasnip" })
|
||||
end,
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
history = true,
|
||||
delete_check_events = "TextChanged",
|
||||
},
|
||||
},
|
||||
|
||||
-- nvim-cmp integration
|
||||
{
|
||||
"nvim-cmp",
|
||||
optional = true,
|
||||
dependencies = { "saadparwaiz1/cmp_luasnip" },
|
||||
opts = function(_, opts)
|
||||
opts.snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
}
|
||||
table.insert(opts.sources, { name = "luasnip" })
|
||||
end,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{
|
||||
"<tab>",
|
||||
function()
|
||||
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
|
||||
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next"
|
||||
or LazyVim.cmp.ai_accept()
|
||||
or "<tab>"
|
||||
end,
|
||||
expr = true, silent = true, mode = "i",
|
||||
},
|
||||
|
@ -51,4 +51,6 @@ return {
|
|||
"garymjr/nvim-snippets",
|
||||
enabled = false,
|
||||
},
|
||||
|
||||
-- TODO: blink.cmp integration
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue