copilot: load on LazyFile

This commit is contained in:
Ching Pei Yang 2025-03-22 15:02:40 +01:00 committed by Ching Pei Yang
parent e2d10e8fb2
commit c639cf5064

View file

@ -37,6 +37,12 @@ in {
inherit (cfg) setupOpts; inherit (cfg) setupOpts;
after = mkIf cfg.cmp.enable "require('copilot_cmp').setup()"; after = mkIf cfg.cmp.enable "require('copilot_cmp').setup()";
event = [
{
event = "User";
pattern = "LazyFile";
}
];
cmd = ["Copilot" "CopilotAuth" "CopilotDetach" "CopilotPanel" "CopilotStop"]; cmd = ["Copilot" "CopilotAuth" "CopilotDetach" "CopilotPanel" "CopilotStop"];
keys = [ keys = [
(mkLuaKeymap ["n"] cfg.mappings.panel.accept (wrapPanelBinding ''require("copilot.panel").accept'' cfg.mappings.panel.accept) "[copilot] Accept suggestion" {}) (mkLuaKeymap ["n"] cfg.mappings.panel.accept (wrapPanelBinding ''require("copilot.panel").accept'' cfg.mappings.panel.accept) "[copilot] Accept suggestion" {})