From cf01c024af844bf89c9b296fc1627abffe038ecf Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Wed, 5 Feb 2025 11:22:34 -0600 Subject: [PATCH] plugins/blink-copilot: init --- plugins/by-name/blink-copilot/default.nix | 62 +++++++++++++++++++ .../plugins/by-name/blink-copilot/default.nix | 11 ++++ 2 files changed, 73 insertions(+) create mode 100644 plugins/by-name/blink-copilot/default.nix create mode 100644 tests/test-sources/plugins/by-name/blink-copilot/default.nix diff --git a/plugins/by-name/blink-copilot/default.nix b/plugins/by-name/blink-copilot/default.nix new file mode 100644 index 00000000..e01b0b24 --- /dev/null +++ b/plugins/by-name/blink-copilot/default.nix @@ -0,0 +1,62 @@ +{ lib, ... }: +lib.nixvim.plugins.mkNeovimPlugin { + name = "blink-copilot"; + package = "blink-copilot"; + + maintainers = [ lib.maintainers.khaneliman ]; + + description = '' + This plugin should be configured through blink-cmp's `sources.providers` settings. + + For example: + + ```nix + plugins.blink-cmp = { + enable = true; + settings.sources.providers = { + copilot = { + async = true; + module = "blink-copilot"; + name = "copilot"; + score_offset = 100; + # Optional configurations + opts = { + max_completions = 3; + max_attempts = 4; + kind = "Copilot"; + debounce = 750; + auto_refresh = { + backward = true; + forward = true; + }; + }; + }; + }; + }; + ``` + + And then you can add it to blink-cmp's `sources.default` option: + + ```nix + plugins.blink-cmp = { + enable = true; + settings.sources.default = [ + "lsp" + "path" + "luasnip" + "buffer" + "copilot" + ]; + }; + ``` + ''; + + # Configured through blink-cmp + callSetup = false; + hasLuaConfig = false; + hasSettings = false; + + extraConfig = { + plugins.copilot-lua.enable = lib.mkDefault true; + }; +} diff --git a/tests/test-sources/plugins/by-name/blink-copilot/default.nix b/tests/test-sources/plugins/by-name/blink-copilot/default.nix new file mode 100644 index 00000000..42bbab9f --- /dev/null +++ b/tests/test-sources/plugins/by-name/blink-copilot/default.nix @@ -0,0 +1,11 @@ +{ + empty = { + plugins.blink-copilot.enable = true; + }; + + defaults = { + plugins.blink-copilot = { + enable = true; + }; + }; +}