Skip to content

Commit 58cead7

Browse files
committed
plugins/blink-ripgrep: use mkBlinkPluginModule
1 parent 802e289 commit 58cead7

File tree

2 files changed

+31
-47
lines changed

2 files changed

+31
-47
lines changed
Lines changed: 29 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,43 @@
11
{ lib, ... }:
2-
lib.nixvim.plugins.mkNeovimPlugin {
2+
let
33
name = "blink-ripgrep";
4+
in
5+
lib.nixvim.plugins.mkNeovimPlugin {
6+
inherit name;
47
packPathName = "blink-ripgrep.nvim";
58
package = "blink-ripgrep-nvim";
69

710
maintainers = [ lib.maintainers.khaneliman ];
811

9-
description = ''
10-
This plugin should be configured through blink-cmp's `sources.providers` settings.
11-
12-
For example:
13-
14-
```nix
15-
plugins.blink-cmp = {
16-
enable = true;
17-
settings.sources.providers = {
18-
ripgrep = {
19-
async = true;
20-
module = "blink-ripgrep";
21-
name = "Ripgrep";
22-
score_offset = 100;
23-
opts = {
24-
prefix_min_len = 3;
25-
context_size = 5;
26-
max_filesize = "1M";
27-
project_root_marker = ".git";
28-
project_root_fallback = true;
29-
search_casing = "--ignore-case";
30-
additional_rg_options = {};
31-
fallback_to_regex_highlighting = true;
32-
ignore_paths = {};
33-
additional_paths = {};
34-
debug = false;
35-
};
36-
};
12+
imports = [
13+
(lib.nixvim.modules.mkBlinkPluginModule {
14+
pluginName = name;
15+
# TODO: compute a sane-default
16+
key = "ripgrep";
17+
sourceName = "Ripgrep";
18+
module = "blink-ripgrep";
19+
settingsExample = {
20+
async = true;
21+
score_offset = 100;
3722
};
38-
};
39-
```
40-
41-
And then you can add it to blink-cmp's `sources.default` option:
23+
})
24+
];
4225

43-
```nix
44-
plugins.blink-cmp = {
45-
enable = true;
46-
settings.sources.default = [
47-
"lsp"
48-
"path"
49-
"luasnip"
50-
"buffer"
51-
"ripgrep"
52-
];
53-
};
54-
```
55-
'';
26+
settingsExample = {
27+
prefix_min_len = 3;
28+
context_size = 5;
29+
max_filesize = "1M";
30+
project_root_marker = ".git";
31+
project_root_fallback = true;
32+
search_casing = "--ignore-case";
33+
additional_rg_options = { };
34+
fallback_to_regex_highlighting = true;
35+
ignore_paths = { };
36+
additional_paths = { };
37+
debug = false;
38+
};
5639

5740
# Configured through blink-cmp
5841
callSetup = false;
5942
hasLuaConfig = false;
60-
hasSettings = false;
6143
}

tests/test-sources/plugins/by-name/blink-ripgrep/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-ripgrep.enable = true;
45
};
56

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

0 commit comments

Comments
 (0)