mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-27 02:59:00 +02:00
Some checks are pending
Publish every Git push to main to FlakeHub / flakehub-publish (push) Waiting to run
Publish every git push to Flakestry / publish-flake (push) Waiting to run
Documentation / Version info (push) Waiting to run
Documentation / Build (push) Blocked by required conditions
Documentation / Combine builds (push) Blocked by required conditions
Documentation / Deploy (push) Blocked by required conditions
70 lines
1.5 KiB
Nix
70 lines
1.5 KiB
Nix
{ lib, ... }:
|
|
lib.nixvim.plugins.mkNeovimPlugin {
|
|
name = "blink-copilot";
|
|
package = "blink-copilot";
|
|
|
|
maintainers = [ lib.maintainers.khaneliman ];
|
|
|
|
description = ''
|
|
Configurable GitHub Copilot suggestions source for the blink-cmp.
|
|
|
|
---
|
|
|
|
This plugin should be configured through blink-cmp's `sources.providers` settings.
|
|
|
|
`plugins.copilot-lua` will be enabled by default, to provide a working setup out-of-the-box.
|
|
You may disable it by explicitly adding `plugins.copilot-lua.enable = false` to your
|
|
configuration.
|
|
|
|
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;
|
|
};
|
|
}
|