fix: lazy loading
This commit is contained in:
@@ -65,45 +65,74 @@ in
|
||||
ruff
|
||||
];
|
||||
|
||||
# 3. Plugins (from startupPlugins & optionalPlugins)
|
||||
# Since you use lz.n in Lua, we just list them all here.
|
||||
# The wrapper will add them to the packpath.
|
||||
# 3. Plugins
|
||||
# Nix provisions plugins; lz.n controls when lazy specs are packadd'd.
|
||||
specs = {
|
||||
# Core lazy-loading plugin
|
||||
lz-n = {
|
||||
data = pkgs.vimPlugins.lz-n;
|
||||
};
|
||||
plenary = {
|
||||
data = pkgs.vimPlugins.plenary-nvim;
|
||||
};
|
||||
|
||||
# All other plugins
|
||||
general = {
|
||||
support = {
|
||||
data = with pkgs.vimPlugins; [
|
||||
plenary-nvim
|
||||
kanagawa-nvim
|
||||
nvim-treesitter.withAllGrammars
|
||||
nvim-treesitter-textobjects
|
||||
trouble-nvim
|
||||
guess-indent-nvim
|
||||
which-key-nvim
|
||||
telescope-nvim
|
||||
telescope-fzf-native-nvim
|
||||
telescope-ui-select-nvim
|
||||
conform-nvim
|
||||
];
|
||||
};
|
||||
|
||||
completion = {
|
||||
lazy = true;
|
||||
data = with pkgs.vimPlugins; [
|
||||
blink-cmp
|
||||
luasnip
|
||||
friendly-snippets
|
||||
mini-nvim
|
||||
colorful-menu-nvim
|
||||
];
|
||||
};
|
||||
|
||||
lsp = {
|
||||
lazy = true;
|
||||
data = with pkgs.vimPlugins; [
|
||||
nvim-lspconfig
|
||||
lazydev-nvim
|
||||
colorful-menu-nvim
|
||||
trouble-nvim
|
||||
typst-preview-nvim
|
||||
];
|
||||
};
|
||||
|
||||
formatting = {
|
||||
lazy = true;
|
||||
data = with pkgs.vimPlugins; [
|
||||
conform-nvim
|
||||
];
|
||||
};
|
||||
|
||||
core = {
|
||||
lazy = true;
|
||||
data = with pkgs.vimPlugins; [
|
||||
mini-nvim
|
||||
guess-indent-nvim
|
||||
direnv-vim
|
||||
];
|
||||
};
|
||||
|
||||
ui = {
|
||||
lazy = true;
|
||||
data = with pkgs.vimPlugins; [
|
||||
lualine-nvim
|
||||
zen-mode-nvim
|
||||
kanagawa-nvim
|
||||
which-key-nvim
|
||||
];
|
||||
};
|
||||
|
||||
project = {
|
||||
lazy = true;
|
||||
data = with pkgs.vimPlugins; [
|
||||
project-nvim
|
||||
typst-preview-nvim
|
||||
direnv-vim
|
||||
codecompanion-nvim
|
||||
copilot-lua
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -8,4 +8,3 @@ require("plugins.treesitter")
|
||||
require("plugins.telescope")
|
||||
require("plugins.ui")
|
||||
require("plugins.core")
|
||||
require("plugins.ai")
|
||||
|
||||
@@ -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({})
|
||||
Reference in New Issue
Block a user