Skip to content

Commit c39f5f3

Browse files
Ladas552MattSturgeon
authored andcommitted
plugins/telescope-zf-native-nvim: init
Add support for [telescope-zf-native.nvim](https://github.com/natecraddock/telescope-zf-native.nvim), providing native telescope bindings to zf for sorting results .
1 parent a473ef6 commit c39f5f3

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed

modules/dependencies.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ in
147147
];
148148
yazi.default = "yazi";
149149
yq.default = "yq";
150+
zf.default = "zf";
150151
zk.default = "zk";
151152
};
152153
};

plugins/by-name/telescope/extensions/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
./project.nix
1212
./ui-select.nix
1313
./undo.nix
14+
./zf-native.nix
1415
./zoxide.nix
1516
];
1617
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{ lib, ... }:
2+
let
3+
inherit (lib.nixvim) defaultNullOpts;
4+
mkExtension = import ./_mk-extension.nix;
5+
in
6+
mkExtension {
7+
name = "zf-native";
8+
extensionName = "zf-native";
9+
package = "telescope-zf-native-nvim";
10+
11+
settingsOptions = {
12+
file = {
13+
enable = defaultNullOpts.mkBool true ''
14+
Override default telescope file sorter.
15+
'';
16+
highlight_results = defaultNullOpts.mkBool true ''
17+
Highlight matching text in results.
18+
'';
19+
match_filename = defaultNullOpts.mkBool true ''
20+
Enable zf filename match priority.
21+
'';
22+
initial_sort = defaultNullOpts.mkBool null ''
23+
Optional function to define a sort order when the query is empty.
24+
'';
25+
smart_case = defaultNullOpts.mkBool true ''
26+
Set to false to enable case sensitive matching.
27+
'';
28+
};
29+
30+
generic = {
31+
enable = defaultNullOpts.mkBool true ''
32+
Override default telescope generic item sorter.
33+
'';
34+
highlight_results = defaultNullOpts.mkBool true ''
35+
Highlight matching text in results.
36+
'';
37+
match_filename = defaultNullOpts.mkBool false ''
38+
Disable zf filename match priority.
39+
'';
40+
initial_sort = defaultNullOpts.mkBool null ''
41+
Optional function to define a sort order when the query is empty.
42+
'';
43+
smart_case = defaultNullOpts.mkBool true ''
44+
Set to false to enable case sensitive matching.
45+
'';
46+
};
47+
};
48+
49+
settingsExample = {
50+
file = {
51+
enable = true;
52+
highlight_results = true;
53+
match_filename = true;
54+
initial_sort = null;
55+
smart_case = true;
56+
};
57+
generic = {
58+
enable = true;
59+
highlight_results = true;
60+
match_filename = false;
61+
initial_sort = null;
62+
smart_case = true;
63+
};
64+
};
65+
66+
dependencies = [ "zf" ];
67+
68+
extraConfig = cfg: {
69+
# zf-native shared binaries
70+
performance.combinePlugins.pathsToLink = [ "/lib" ];
71+
};
72+
}

0 commit comments

Comments
 (0)