mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
plugins/blink-cmp-copilot: init
This commit is contained in:
parent
8938e09db1
commit
ca3c7e29a8
2 changed files with 78 additions and 0 deletions
67
plugins/by-name/blink-cmp-copilot/default.nix
Normal file
67
plugins/by-name/blink-cmp-copilot/default.nix
Normal file
|
@ -0,0 +1,67 @@
|
|||
{ config, lib, ... }:
|
||||
lib.nixvim.plugins.mkNeovimPlugin {
|
||||
name = "blink-cmp-copilot";
|
||||
package = "blink-cmp-copilot";
|
||||
|
||||
maintainers = [ lib.maintainers.HeitorAugustoLN ];
|
||||
|
||||
description = ''
|
||||
This plugin should be configured through blink-cmp's source settings.
|
||||
|
||||
For example:
|
||||
|
||||
```nix
|
||||
plugins.blink-cmp = {
|
||||
enable = true;
|
||||
settings.sources = {
|
||||
copilot = {
|
||||
async = true;
|
||||
module = "blink-cmp-copilot";
|
||||
name = "copilot";
|
||||
score_offset = 100;
|
||||
};
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
And then you can add it as a source for blink-cmp:
|
||||
|
||||
```nix
|
||||
plugins.blink-cmp = {
|
||||
enable = true;
|
||||
settings.sources.default = [
|
||||
"lsp"
|
||||
"path"
|
||||
"luasnip"
|
||||
"buffer"
|
||||
"copilot"
|
||||
];
|
||||
};
|
||||
```
|
||||
'';
|
||||
|
||||
callSetup = false;
|
||||
hasLuaConfig = false;
|
||||
hasSettings = false;
|
||||
|
||||
extraConfig = {
|
||||
warnings =
|
||||
let
|
||||
copilot-lua-cfg = config.plugins.copilot-lua;
|
||||
isEnabled = b: builtins.isBool b && b;
|
||||
in
|
||||
lib.optionals (isEnabled copilot-lua-cfg.suggestion.enabled) [
|
||||
''
|
||||
It is recommended to disable copilot's `suggestion` module, as it can interfere with
|
||||
completions properly appearing in blink-cmp-copilot.
|
||||
''
|
||||
]
|
||||
++ lib.optionals (isEnabled copilot-lua-cfg.panel.enabled) [
|
||||
''
|
||||
It is recommended to disable copilot's `panel` module, as it can interfere with completions
|
||||
properly appearing in blink-cmp-copilot.
|
||||
''
|
||||
];
|
||||
plugins.copilot-lua.enable = lib.mkDefault true;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
empty = {
|
||||
plugins.blink-cmp-copilot.enable = true;
|
||||
};
|
||||
|
||||
defaults = {
|
||||
plugins.blink-cmp-copilot = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue