refactor: still not ideal...

This commit is contained in:
Folke Lemaitre 2024-11-11 00:49:05 +01:00
parent b2e012cb83
commit 0270a39a7b
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
6 changed files with 89 additions and 59 deletions

View file

@ -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

View file

@ -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
}