mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-03-03 23:42:56 +00:00
Enabling codecompanion and blink-cmp, would not install codecompanion. The quick fix was to disable lazy loading all together. This is no longer required
65 lines
1.7 KiB
Nix
65 lines
1.7 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (lib.modules) mkIf;
|
|
|
|
cfg = config.vim.assistant.codecompanion-nvim;
|
|
in {
|
|
config = mkIf cfg.enable {
|
|
vim = {
|
|
startPlugins = [
|
|
"plenary-nvim"
|
|
];
|
|
|
|
lazy.plugins = {
|
|
codecompanion-nvim = {
|
|
package = "codecompanion-nvim";
|
|
setupModule = "codecompanion";
|
|
inherit (cfg) setupOpts;
|
|
|
|
# Register commands with lz.n so Neovim recognizes them immediately
|
|
cmd = [
|
|
"CodeCompanion"
|
|
"CodeCompanionChat"
|
|
"CodeCompanionActions"
|
|
"CodeCompanionCmd"
|
|
];
|
|
|
|
# Ensure the plugin loads when entering Insert/Cmdline mode
|
|
# so the module is ready when blink.cmp requests it
|
|
event = ["InsertEnter" "CmdlineEnter"];
|
|
};
|
|
};
|
|
|
|
treesitter = {
|
|
enable = true;
|
|
|
|
# Codecompanion depends on the YAML grammar being added. Below is
|
|
# an easy way of adding an user-configurable grammar package exposed
|
|
# by the YAML language module *without* enabling the whole YAML language
|
|
# module. The package is defined even when the module is disabled.
|
|
grammars = [
|
|
config.vim.languages.yaml.treesitter.package
|
|
];
|
|
};
|
|
|
|
autocomplete = {
|
|
nvim-cmp = {
|
|
sources = {codecompanion-nvim = "[codecompanion]";};
|
|
sourcePlugins = ["codecompanion-nvim"];
|
|
};
|
|
blink-cmp = {
|
|
setupOpts.sources = {
|
|
default = ["codecompanion"];
|
|
providers.codecompanion = {
|
|
name = "CodeCompanion";
|
|
module = "codecompanion.providers.completion.blink";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|