feat: add conditional support for Neocodeium plugin based on config
This commit is contained in:
+25
-14
@@ -6,33 +6,44 @@
|
|||||||
local data = require("data")
|
local data = require("data")
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{ --
|
{ -- Neocodeium
|
||||||
-- Neocodeium
|
|
||||||
"monkoose/neocodeium",
|
"monkoose/neocodeium",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = data.types.neocodeium.opts,
|
opts = data.types.neocodeium.opts,
|
||||||
keys = data.keys.neocodeium,
|
keys = data.keys.neocodeium,
|
||||||
|
enabled = data.cond.neocodeium,
|
||||||
|
},
|
||||||
|
{ -- Codeium
|
||||||
|
import = "lazyvim.plugins.extras.coding.codeium",
|
||||||
|
cond = data.cond.codeium,
|
||||||
},
|
},
|
||||||
{ -- Copilot
|
{ -- Copilot
|
||||||
import = "lazyvim.plugins.extras.coding.copilot",
|
import = "lazyvim.plugins.extras.coding.copilot",
|
||||||
cond = function()
|
cond = data.cond.copilot,
|
||||||
return vim.g.aitool == "copilot"
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{ -- Tabnine
|
{ -- Tabnine
|
||||||
import = "lazyvim.plugins.extras.coding.tabnine",
|
import = "lazyvim.plugins.extras.coding.tabnine",
|
||||||
cond = function()
|
cond = data.cond.tabnine,
|
||||||
return vim.g.aitool == "tabnine"
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{ -- Minuet-AI
|
{ -- Minuet-AI
|
||||||
"milanglacier/minuet-ai.nvim",
|
"milanglacier/minuet-ai.nvim",
|
||||||
dependencies = data.deps.minuet,
|
dependencies = data.deps.minuet,
|
||||||
config = function()
|
opts = { provider = "openai" },
|
||||||
require("minuet").setup({ provider = "openai" })
|
enabled = data.cond.minuet,
|
||||||
end,
|
},
|
||||||
cond = function()
|
-- {
|
||||||
return vim.g.aitool == "minuet"
|
-- "jackMort/ChatGPT.nvim",
|
||||||
end,
|
-- event = "VeryLazy",
|
||||||
|
-- opts = {},
|
||||||
|
-- dependencies = {
|
||||||
|
-- "MunifTanjim/nui.nvim",
|
||||||
|
-- "nvim-lua/plenary.nvim",
|
||||||
|
-- "folke/trouble.nvim",
|
||||||
|
-- "nvim-telescope/telescope.nvim",
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
{
|
||||||
|
"robitx/gp.nvim",
|
||||||
|
opts = {},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
+30
-9
@@ -4,27 +4,48 @@
|
|||||||
-- │ Auto Completion │
|
-- │ Auto Completion │
|
||||||
-- ╰─────────────────────────────────────────────────────────╯
|
-- ╰─────────────────────────────────────────────────────────╯
|
||||||
local data = require("data")
|
local data = require("data")
|
||||||
|
local perf = vim.g.cmp_performance_enabled or false
|
||||||
|
|
||||||
return { --
|
--- Function to return the cmp provider
|
||||||
"hrsh7th/nvim-cmp",
|
---@param performance? boolean Whether to use the experimental cmp performance fork
|
||||||
-- HACK: Experiemental cmp performance fork
|
---@return table provider The cmp provider spec
|
||||||
|
local function cmp_provider(performance)
|
||||||
|
if performance then
|
||||||
|
return {
|
||||||
|
url = "yioneko/nvim-cmp",
|
||||||
|
-- Experiemental cmp performance fork
|
||||||
dev = true,
|
dev = true,
|
||||||
|
build = "git clone https://github.com/yioneko/nvim-cmp.git ~/projects/nvim-cmp/",
|
||||||
|
}
|
||||||
|
end
|
||||||
|
return {
|
||||||
|
-- Classic cmp
|
||||||
|
url = "hrsh7th/nvim-cmp",
|
||||||
|
dev = false,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return { -- cmp
|
||||||
|
cmp_provider(perf).url,
|
||||||
|
build = cmp_provider(perf).build,
|
||||||
|
dev = cmp_provider(perf).dev,
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
dependencies = data.deps.cmp,
|
dependencies = data.deps.cmp,
|
||||||
-- :
|
|
||||||
config = function()
|
config = function()
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
local luasnip = require("luasnip")
|
local luasnip = require("luasnip")
|
||||||
local neocodeium = require("neocodeium")
|
|
||||||
local commands = require("neocodeium.commands")
|
|
||||||
|
|
||||||
cmp.event:on("menu_opened", function()
|
cmp.event:on("menu_opened", function()
|
||||||
neocodeium.clear()
|
if data.cond.neocodeium() == true then
|
||||||
|
require("neocodeium").clear()
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
cmp.event:on("menu_closed", function()
|
cmp.event:on("menu_closed", function()
|
||||||
commands.enable()
|
if data.cond.neocodeium() == true then
|
||||||
neocodeium.cycle_or_complete()
|
require("neocodeium.commands").enable()
|
||||||
|
require("neocodeium").cycle_or_complete()
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local border_opts = {
|
local border_opts = {
|
||||||
|
|||||||
Reference in New Issue
Block a user