fix: lazy loading

This commit is contained in:
2026-04-25 23:02:56 +02:00
parent 26e9593aab
commit 3cbfe566e4
5 changed files with 51 additions and 95 deletions
@@ -1,72 +0,0 @@
require("lz.n").load({
{
"copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
after = function()
require("copilot").setup({
-- Disable inline suggestions, let CodeCompanion (or blink) handle interactions
suggestion = { enabled = false },
panel = { enabled = false },
})
end,
},
{
"codecompanion.nvim",
cmd = { "CodeCompanion", "CodeCompanionChat", "CodeCompanionActions" },
keys = {
{ "<leader>aa", "<cmd>CodeCompanionChat Toggle<cr>", mode = { "n", "v" }, desc = "[A]I [A]ssistant" },
{ "<leader>ac", "<cmd>CodeCompanionActions<cr>", mode = { "n", "v" }, desc = "[A]I [C]ode Actions" },
},
after = function()
require("codecompanion").setup({
-- Set Gemini as the default strategy
strategies = {
chat = {
adapter = "gemini",
},
inline = {
adapter = "gemini",
},
},
-- Configure all available adapters
adapters = {
copilot = function()
return require("codecompanion.adapters").extend("copilot", {
schema = {
model = {
default = "claude-3.5-sonnet", -- Good default for Copilot chat
},
},
})
end,
gemini = function()
return require("codecompanion.adapters").extend("gemini", {
env = {
api_key = "GEMINI_API_KEY",
},
schema = {
model = {
default = "gemini-3.1-pro-preview",
},
},
})
end,
gemini_cli = function()
return require("codecompanion.adapters").extend("gemini_cli", {
-- Pass the model as a CLI argument
args = {
"--model",
"gemini-3.1-pro-preview",
},
-- Set authentication to use standard Google Login
env = {
auth_method = "oauth-personal",
},
})
end,
},
})
end,
},
})
@@ -4,6 +4,7 @@ require("lz.n").load({
},
{
"luasnip",
event = { "InsertEnter", "CmdlineEnter" },
before = function()
require("lz.n").trigger_load("friendly-snippets")
end,
@@ -15,6 +16,7 @@ require("lz.n").load({
},
{
"colorful-menu.nvim",
event = { "InsertEnter", "CmdlineEnter" },
after = function()
require("colorful-menu").setup({})
end,
@@ -101,4 +103,3 @@ require("lz.n").load({
end,
},
})
@@ -1 +0,0 @@
require("lz.n").load({})