-
-
Notifications
You must be signed in to change notification settings - Fork 179
/
leaderf.txt
1409 lines (1187 loc) · 57.6 KB
/
leaderf.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
*leaderf.txt* Quickly locate files, buffers, mrus, tags, ... in large project.
*leaderf* *LeaderF*
==============================================================================
/ '7MMF' '7MM `7MM"""YMM /
/ MM MM MM `7 /
/ MM .gP"Ya ,6"Yb. ,M""bMM .gP"Ya `7Mb,od8 MM d /
/ MM ,M' Yb 8) MM ,AP MM ,M' Yb MM' "' MM""MM /
/ MM , 8M"""""" ,pm9MM 8MI MM 8M"""""" MM MM Y /
/ MM ,M YM. , 8M MM `Mb MM YM. , MM MM /
/ .JMMmmmmMMM 'Mbmmd' 'Moo9^Yo.'Wbmd"MML.`Mbmmd'.JMML. .JMML. /
==============================================================================
CONTENTS *leaderf-contents*
Introduction |leaderf-introduction|
Requirements |leaderf-requirements|
Options |leaderf-options|
Usage |leaderf-usage|
FAQ |leaderf-faq|
Changelog |leaderf-changelog|
Credits |leaderf-credits|
==============================================================================
INTRODUCTION *leaderf-introduction*
This plugin is mainly used for locating files, buffers, mrus, tags in large project.
- Written in Python.
- Support fuzzy and regex searching.
- Manage buffers and mrus.
- Open multiple files at once.
- Extensible.
==============================================================================
REQUIREMENTS *leaderf-requirements*
- vim7.4.330 or higher.
- vim compiled with Python support, you can check by using `echo has('python')`
or `echo has('python3')` to see if the result is 1.
==============================================================================
OPTIONS *leaderf-options*
g:leaderf_loaded *g:loaded_leaderf*
Whether leaderf plugin has been loaded.
Default value is 0.
g:Lf_PythonVersion *g:Lf_PythonVersion*
Set this to 2 or 3 to specify the version of Python this plugin use.
If both python2 and python3 are supported, the default value is 3,
otherwise the default value is the supported version.
g:Lf_ShortcutF *g:Lf_ShortcutF*
Use this option to set the mapping of searching files command.
e.g. let g:Lf_ShortcutF = '<C-P>'
Default value is '<leader>f'.
g:Lf_ShortcutB *g:Lf_ShortcutB*
Use this option to set the mapping of searching buffers command.
Default value is '<leader>b'.
g:Lf_WindowPosition *g:Lf_WindowPosition*
Setting this option can change the position of the LeaderF window.
The value can be 'fullScreen', 'top', 'bottom', 'left', 'right'.
'fullScreen' - the LeaderF window take up the full screen
'top' - the LeaderF window is at the top of the screen.
'bottom' - the LeaderF window is at the bottom of the screen.
'left' - the LeaderF window is at the left of the screen.
'right' - the LeaderF window is at the right of the screen.
'popup' - the LeaderF window is a popup window or floating window.
Default value is 'bottom'.
g:Lf_WindowHeight *g:Lf_WindowHeight*
This option is used to set the default height of the LeaderF window.
If the value is a floating point number less than 1, it means the
percentage of the height of the vim window.
e.g., let g:Lf_WindowHeight = 0.30
The option will be ignored if the value of |g:Lf_WindowPosition| is
not 'top' or 'bottom'.
Default value is 0.5.
g:Lf_TabpagePosition *g:Lf_TabpagePosition*
Specify where to put the newly opened tabpage.
The value can be 0, 1, 2, ...
0 - make the newly opened tabpage the first one.
1 - put the newly opened tabpage before the current one.
2 - put the newly opened tabpage after the current one.
3 - make the newly opened tabpage the last one.
Default value is 3.
g:Lf_ShowRelativePath *g:Lf_ShowRelativePath*
Whether to show the relative path in the LeaderF window.
0 - no
1 - yes
Default value is 1.
g:Lf_DefaultMode *g:Lf_DefaultMode*
Specify the default mode when LeaderF is launched.
There are 4 modes, and the corresponding values are:
'NameOnly' - fuzzy mode, match file name only when searching
'FullPath' - fuzzy mode, match full path when searching
'Fuzzy' - fuzzy mode, when lines in the result are not file path
'Regex' - regex mode
Default value is 'FullPath'
g:Lf_CursorBlink *g:Lf_CursorBlink*
Set this option to 1 to let the cursor in the prompt blink, if you don't
want the cursor to blink, set the value to 0.
g:Lf_CacheDirectory *g:Lf_CacheDirectory*
Set this option to change the location of the cache directory.
e.g. >
let g:Lf_CacheDirectory = '/root'
<
On Windows, default value is '%APPDATA%'.
On Linux, default value is '$XDG_CACHE_HOME' if $XDG_CACHE_HOME is defined,
otherwise, default value is '$HOME/.cache'.
g:Lf_NeedCacheTime *g:Lf_NeedCacheTime*
This option set a threshold, if the time of indexing files is greater than
the threshold, cache the files list.
Default value is 1.5 seconds.
g:Lf_NumberOfCache *g:Lf_NumberOfCache*
This option specifies the number of cache.
Default value is 5.
g:Lf_UseMemoryCache *g:Lf_UseMemoryCache*
Whether to use the memory to cache the indexing result.
0 - no
1 - yes
Default value is 1.
g:Lf_IndexTimeLimit *g:Lf_IndexTimeLimit*
Specify the maximum time of indexing the files that you can tolerate to
wait.
Default value is 120 seconds.
g:Lf_FollowLinks *g:Lf_FollowLinks*
Whether to visit directories pointed to by symlinks when indexing.
0 - no
1 - yes
Default value is 0.
g:Lf_WildIgnore *g:Lf_WildIgnore*
Specify the files and directories you want to exclude while indexing.
Default value is: >
let g:Lf_WildIgnore = {
\ 'dir': [],
\ 'file': []
\}
<
Here uses the Unix shell-style wildcards, which are not the same as
regular expressions. The special characters used in shell-style wildcards
are: >
Pattern | Meaning
-------------------------------------------
* | matches everything
? | matches any single character
[seq] | matches any character in seq
[!seq] | matches any character not in seq
-------------------------------------------
<
For example, you can set as below: >
let g:Lf_WildIgnore = {
\ 'dir': ['.svn','.git','.hg'],
\ 'file': ['*.sw?','~$*','*.bak','*.exe','*.o','*.so','*.py[co]']
\}
<
g:Lf_DelimiterChar *g:Lf_DelimiterChar*
In NameOnly mode, if you want to refine the result by typing extra
characters to match the directory, type this character first.
Default value is ';'.
g:Lf_MruFileExclude *g:Lf_MruFileExclude*
Files you don't want LeaderF to record.
See |g:Lf_WildIgnore| for the usage of pattern.
e.g. >
let g:Lf_MruFileExclude = ['*.so']
<
Default value is [].
g:Lf_MruMaxFiles *g:Lf_MruMaxFiles*
Specify the number of most recently used files you want LeaderF to record.
Default value is 100.
g:Lf_HighlightIndividual *g:Lf_HighlightIndividual*
Whether to highlight individual character of the input in the result.
Set the value to 0 to highlight consecutive characters.
Default value is 1.
g:Lf_NumberOfHighlight *g:Lf_NumberOfHighlight*
Specify the number of highlight lines in the result.
Default value is 100.
g:Lf_DisableStl *g:Lf_DisableStl*
Don't let LeaderF modify statusline.
e.g. >
let g:Lf_DisableStl = 1
<
g:Lf_DisableStl will not be set by default.
g:Lf_StlColorscheme *g:Lf_StlColorscheme*
You can configure the colorscheme of statusline for LeaderF.
e.g. >
let g:Lf_StlColorscheme = 'powerline'
<
The colorscheme files can be found in the directory >
"LeaderF/autoload/leaderf/colorscheme/"
<
Default value is 'default'.
g:Lf_StlSeparator *g:Lf_StlSeparator*
A Dictionary to store separators.
The default value is >
let g:Lf_StlSeparator = { 'left': '►', 'right': '◄', 'font': '' }
<
If you don't like using separators, you can set the value as below: >
let g:Lf_StlSeparator = { 'left': '', 'right': '' }
<
You can also use the patched font you used for |vim-powerline| and |powerline|.
The patched fonts for |powerline| are available at
https://github.com/Lokaltog/powerline-fonts
A tutorial to create a patched font for |vim-powerline| is available at
https://github.com/Lokaltog/vim-powerline/tree/develop/fontpatcher
If you have installed the patched font for |powerline|, following setting looks
nice. >
let g:Lf_StlSeparator = { 'left': '', 'right': '' }
<
If you have installed the patched font for |vim-powerline|, following setting
looks nice. >
let g:Lf_StlSeparator = { 'left': '⮀', 'right': '⮂' }
<
If the statusline does not correctly show the special characters, use the
unicode numbers.
For |powerline| font users: >
let g:Lf_StlSeparator = { 'left': "\ue0b0", 'right': "\ue0b2" }
<
For |vim-powerline| font users: >
let g:Lf_StlSeparator = { 'left': "\u2b80", 'right': "\u2b82" }
<
If you haven't set the global option |guifont|, you can still use the patched
fonts, e.g., >
let g:Lf_StlSeparator = { 'left': "\ue0b0", 'right': "\ue0b2", 'font': "DejaVu Sans Mono for Powerline" }
<
g:Lf_StlPalette *g:Lf_StlPalette*
This is a dictionary, you can customize the colorscheme using this option.
Default colorscheme is equivalent to the following setting: >
let g:Lf_StlPalette = {
\ 'stlName': {
\ 'gui': 'bold',
\ 'font': 'NONE',
\ 'guifg': '#2F5C00',
\ 'guibg': '#BAFFA3',
\ 'cterm': 'bold',
\ 'ctermfg': '22',
\ 'ctermbg': '157'
\ },
\ 'stlCategory': {
\ 'gui': 'NONE',
\ 'font': 'NONE',
\ 'guifg': '#000000',
\ 'guibg': '#F28379',
\ 'cterm': 'NONE',
\ 'ctermfg': '16',
\ 'ctermbg': '210'
\ },
\ 'stlNameOnlyMode': {
\ 'gui': 'NONE',
\ 'font': 'NONE',
\ 'guifg': '#000000',
\ 'guibg': '#E8ED51',
\ 'cterm': 'NONE',
\ 'ctermfg': '16',
\ 'ctermbg': '227'
\ },
\ 'stlFullPathMode': {
\ 'gui': 'NONE',
\ 'font': 'NONE',
\ 'guifg': '#000000',
\ 'guibg': '#AAAAFF',
\ 'cterm': 'NONE',
\ 'ctermfg': '16',
\ 'ctermbg': '147'
\ },
\ 'stlFuzzyMode': {
\ 'gui': 'NONE',
\ 'font': 'NONE',
\ 'guifg': '#000000',
\ 'guibg': '#E8ED51',
\ 'cterm': 'NONE',
\ 'ctermfg': '16',
\ 'ctermbg': '227'
\ },
\ 'stlRegexMode': {
\ 'gui': 'NONE',
\ 'font': 'NONE',
\ 'guifg': '#000000',
\ 'guibg': '#7FECAD',
\ 'cterm': 'NONE',
\ 'ctermfg': '16',
\ 'ctermbg': '121'
\ },
\ 'stlCwd': {
\ 'gui': 'NONE',
\ 'font': 'NONE',
\ 'guifg': '#EBFFEF',
\ 'guibg': '#606168',
\ 'cterm': 'NONE',
\ 'ctermfg': '195',
\ 'ctermbg': '241'
\ },
\ 'stlBlank': {
\ 'gui': 'NONE',
\ 'font': 'NONE',
\ 'guifg': 'NONE',
\ 'guibg': '#3B3E4C',
\ 'cterm': 'NONE',
\ 'ctermfg': 'NONE',
\ 'ctermbg': '237'
\ },
\ 'stlLineInfo': {
\ 'gui': 'NONE',
\ 'font': 'NONE',
\ 'guifg': '#000000',
\ 'guibg': '#EBFFEF',
\ 'cterm': 'NONE',
\ 'ctermfg': '16',
\ 'ctermbg': '195'
\ },
\ 'stlTotal': {
\ 'gui': 'NONE',
\ 'font': 'NONE',
\ 'guifg': '#000000',
\ 'guibg': '#BCDC5C',
\ 'cterm': 'NONE',
\ 'ctermfg': '16',
\ 'ctermbg': '149'
\ }
\ }
<
For example, if you want to change the color of 'stlName', you can configure
like this: >
let g:Lf_StlPalette.stlName = {
\ 'gui': 'bold',
\ 'font': 'NONE',
\ 'guifg': '#2F5C00',
\ 'guibg': '#BAFFA3',
\ 'cterm': 'bold',
\ 'ctermfg': '22',
\ 'ctermbg': '157'
\ }
<
or just change the color of GUI: >
let g:Lf_StlPalette.stlName = {
\ 'gui': 'bold',
\ 'font': 'NONE',
\ 'guifg': '#2F5C00',
\ 'guibg': '#BAFFA3'
\ }
<
g:Lf_Ctags *g:Lf_Ctags*
Use this option to specify the ctags executable you use. If ctags is not
in one of the directories in your $PATH environment variable, you should
set it by yourself. e.g., >
let g:Lf_Ctags = "/usr/local/universal-ctags/ctags"
<
Default value is "ctags".
g:Lf_CtagsFuncOpts *g:Lf_CtagsFuncOpts*
Use this option to specify the options of ctags to generate the tags of
functions. e.g., >
let g:Lf_CtagsFuncOpts = {
\ 'c': '--c-kinds=fp',
\ 'rust': '--rust-kinds=f',
\ }
<
g:Lf_PreviewCode *g:Lf_PreviewCode*
Use this option to specify whether to show the preview of the code the tag
locates in when navigating the tags.
Default value is 0.
g:Lf_DefaultExternalTool *g:Lf_DefaultExternalTool*
Use this option to specify the default external tool which is used to
index the files. Possible values are 'rg', 'pt', 'ag', 'find'.
If you do not want to use the external tool: >
let g:Lf_DefaultExternalTool = ""
<
By default, use the external tool in the sequence of 'rg', 'pt', 'ag', 'find'
if one is available. If none of the tools are available, falls back to the
build-in python implementation which is a little slower.
g:Lf_UseVersionControlTool *g:Lf_UseVersionControlTool*
This option specifies whether to use version control tool to index the
files when inside a repository under control. If not a version control
repository or value is 0, falls back to |g:Lf_DefaultExternalTool|.
e.g.
use command `git ls-files` for git repository;
use command `hg files` for hg repository.
Note: |g:Lf_WildIgnore| is ignored when using these commands.
Default value is 1.
g:Lf_ExternalCommand *g:Lf_ExternalCommand*
Use this option to specify a external command to index the files. If not
specified, falls back to |g:Lf_UseVersionControlTool|.
Use "%s"(quotes are necessary for directory name with space in it) as the
placeholder of the start directory.
e.g. >
let g:Lf_ExternalCommand = 'dir "%s" /s/b/a-d-h-s' " On Windows
let g:Lf_ExternalCommand = 'find "%s" -type f' " On MacOSX/Linux
<
Note: |g:Lf_UseVersionControlTool| and |g:Lf_DefaultExternalTool| are
ignored if this option is specified.
g:Lf_PreviewResult *g:Lf_PreviewResult*
This is a dictionary, indicates whether to enable the preview of the result.
Default value is: >
let g:Lf_PreviewResult = {
\ 'File': 1,
\ 'Buffer': 1,
\ 'Mru': 1,
\ 'Tag': 1,
\ 'BufTag': 1,
\ 'Function': 1,
\ 'Line': 1,
\ 'Colorscheme': 1,
\ 'Rg': 1,
\ 'Gtags': 1
\}
<
e.g., if you want to disable the preview of BufTag explorer: >
let g:Lf_PreviewResult = { 'BufTag': 0 }
<
You can also specify `--auto-preview` or `--no-auto-preview` for the specific
command to override this option.
e.g., `Leaderf file --no-auto-preview`
g:Lf_RememberLastSearch *g:Lf_RememberLastSearch*
This option specifies whether to remember the last search. If the value is
1, the search string you typed during last search is still there when
LeaderF is launched again. (Introduced in issue #62)
Default value is 0.
g:Lf_UseCache *g:Lf_UseCache*
This option specifies whether to cache the files list. If the value is 1,
LeaderF won't reindex the files when reopen vim.(Introduced in issue #64)
Default value is 1.
g:Lf_NormalMap *g:Lf_NormalMap*
This option is deprecated in favor of |g:Lf_NormalCommandMap|.
Use this option to customize the mappings in normal mode.
The mapping with the key `"_"` applies to all categories.
Also, `"_"` is overridden by the mapping of each category.
e.g., >
let g:Lf_NormalMap = {
\ "_": [["<C-j>", "j"],
\ ["<C-k>", "k"]
\ ],
\ "File": [["<ESC>", ':exec g:Lf_py "fileExplManager.quit()"<CR>'],
\ ["<F6>", ':exec g:Lf_py "fileExplManager.quit()"<CR>']
\ ],
\ "Buffer": [["<ESC>", ':exec g:Lf_py "bufExplManager.quit()"<CR>'],
\ ["<F6>", ':exec g:Lf_py "bufExplManager.quit()"<CR>']
\ ],
\ "Mru": [["<ESC>", ':exec g:Lf_py "mruExplManager.quit()"<CR>']],
\ "Tag": [],
\ "BufTag": [],
\ "Function": [],
\ "Line": [],
\ "History":[],
\ "Help": [],
\ "Self": [],
\ "Colorscheme": []
\}
<
g:Lf_RootMarkers *g:Lf_RootMarkers*
Use this option to set the root markers.
e.g., >
let g:Lf_RootMarkers = ['.project', '.project2']
<
Default value is ['.git', '.hg', '.svn']
g:Lf_WorkingDirectoryMode *g:Lf_WorkingDirectoryMode*
This option customizes LeaderF's working directory.
e.g., >
let g:Lf_WorkingDirectoryMode = 'Ac'
<
c - the directory of the current working directory.(default)
a - the nearest ancestor of current working directory that contains one of
directories or files defined in |g:Lf_RootMarkers|. Fall back to 'c' if
no such ancestor directory found.
A - the nearest ancestor of current file that contains one of directories
or files defined in |g:Lf_RootMarkers|. Fall back to 'c' if no such
ancestor directory found.
f - the directory of the current file.
F - if the current working directory is not the direct ancestor of current
file, use the directory of the current file as LeaderF's working
directory, otherwise, same as 'c'.
Note: if "f", "F" is included with "a" or "A", use the behavior of "f" or
"F"(as a fallback) when a root can't be found.
g:Lf_WorkingDirectory *g:Lf_WorkingDirectory*
Set LeaderF's working directory. It will ignore the |g:Lf_RootMarkers| and
|g:Lf_WorkingDirectoryMode| option set.
e.g., >
let g:Lf_WorkingDirectory = finddir('.git', '.;')
<
g:Lf_CommandMap *g:Lf_CommandMap*
Use this option to customize the mappings inside LeaderF's
prompt(|leaderf-prompt|).
for example, if you want to change the default command <C-F> to <C-D> and
change the default command <ESC> to <C-A> and <C-B>: >
let g:Lf_CommandMap = {'<C-F>': ['<C-D>'], '<ESC>': ['<C-A>', '<C-B>']}
<
Note: The key of the dictionary is the old command, the value of the
dictionary is the new command.
g:Lf_NormalCommandMap *g:Lf_NormalCommandMap*
Use this option to customize the mappings in normal mode.
The mapping with the key `"*"` applies to all categories.
Also, `"*"` is overridden by the mapping of each category.
Note: The key of the dictionary is the old command, the value of the
dictionary is the new command.
e.g., >
let g:Lf_NormalCommandMap = {
\ "*": {
\ "<C-Down>": "<C-J>",
\ "<C-Up>": "<C-K>"
\ },
\ "File": {
\ "q": "<Esc>",
\ "a": "<C-A>",
\ "<Esc>": "<C-W>",
\ },
\ "Buffer": {},
\ "Mru": {},
\ "Tag": {},
\ "BufTag": {},
\ "Function": {},
\ "Line": {},
\ "History":{},
\ "Help": {},
\ "Rg": {},
\ "Gtags": {},
\ "Colorscheme": {}
\}
g:Lf_HideHelp *g:Lf_HideHelp*
To specify whether to show the hint "Press <F1> for help" in normal mode.
You can set the value to 1 to hide the hint.
Default value is 0.
g:Lf_ShowHidden *g:Lf_ShowHidden*
To Specify whether to search hidden files and directories.
Default value is 0.(do not search hidden files and directories)
g:Lf_MruWildIgnore *g:Lf_MruWildIgnore*
This option indicates that do not display the MRU files whose file name
matches the patterns defined in it.
See |g:Lf_WildIgnore| for the usage of pattern.
Default value is: >
let g:Lf_MruWildIgnore = {
\ 'dir': [],
\ 'file': []
\}
<
g:Lf_RecurseSubmodules *g:Lf_RecurseSubmodules*
This option indicates whether to show the files in submodules of git
repository. If the value is 1, it means git command has '--recurse-submodules'
option. Because '--recurse-submodules' was first introduced by git version
2.11+ and there will be an error if git version is lower than 2.11, this
option is off with value 0 by default.
g:Lf_ReverseOrder *g:Lf_ReverseOrder*
Show results in bottom-up order.
Default value is 0(top-down order).
g:Lf_AndDelimiter *g:Lf_AndDelimiter*
The And operator character, default value is ' '(space).
g:Lf_HistoryNumber *g:Lf_HistoryNumber*
Specify the number of records in history.
Default value is 100.
g:Lf_HistoryExclude *g:Lf_HistoryExclude*
This option indicates that do not display the historires that matches the
patterns defined in it.
Default value is: >
let g:Lf_HistoryExclude = {
\ 'cmd': [],
\ 'search': []
\}
<
This is specified with a Python regular expression.
For example, you can set as below: >
let g:Lf_HistoryExclude = {
\ 'cmd': ['^w!?', '^q!?', '^.\s*$'],
\ 'search': ['^Plug']
\}
<
g:Lf_HistoryEditPromptIfEmpty *g:Lf_HistoryEditPromptIfEmpty*
This option is used when the history (cmdHistory or searchHistory).
If set to 1, when editing is started when there are 0 results, the text of
the entered prompt is edited.
Default value is 1.
g:Lf_Rg *g:Lf_Rg*
Use this option to specify the rg executable you use. If rg is not
in one of the directories in your $PATH environment variable, you should
set it by yourself. e.g., >
let g:Lf_Rg = 'C:\Windows\System32\rg.exe'
<
Default value is "rg".
g:Lf_RgConfig *g:Lf_RgConfig*
Specify a list of ripgrep configurations. For example, >
let g:Lf_RgConfig = [
\ "--max-columns=150",
\ '--type-add "web:*.{html,css,js}*"',
\ "--glob=!git/*",
\ "--hidden"
\ ]
<
Default value is [].
g:Lf_RgStorePattern *g:Lf_RgStorePattern*
Specify the register to store the search pattern when you exit LeaderF.
The pattern entered with `-e` of the `Leaderf rg` command is stored. Also,
patterns are converted to Vim's regexp.
For example, When there is one pattern:
When executed in `Leaderf rg -e "pat1"`, `/\v\cpat1` is stored.
For example, When there are multiple patterns:
If multiple patterns are specified, they will be joined with `|`.
When executed in `Leaderf rg -e "pat1" -e "pat2"`, `/\v\cpat1|pat2` is
stored.
Default value is "".
g:Lf_RgHighlightInPreview *g:Lf_RgHighlightInPreview*
Specify whether to highlight searched words in preview window.
Default value is 1.
g:Lf_MaxCount *g:Lf_MaxCount*
Specify the limit of the number of source entries. LeaderF will stop
producing the source entries if the limit is hit. There is no limit if the
value is less than 1(<=0).
Default value is 2000000.
g:Lf_NoChdir *g:Lf_NoChdir*
Don't change the current working directory when using `LeaderfFile dir` if
the value is 1, otherwise the current working directory will be changed
to `dir`.
Default value is 1.
g:Lf_Global *g:Lf_Global*
Use this option to customize the global executable to use. e.g., >
let g:Lf_Global = "/bin/global"
<
Default value is "global".
g:Lf_Gtags *g:Lf_Gtags*
Use this option to customize the global executable to use. e.g., >
let g:Lf_Gtags = "/bin/gtags"
<
Default value is "gtags".
g:Lf_GtagsAutoGenerate *g:Lf_GtagsAutoGenerate*
If the value is 1 and there is a rootmark defined by |g:Lf_RootMarkers|
under the project root directory, gtags files will be generated
automatically the first time when starting to edit a new buffer, after
reading the file into the buffer. Otherwise, gtags files should be
generated manually by using `Leaderf gtags --update` .
Default value is 0.
g:Lf_GtagsGutentags *g:Lf_GtagsGutentags*
if you use https://github.com/ludovicchabant/vim-gutentags to generate
gtags; Firstly, you should let g:Lf_GtagsAutoGenerate = 0 and let g:Lf_GtagsGutentags = 1.
Then, you should config gutentags like this: g:Lf_CacheDirectory = expand('~')
and g:gutentags_cache_dir = expand(g:Lf_CacheDirectory.'/LeaderF/gtags')
Default value is 0
g:Lf_GtagsAutoUpdate *g:Lf_GtagsAutoUpdate*
If the value is 1 and the gtags database already exists, gtags database
will be updated automatically after the buffer is saved.
Default value is 1.
g:Lf_GtagsSource *g:Lf_GtagsSource*
Gtags accepts a list of files as target files. This option indicates
where the target files come from. It has 3 values: 0, 1, 2.
0 - gtags search the target files by itself.
1 - the target files come from FileExplorer.
2 - the target files come from |g:Lf_GtagsfilesCmd|.
Default value is 0.
g:Lf_GtagsfilesCmd *g:Lf_GtagsfilesCmd*
If |g:Lf_GtagsSource| is 2, use the command defined by this option to
generate the target files.
Default value is: >
let g:Lf_GtagsfilesCmd = {
\ '.git': 'git ls-files --recurse-submodules',
\ '.hg': 'hg files',
\ 'default': 'rg --no-messages --files'
\}
<
, which means use command `git ls-files --recurse-submodules` for git
repository and `hg files` for hg repository, use `rg --no-messages --files`
otherwise.
g:Lf_GtagsAcceptDotfiles *g:Lf_GtagsAcceptDotfiles*
This option tells gtags to accept files and directories whose names begin
with a dot if the value is 1.
Default value is 0.
g:Lf_GtagsSkipUnreadable *g:Lf_GtagsSkipUnreadable*
This option tells gtags to skip unreadable files if the value is 1.
Default value is 0.
g:Lf_GtagsSkipSymlink *g:Lf_GtagsSkipSymlink*
This option tells gtags to skip symbolic links. If value is 'f' then skip
only symbolic links for file, else if 'd' then skip only symbolic links
for directory, else if value is 'a' then all symbolic links are skipped.
Default value is "a".
g:Lf_Gtagsconf *g:Lf_Gtagsconf*
This option specifies the path of gtags configuration file('gtags.conf' or
'.globalrc').
Basically, you don't have to use this option, gtags has default values in
itself. If you have the file as '/etc/gtags.conf' or "$HOME/.globalrc",
gtags will overwrite the default values with values in the file.
Default value is "".
g:Lf_Gtagslabel *g:Lf_Gtagslabel*
This option specifies a label of the configuration file.
By default, gtags supports C, C++, Yacc, Java, PHP and Assembly
programming language. If you want to support other programming languages,
you can install the pygments package by command `pip install pygments` and
set this option as "native-pygments".
Default value is "default".
g:Lf_GtagsStoreInProject *g:Lf_GtagsStoreInProject*
This option specifies whether to store the gtags database files in the
root directory of the project.
Default value is 0.
g:Lf_GtagsStoreInRootMarker *g:Lf_GtagsStoreInRootMarker*
This option specifies whether to store the gtags database files in the
root marker of the project.
Default value is 0.
g:Lf_GtagsHigherThan6_6_2 *g:Lf_GtagsHigherThan6_6_2*
If `gtag error! unrecognized option --skip-symlink` happens, set the value
to 0.
Default value is 1.
g:Lf_EmptyQuery *g:Lf_EmptyQuery*
This option specifies whether to enable the empty query, i.e., if no
pattern is input, sort the result according to the best match of current
buffer's name.
Default value is 1.
g:Lf_IgnoreCurrentBufferName *g:Lf_IgnoreCurrentBufferName*
This option specifies whether to remove the current buffer name from
the result list.
Default value is 0.
g:Lf_PreviewInPopup *g:Lf_PreviewInPopup*
This option specifies whether to preview the result in a popup window.
Default value is 1.
g:Lf_PreviewHorizontalPosition *g:Lf_PreviewHorizontalPosition*
[[This option is deprecated. Use |g:Lf_PreviewPosition| instead.]]
[[This option is deprecated. Use |g:Lf_PreviewPosition| instead.]]
[[This option is deprecated. Use |g:Lf_PreviewPosition| instead.]]
Specify where to locate the preview window horizontally. The value can be
one of the following:
'left': the preview window is on the left side of the screen.
'center': the preview window is in the center of the screen.
'right': the preview window is on the right side of the screen.
'cursor': the preview window is at the cursor position.
Default value is 'right'.
g:Lf_PreviewPopupWidth *g:Lf_PreviewPopupWidth*
Specify the width of preview window, the value should be a non-negative
integer. If the value is 0, the width of preview window is the same as the
width of the main LeaderF window.
Default value is 0.
g:Lf_PreviewScrollStepSize *g:Lf_PreviewScrollStepSize*
Specify how many rows will be scrolled at once in the preview window.
Default value is 1.
g:Lf_PopupWidth *g:Lf_PopupWidth*
Specify the width of the popup window or floating window when LeaderF is
in popup mode. `Popup mode` is when |g:Lf_WindowPosition| is 'popup' or '--popup'
is in the options list of `Leaderf` command.
The value is a non-negative integer. If the value is 0, the width is 2/3 of
vim's width.
If the value is a floating point number less than 1, it means the percentage
of the width of the vim window.
For example, set the width to 3/4 of the screen's width: >
let g:Lf_PopupWidth = &columns * 3 / 4
or
let g:Lf_PopupWidth = 0.75
<
Default value is 0.
g:Lf_PopupHeight *g:Lf_PopupHeight*
Specify the height of the popup window or floating window when LeaderF is
in popup mode. `Popup mode` is when |g:Lf_WindowPosition| is 'popup' or '--popup'
is in the options list of `Leaderf` command.
The value is a non-negative integer. If the value is 0, the height is 40% of
vim's height.
If the value is a floating point number less than 1, it means the percentage
of the height of the vim window.
For example, set the height to 30% of the vim's height: >
let g:Lf_PopupHeight = float2nr(&lines * 0.3)
or
let g:Lf_PopupHeight = 0.3
<
Default value is 0.
g:Lf_PopupPosition *g:Lf_PopupPosition*
Specify the coordinate of the topleft corner of popup window or floating
window when LeaderF is in popup mode. `Popup mode` is when |g:Lf_WindowPosition|
is 'popup' or '--popup' is in the options list of `Leaderf` command.
The value is a list [`line`, `col`], the first line and the first column are
both 1.
If the value of `line` is 0, the popup window or floating window is vertically
centered.
If the value of `col` is 0, the popup window or floating window is horizontally
centered.
Default value is [0, 0].
g:Lf_PopupShowStatusline *g:Lf_PopupShowStatusline*
Specify whether to show the statusline when LeaderF is in popup mode.
`Popup mode` is when |g:Lf_WindowPosition| is 'popup' or '--popup' is in the
options list of `Leaderf` command.
Default value is 1.
g:Lf_PopupPreviewPosition *g:Lf_PopupPreviewPosition*
Specify where to place the preview window when LeaderF is in popup mode.
`Popup mode` is when |g:Lf_WindowPosition| is 'popup' or '--popup' is in the
options list of `Leaderf` command.
The value can be one of the following:
'top': the preview window is on the top of the main LeaderF window.
'bottom': the preview window is at the bottom of the main LeaderF window.
'left': the preview window is on the left of the main LeaderF window.
'right': the preview window is on the right of the main LeaderF window.
Default value is 'right'.
g:Lf_PreviewPosition *g:Lf_PreviewPosition*
Specify where to place the preview window when LeaderF is in non-popup mode.
The value can be one of the following:
'top': the preview window is on the top of the main LeaderF window.
'topleft': the preview window is on the topleft of the main LeaderF window.
'topright': the preview window is on the topright of the main LeaderF window.
'right': the preview window is on the right of the main LeaderF window.
'bottom': the preview window is at the bottom of the main LeaderF window.
(only available when LeaderF window is on the top)
'cursor': the preview window is at the cursorline of the main LeaderF window.
Default value is 'top'.
g:Lf_PopupColorscheme *g:Lf_PopupColorscheme*
You can configure the colorscheme of LeaderF in popup mode.
e.g. >
let g:Lf_PopupColorscheme = 'default'
<
The colorscheme files can be found in the directory >
"LeaderF/autoload/leaderf/colorscheme/popup/"
<
You can also define the colorscheme by yourself, follow 'default.vim' and
put it under "autoload/leaderf/colorscheme/popup/".
Default value is 'default'.
g:Lf_PopupPalette *g:Lf_PopupPalette*
This is a dictionary, you can customize the colorscheme of popup mode using
it.
Its structure is like below: >
let g:Lf_PopupPalette = {
\ 'light': {
\ 'Lf_hl_match': {
\ 'gui': 'NONE',
\ 'font': 'NONE',
\ 'guifg': 'NONE',
\ 'guibg': '#303136',
\ 'cterm': 'NONE',
\ 'ctermfg': 'NONE',
\ 'ctermbg': '236'
\ },
\ 'Lf_hl_cursorline': {
\ 'gui': 'NONE',
\ 'font': 'NONE',
\ 'guifg': 'NONE',
\ 'guibg': '#303136',
\ 'cterm': 'NONE',
\ 'ctermfg': 'NONE',
\ 'ctermbg': '236'
\ },
\ },
\ 'dark': {
\ ...
\ ...
\ }
\ }
<
All the highlight groups supported are defined in
`LeaderF/autoload/leaderf/colorscheme/popup/default.vim`
It is not defined by default.
g:Lf_PopupShowFoldcolumn *g:Lf_PopupShowFoldcolumn*
Specifies whether to show the foldcolumn in popup window, value 1 means
showing foldcolumn, otherwise not.
Default value is 1.
g:Lf_PopupAutoAdjustHeight *g:Lf_PopupAutoAdjustHeight*
Specifies whether to adjust the height of popup window automatically.
Default value is 1.
g:Lf_PopupShowBorder *g:Lf_PopupShowBorder*
Specifies whether to show borders for popup window.
Default value is 1.
g:Lf_PopupBorders *g:Lf_PopupBorders*
Specifies a list of characters, defining the character to use for the
top/right/bottom/left border, followed by the character to use for the
topleft/topright/botright/botleft corner.
Example: >
let g:Lf_PopupBorders = ["─","│","─","│","╭","╮","╯","╰"]
let g:Lf_PopupBorders = ["─","│","─","│","┌","┐","┘","└"]
let g:Lf_PopupBorders = ["━","┃","━","┃","┏","┓","┛","┗"]
let g:Lf_PopupBorders = ["═","║","═","║","╔","╗","╝","╚"]
<
For some terminals, the non-ascii characters can not be displayed
properly for borders, see https://github.com/neovim/neovim/issues/17996.
To have a good display for non-ascii characters, perhaps you need to set
the value of |ambiwidth| as "single".
Default value is ["─","│","─","│","╭","╮","╯","╰"].
g:Lf_AutoResize *g:Lf_AutoResize*
Auto resize the LeaderF window height automatically.
Default value is 0.
g:Lf_JumpToExistingWindow *g:Lf_JumpToExistingWindow*
Jump to existing window if the selected file is already opened in a
window.
Default value is 1.
g:Lf_ShowDevIcons *g:Lf_ShowDevIcons*
Support commands: buffer,file,mru,window
Default value is 1.
g:Lf_DevIconsFont *g:Lf_DevIconsFont*
Specifies the font used to display the icon.
If it is empty, use the default font.
Also, the value of |g:Lf_DevIconsPalette| takes precedence.
Default value is `''`.
g:Lf_DevIconsPalette *g:Lf_DevIconsPalette*