mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-12-15 16:41:03 +00:00
cmp: actually lazy load source
This commit is contained in:
parent
f107cc45eb
commit
4b703964e1
4 changed files with 43 additions and 0 deletions
|
|
@ -5,6 +5,7 @@
|
|||
}: let
|
||||
inherit (builtins) toJSON;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.strings) optionalString;
|
||||
|
||||
cfg = config.vim.assistant.copilot;
|
||||
|
||||
|
|
@ -59,7 +60,14 @@ in {
|
|||
copilot-cmp = mkIf cfg.cmp.enable {
|
||||
package = "copilot-cmp";
|
||||
lazy = true;
|
||||
after = optionalString config.vim.lazy.enable ''
|
||||
local path = vim.fn.globpath(vim.o.packpath, 'pack/*/opt/copilot-cmp')
|
||||
require("rtp_nvim").source_after_plugin_dir(path)
|
||||
require("lz.n").trigger_load("copilot-lua")
|
||||
'';
|
||||
};
|
||||
|
||||
nvim-cmp.after = mkIf cfg.cmp.enable "require('lz.n').trigger_load('copilot-cmp')";
|
||||
};
|
||||
|
||||
autocomplete.nvim-cmp.sources = {copilot = "[Copilot]";};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue