Skip to content

Commit dc60cff

Browse files
committed
plugins/blink-cmp-git: use mkBlinkPluginModule
1 parent 98af695 commit dc60cff

File tree

2 files changed

+20
-37
lines changed

2 files changed

+20
-37
lines changed
Lines changed: 18 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,31 @@
11
{ lib, ... }:
2-
lib.nixvim.plugins.mkNeovimPlugin {
2+
let
33
name = "blink-cmp-git";
4-
package = "blink-cmp-git";
4+
in
5+
lib.nixvim.plugins.mkNeovimPlugin {
6+
inherit name;
57

68
maintainers = [ lib.maintainers.khaneliman ];
79

8-
description = ''
9-
This plugin should be configured through blink-cmp's `sources.providers` settings.
10-
11-
For example:
12-
13-
```nix
14-
plugins.blink-cmp = {
15-
enable = true;
16-
settings.sources.providers = {
17-
git = {
18-
module = "blink-cmp-git";
19-
name = "git";
20-
score_offset = 100;
21-
opts = {
22-
commit = { };
23-
git_centers = { git_hub = { }; };
24-
};
25-
};
10+
imports = [
11+
(lib.nixvim.modules.mkBlinkPluginModule {
12+
pluginName = name;
13+
# TODO: compute a sane-default
14+
sourceName = "git";
15+
settingsExample = {
16+
score_offset = 100;
2617
};
27-
};
28-
```
29-
30-
And then you can add it to blink-cmp's `sources.default` option:
18+
})
19+
];
3120

32-
```nix
33-
plugins.blink-cmp = {
34-
enable = true;
35-
settings.sources.default = [
36-
"lsp"
37-
"path"
38-
"luasnip"
39-
"buffer"
40-
"git"
41-
];
21+
settingsExample = {
22+
commit = { };
23+
git_centers = {
24+
git_hub = { };
4225
};
43-
```
44-
'';
26+
};
4527

4628
# Configured through blink-cmp
4729
callSetup = false;
4830
hasLuaConfig = false;
49-
hasSettings = false;
5031
}

tests/test-sources/plugins/by-name/blink-cmp-git/default.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
empty = {
3+
plugins.blink-cmp.enable = true;
34
plugins.blink-cmp-git.enable = true;
45
};
56

67
defaults = {
8+
plugins.blink-cmp.enable = true;
79
plugins.blink-cmp-git = {
810
enable = true;
911
};

0 commit comments

Comments
 (0)