3
3
** fzf-native** is a ` c ` port of ** [ fzf] [ fzf ] ** . It only covers the algorithm and
4
4
implements few functions to support calculating the score.
5
5
6
+ This means that the [ fzf syntax] ( https://github.com/junegunn/fzf#search-syntax ) .
7
+ This is an advantage over the more simpler ` fzy ` algorithm, which is also
8
+ available for telescope (as native component or as lua component).
9
+
6
10
## Installation
7
11
8
12
To get ** fzf-native** working, you need to run make at the root directory. As of
@@ -23,11 +27,13 @@ use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
23
27
## Telescope Setup and Configuration:
24
28
25
29
``` lua
30
+ -- You dont need to set any of these options. These are the default ones. Only
31
+ -- the loading is important
26
32
require (' telescope' ).setup {
27
33
extensions = {
28
34
fzf = {
29
35
fuzzy = true , -- false will only do exact matching
30
- override_generic_sorter = false , -- override the generic sorter
36
+ override_generic_sorter = true , -- override the generic sorter
31
37
override_file_sorter = true , -- override the file sorter
32
38
case_mode = " smart_case" , -- or "ignore_case" or "respect_case"
33
39
-- the default case_mode is "smart_case"
@@ -45,9 +51,6 @@ This section is only addressed towards developers who plan to use the library
45
51
(c or lua bindings).
46
52
This section is not addressed towards users of the telescope extension.
47
53
48
- (** Disclaimer** : Interface is not yet stable. The library is still in
49
- development)
50
-
51
54
### C Interface
52
55
53
56
``` c
@@ -94,25 +97,24 @@ fzf.free_slab(slab)
94
97
95
98
## Disclaimer
96
99
97
- This project is work in progress and might not be complete compared to
98
- ** [ fzf] [ fzf ] ** . But i think we are at a pretty usable state already.
99
-
100
- Another point to mention is that, this will not compare 1:1 with
101
- ** [ fzf] [ fzf ] ** , because telescope handles the sorting, this extension is
102
- only handling the calculation of the score. This means that the order of items
103
- with the same score might be different in telescope compared to ** [ fzf] [ fzf ] ** .
104
-
105
- Example for this behaivor is this pattern in this repository: ` src | lua ` .
106
- All files that match this pattern have the same score which results in a
107
- slightly different order for telescope compared to ** [ fzf] [ fzf ] ** .
100
+ This projects implements ** [ fzf] [ fzf ] ** algorithm in c. So there might be
101
+ differences in matching. I don't guarantee completeness.
108
102
109
103
### TODO
110
104
111
- Stuff still missing that is present in fzf.
105
+ Stuff still missing that is present in ** [ fzf] [ fzf ] ** .
112
106
113
107
- [ ] normalize
114
108
- [ ] case for unicode (i don't think this works currently)
115
- - [ ] and probably more
109
+
110
+ ## Benchmark
111
+
112
+ Comparison with fzy-native and fzy-lua with a table containing 240201 file
113
+ strings. It calculated the score and position (if score > 0) for each of these
114
+ strings with the pattern that is listed below:
115
+
116
+ ![ benchmark 1] ( https://raw.githubusercontent.com/wiki/nvim-telescope/telescope.nvim/imgs/bench1.png )
117
+ ![ benchmark 2] ( https://raw.githubusercontent.com/wiki/nvim-telescope/telescope.nvim/imgs/bench2.png )
116
118
117
119
## Credit
118
120
0 commit comments