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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
|
================================================================================
INTRODUCTION *telescope.nvim*
Telescope.nvim is a plugin for fuzzy finding and neovim. It helps you search,
filter, find and pick things in Lua.
Getting started with telescope:
1. Run `:checkhealth telescope` to make sure everything is installed.
2. Evaluate it is working with `:Telescope find_files` or `:lua
require("telescope.builtin").find_files()`
3. Put a `require("telescope").setup()` call somewhere in your neovim config.
4. Read |telescope.setup| to check what config keys are available and what
you can put inside the setup call
5. Read |telescope.builtin| to check which builtin pickers are offered and
what options these implement
6. Profit
The below flow chart illustrates a simplified telescope architecture:
┌───────────────────────────────────────────────────────────┐
│ ┌────────┐ │
│ │ Multi │ ┌───────+ │
│ │ Select │ ┌───────┐ │ Entry │ │
│ └─────┬──* │ Entry │ ┌────────+ │ Maker │ │
│ │ ┌───│Manager│────│ Sorter │┐ └───┬───* │
│ ▼ ▼ └───────* └────────┘│ │ │
│ 1────────┐ 2───┴──┐ │ │
│ ┌─────│ Picker │ │Finder│◀────┘ │
│ ▼ └───┬────┘ └──────* │
│ ┌────────┐ │ 3────────+ ▲ │
│ │Selected│ └───────│ Prompt │─────────┘ │
│ │ Entry │ └───┬────┘ │
│ └────────* ┌───┴────┐ ┌────────┐ ┌────────┐ │
│ │ ▲ 4─────────┐│ Prompt │ │(Attach)│ │Actions │ │
│ ▼ └──▶ │ Results ││ Buffer │◀─┤Mappings│◀─┤User Fn │ │
│5─────────┐ └─────────┘└────────┘ └────────┘ └────────┘ │
││Previewer│ │
│└─────────┘ telescope.nvim architecture │
└───────────────────────────────────────────────────────────┘
+ The `Entry Maker` at least defines
- value: "raw" result of the finder
- ordinal: string to be sorted derived from value
- display: line representation of entry in results buffer
* The finder, entry manager, selected entry, and multi selections
comprises `entries` constructed by the `Entry Maker` from
raw results of the finder (`value`s)
Primary components:
1 Picker: central UI dedicated to varying use cases
(finding files, grepping, diagnostics, etc.)
see :h telescope.builtin
2 Finder: pipe or interactively generates results to pick over
3 Prompt: user input that triggers the finder which sorts results
in order into the entry manager
4 Results: listed entries scored by sorter from finder results
5 Previewer: preview of context of selected entry
see :h telescope.previewers
A practical introduction into telescope customization is our `developers.md`
(top-level of repo) and `:h telescope.actions` that showcase how to access
information about the state of the picker (current selection, etc.).
To find out more:
https://github.com/nvim-telescope/telescope.nvim
:h telescope.setup
:h telescope.command
:h telescope.builtin
:h telescope.themes
:h telescope.layout
:h telescope.resolve
:h telescope.actions
:h telescope.actions.state
:h telescope.actions.set
:h telescope.actions.utils
:h telescope.actions.generate
:h telescope.actions.history
:h telescope.previewers
telescope.setup({opts}) *telescope.setup()*
Setup function to be run by user. Configures the defaults, pickers and
extensions of telescope.
Usage:
>
require('telescope').setup{
defaults = {
-- Default configuration for telescope goes here:
-- config_key = value,
-- ..
},
pickers = {
-- Default configuration for builtin pickers goes here:
-- picker_name = {
-- picker_config_key = value,
-- ...
-- }
-- Now the picker_config_key will be applied every time you call this
-- builtin picker
},
extensions = {
-- Your extension configuration goes here:
-- extension_name = {
-- extension_config_key = value,
-- }
-- please take a look at the readme of the extension you want to configure
}
}
<
Valid keys for {opts.defaults}
*telescope.defaults.sorting_strategy*
sorting_strategy: ~
Determines the direction "better" results are sorted towards.
Available options are:
- "descending" (default)
- "ascending"
*telescope.defaults.selection_strategy*
selection_strategy: ~
Determines how the cursor acts after each sort iteration.
Available options are:
- "reset" (default)
- "follow"
- "row"
- "closest"
- "none"
*telescope.defaults.scroll_strategy*
scroll_strategy: ~
Determines what happens if you try to scroll past the view of the
picker.
Available options are:
- "cycle" (default)
- "limit"
*telescope.defaults.layout_strategy*
layout_strategy: ~
Determines the default layout of Telescope pickers.
See |telescope.layout| for details of the available strategies.
Default: 'horizontal'
*telescope.defaults.layout_config*
layout_config: ~
Determines the default configuration values for layout strategies.
See |telescope.layout| for details of the configurations options for
each strategy.
Allows setting defaults for all strategies as top level options and
for overriding for specific options.
For example, the default values below set the default width to 80% of
the screen width for all strategies except 'center', which has width
of 50% of the screen width.
Default: {
bottom_pane = {
height = 25,
preview_cutoff = 120,
prompt_position = "top"
},
center = {
height = 0.4,
preview_cutoff = 40,
prompt_position = "top",
width = 0.5
},
cursor = {
height = 0.9,
preview_cutoff = 40,
width = 0.8
},
horizontal = {
height = 0.9,
preview_cutoff = 120,
prompt_position = "bottom",
width = 0.8
},
vertical = {
height = 0.9,
preview_cutoff = 40,
prompt_position = "bottom",
width = 0.8
}
}
*telescope.defaults.cycle_layout_list*
cycle_layout_list: ~
Determines the layouts to cycle through when using `actions.layout.cycle_layout_next`
and `actions.layout.cycle_layout_prev`.
Should be a list of "layout setups".
Each "layout setup" can take one of two forms:
1. string
This is interpreted as the name of a `layout_strategy`
2. table
A table with possible keys `layout_strategy`, `layout_config` and `previewer`
Default: { "horizontal", "vertical" }
*telescope.defaults.winblend*
winblend: ~
Configure winblend for telescope floating windows. See |winblend| for
more information.
Default: 0
*telescope.defaults.wrap_results*
wrap_results: ~
Word wrap the search results
Default: false
*telescope.defaults.prompt_prefix*
prompt_prefix: ~
The character(s) that will be shown in front of Telescope's prompt.
Default: '> '
*telescope.defaults.selection_caret*
selection_caret: ~
The character(s) that will be shown in front of the current selection.
Default: '> '
*telescope.defaults.entry_prefix*
entry_prefix: ~
Prefix in front of each result entry. Current selection not included.
Default: ' '
*telescope.defaults.multi_icon*
multi_icon: ~
Symbol to add in front of a multi-selected result entry.
Replaces final character of |telescope.defaults.selection_caret| and
|telescope.defaults.entry_prefix| as appropriate.
To have no icon, set to the empty string.
Default: '+'
*telescope.defaults.initial_mode*
initial_mode: ~
Determines in which mode telescope starts. Valid Keys:
`insert` and `normal`.
Default: "insert"
*telescope.defaults.border*
border: ~
Boolean defining if borders are added to Telescope windows.
Default: true
*telescope.defaults.path_display*
path_display: ~
Determines how file paths are displayed.
path_display can be set to an array with a combination of:
- "hidden" hide file names
- "tail" only display the file name, and not the path
- "absolute" display absolute paths
- "smart" remove as much from the path as possible to only show
the difference between the displayed paths.
Warning: The nature of the algorithm might have a negative
performance impact!
- "shorten" only display the first character of each directory in
the path
- "truncate" truncates the start of the path when the whole path will
not fit. To increase the gap between the path and the edge,
set truncate to number `truncate = 3`
You can also specify the number of characters of each directory name
to keep by setting `path_display.shorten = num`.
e.g. for a path like
`alpha/beta/gamma/delta.txt`
setting `path_display.shorten = 1` will give a path like:
`a/b/g/delta.txt`
Similarly, `path_display.shorten = 2` will give a path like:
`al/be/ga/delta.txt`
You can also further customise the shortening behaviour by
setting `path_display.shorten = { len = num, exclude = list }`,
where `len` acts as above, and `exclude` is a list of positions
that are not shortened. Negative numbers in the list are considered
relative to the end of the path.
e.g. for a path like
`alpha/beta/gamma/delta.txt`
setting `path_display.shorten = { len = 1, exclude = {1, -1} }`
will give a path like:
`alpha/b/g/delta.txt`
setting `path_display.shorten = { len = 2, exclude = {2, -2} }`
will give a path like:
`al/beta/gamma/de`
path_display can also be set to 'hidden' string to hide file names
path_display can also be set to a function for custom formatting of
the path display. Example:
-- Format path as "file.txt (path\to\file\)"
path_display = function(opts, path)
local tail = require("telescope.utils").path_tail(path)
return string.format("%s (%s)", tail, path)
end,
Default: {}
*telescope.defaults.borderchars*
borderchars: ~
Set the borderchars of telescope floating windows. It has to be a
table of 8 string values.
Default: { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }
*telescope.defaults.get_status_text*
get_status_text: ~
A function that determines what the virtual text looks like.
Signature: function(picker) -> str
Default: function that shows current count / all
*telescope.defaults.hl_result_eol*
hl_result_eol: ~
Changes if the highlight for the selected item in the results
window is always the full width of the window
Default: true
*telescope.defaults.dynamic_preview_title*
dynamic_preview_title: ~
Will change the title of the preview window dynamically, where it
is supported. For example, the preview window's title could show up as
the full filename.
Default: false
*telescope.defaults.results_title*
results_title: ~
Defines the default title of the results window. A false value
can be used to hide the title altogether.
Default: "Results"
*telescope.defaults.prompt_title*
prompt_title: ~
Defines the default title of the prompt window. A false value
can be used to hide the title altogether. Most of the times builtins
define a prompt_title which will be preferred over this default.
Default: "Prompt"
*telescope.defaults.mappings*
mappings: ~
Your mappings to override telescope's default mappings.
See: ~
|telescope.mappings|
*telescope.defaults.default_mappings*
default_mappings: ~
Not recommended to use except for advanced users.
Will allow you to completely remove all of telescope's default maps
and use your own.
Default: nil
*telescope.defaults.history*
history: ~
This field handles the configuration for prompt history.
By default it is a table, with default values (more below).
To disable history, set it to false.
Currently mappings still need to be added, Example:
mappings = {
i = {
["<C-Down>"] = require('telescope.actions').cycle_history_next,
["<C-Up>"] = require('telescope.actions').cycle_history_prev,
},
},
Fields:
- path: The path to the telescope history as string.
Default: stdpath("data")/telescope_history
- limit: The amount of entries that will be written in the
history.
Warning: If limit is set to nil it will grow unbound.
Default: 100
- handler: A lua function that implements the history.
This is meant as a developer setting for extensions to
override the history handling, e.g.,
https://github.com/nvim-telescope/telescope-smart-history.nvim,
which allows context sensitive (cwd + picker) history.
Default:
require('telescope.actions.history').get_simple_history
*telescope.defaults.cache_picker*
cache_picker: ~
This field handles the configuration for picker caching.
By default it is a table, with default values (more below).
To disable caching, set it to false.
Caching preserves all previous multi selections and results and
therefore may result in slowdown or increased RAM occupation
if too many pickers (`cache_picker.num_pickers`) or entries
('cache_picker.limit_entries`) are cached.
Fields:
- num_pickers: The number of pickers to be cached.
Set to -1 to preserve all pickers of your session.
If passed to a picker, the cached pickers with
indices larger than `cache_picker.num_pickers` will
be cleared.
Default: 1
- limit_entries: The amount of entries that will be saved for each
picker.
Default: 1000
*telescope.defaults.preview*
preview: ~
This field handles the global configuration for previewers.
By default it is a table, with default values (more below).
To disable previewing, set it to false. If you have disabled previewers
globally, but want to opt in to previewing for single pickers, you will have to
pass `preview = true` or `preview = {...}` (your config) to the `opts` of
your picker.
Fields:
- check_mime_type: Use `file` if available to try to infer whether the
file to preview is a binary if plenary's
filetype detection fails.
Windows users get `file` from:
https://github.com/julian-r/file-windows
Set to false to attempt to preview any mime type.
Default: true for all OS excl. Windows
- filesize_limit: The maximum file size in MB attempted to be previewed.
Set to false to attempt to preview any file size.
Default: 25
- timeout: Timeout the previewer if the preview did not
complete within `timeout` milliseconds.
Set to false to not timeout preview.
Default: 250
- hook(s): Function(s) that takes `(filepath, bufnr, opts)`, where opts
exposes winid and ft (filetype).
Available hooks (in order of priority):
{filetype, mime, filesize, timeout}_hook
Important: the filetype_hook must return true or false
to indicate whether to continue (true) previewing or not (false),
respectively.
Two examples:
local putils = require("telescope.previewers.utils")
... -- preview is called in telescope.setup { ... }
preview = {
-- 1) Do not show previewer for certain files
filetype_hook = function(filepath, bufnr, opts)
-- you could analogously check opts.ft for filetypes
local excluded = vim.tbl_filter(function(ending)
return filepath:match(ending)
end, {
".*%.csv",
".*%.toml",
})
if not vim.tbl_isempty(excluded) then
putils.set_preview_message(
bufnr,
opts.winid,
string.format("I don't like %s files!",
excluded[1]:sub(5, -1))
)
return false
end
return true
end,
-- 2) Truncate lines to preview window for too large files
filesize_hook = function(filepath, bufnr, opts)
local path = require("plenary.path"):new(filepath)
-- opts exposes winid
local height = vim.api.nvim_win_get_height(opts.winid)
local lines = vim.split(path:head(height), "[\r]?\n")
vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, lines)
end,
}
The configuration recipes for relevant examples.
Note: if plenary does not recognize your filetype yet --
1) Please consider contributing to:
$PLENARY_REPO/data/plenary/filetypes/builtin.lua
2) Register your filetype locally as per link
https://github.com/nvim-lua/plenary.nvim#plenaryfiletype
Default: nil
- treesitter: Determines whether the previewer performs treesitter
highlighting, which falls back to regex-based highlighting.
`true`: treesitter highlighting for all available filetypes
`false`: regex-based highlighting for all filetypes
`table`: following nvim-treesitters highlighting options:
It contains two keys:
- enable boolean|table: if boolean, enable all ts
highlighing with that flag,
disable still considered.
Containing a list of filetypes,
that are enabled, disabled
ignored because it doesnt make
any sense in this case.
- disable table: containing a list of filetypes
that are disabled
Default: true
- msg_bg_fillchar: Character to fill background of unpreviewable buffers with
Default: "╱"
- hide_on_startup: Hide previewer when picker starts. Previewer can be toggled
with actions.layout.toggle_preview.
Default: false
*telescope.defaults.vimgrep_arguments*
vimgrep_arguments: ~
Defines the command that will be used for `live_grep` and `grep_string`
pickers.
Hint: Make sure that color is currently set to `never` because we do
not yet interpret color codes
Hint 2: Make sure that these options are in your changes arguments:
"--no-heading", "--with-filename", "--line-number", "--column"
because we need them so the ripgrep output is in the correct format.
Default: {
"rg",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--smart-case"
}
*telescope.defaults.use_less*
use_less: ~
Boolean if less should be enabled in term_previewer (deprecated and
currently no longer used in the builtin pickers).
Default: true
*telescope.defaults.set_env*
set_env: ~
Set an environment for term_previewer. A table of key values:
Example: { COLORTERM = "truecolor", ... }
Hint: Empty table is not allowed.
Default: nil
*telescope.defaults.color_devicons*
color_devicons: ~
Boolean if devicons should be enabled or not. If set to false, the
text highlight group is used.
Hint: Coloring only works if |termguicolors| is enabled.
Default: true
*telescope.defaults.file_sorter*
file_sorter: ~
A function pointer that specifies the file_sorter. This sorter will
be used for find_files, git_files and similar.
Hint: If you load a native sorter, you don't need to change this value,
the native sorter will override it anyway.
Default: require("telescope.sorters").get_fzy_sorter
*telescope.defaults.generic_sorter*
generic_sorter: ~
A function pointer to the generic sorter. The sorter that should be
used for everything that is not a file.
Hint: If you load a native sorter, you don't need to change this value,
the native sorter will override it anyway.
Default: require("telescope.sorters").get_fzy_sorter
*telescope.defaults.prefilter_sorter*
prefilter_sorter: ~
This points to a wrapper sorter around the generic_sorter that is able
to do prefiltering.
It's usually used for lsp_*_symbols and lsp_*_diagnostics
Default: require("telescope.sorters").prefilter
*telescope.defaults.tiebreak*
tiebreak: ~
A function that determines how to break a tie when two entries have
the same score.
Having a function that always returns false would keep the entries in
the order they are found, so existing_entry before current_entry.
Vice versa always returning true would place the current_entry
before the existing_entry.
Signature: function(current_entry, existing_entry, prompt) -> boolean
Default: function that breaks the tie based on the length of the
entry's ordinal
*telescope.defaults.file_ignore_patterns*
file_ignore_patterns: ~
A table of lua regex that define the files that should be ignored.
Example: { "^scratch/" } -- ignore all files in scratch directory
Example: { "%.npz" } -- ignore all npz files
See: https://www.lua.org/manual/5.1/manual.html#5.4.1 for more
information about lua regex
Note: `file_ignore_patterns` will be used in all pickers that have a
file associated. This might lead to the problem that lsp_ pickers
aren't displaying results because they might be ignored by
`file_ignore_patterns`. For example, setting up node_modules as ignored
will never show node_modules in any results, even if you are
interested in lsp_ results.
If you only want `file_ignore_patterns` for `find_files` and
`grep_string`/`live_grep` it is suggested that you setup `gitignore`
and have fd and or ripgrep installed because both tools will not show
`gitignore`d files on default.
Default: nil
*telescope.defaults.get_selection_window*
get_selection_window: ~
Function that takes function(picker, entry) and returns a window id.
The window ID will be used to decide what window the chosen file will
be opened in and the cursor placed in upon leaving the picker.
Default: `function() return 0 end`
*telescope.defaults.file_previewer*
file_previewer: ~
Function pointer to the default file_previewer. It is mostly used
for find_files, git_files and similar.
You can change this function pointer to either use your own
previewer or use the command-line program bat as the previewer:
require("telescope.previewers").cat.new
Default: require("telescope.previewers").vim_buffer_cat.new
*telescope.defaults.grep_previewer*
grep_previewer: ~
Function pointer to the default vim_grep previewer. It is mostly
used for live_grep, grep_string and similar.
You can change this function pointer to either use your own
previewer or use the command-line program bat as the previewer:
require("telescope.previewers").vimgrep.new
Default: require("telescope.previewers").vim_buffer_vimgrep.new
*telescope.defaults.qflist_previewer*
qflist_previewer: ~
Function pointer to the default qflist previewer. It is mostly
used for qflist, loclist and lsp.
You can change this function pointer to either use your own
previewer or use the command-line program bat as the previewer:
require("telescope.previewers").qflist.new
Default: require("telescope.previewers").vim_buffer_qflist.new
*telescope.defaults.buffer_previewer_maker*
buffer_previewer_maker: ~
Developer option that defines the underlining functionality
of the buffer previewer.
For interesting configuration examples take a look at
https://github.com/nvim-telescope/telescope.nvim/wiki/Configuration-Recipes
Default: require("telescope.previewers").buffer_previewer_maker
Parameters: ~
{opts} (table) Configuration opts. Keys: defaults, pickers,
extensions
telescope.load_extension({name}) *telescope.load_extension()*
Load an extension.
- Notes:
- Loading triggers ext setup via the config passed in |telescope.setup|
Parameters: ~
{name} (string) Name of the extension
telescope.register_extension({mod}) *telescope.register_extension()*
Register an extension. To be used by plugin authors.
Parameters: ~
{mod} (table) Module
telescope.extensions() *telescope.extensions()*
Use telescope.extensions to reference any extensions within your
configuration.
While the docs currently generate this as a function, it's actually a
table. Sorry.
================================================================================
COMMAND *telescope.command*
Telescope commands can be called through two apis, the lua api and the viml
api.
The lua api is the more direct way to interact with Telescope, as you directly
call the lua functions that Telescope defines. It can be called in a lua file
using commands like:
`require("telescope.builtin").find_files({hidden=true, layout_config={prompt_position="top"}})`
If you want to use this api from a vim file you should prepend `lua` to the
command, as below:
`lua require("telescope.builtin").find_files({hidden=true, layout_config={prompt_position="top"}})`
If you want to use this api from a neovim command line you should prepend
`:lua` to the command, as below:
`:lua require("telescope.builtin").find_files({hidden=true, layout_config={prompt_position="top"}})`
The viml api is more indirect, as first the command must be parsed to the
relevant lua equivalent, which brings some limitations. The viml api can be
called using commands like:
`:Telescope find_files hidden=true layout_config={"prompt_position":"top"}`
This involves setting options using an `=` and using viml syntax for lists and
dictionaries when the corresponding lua function requires a table.
One limitation of the viml api is that there can be no spaces in any of the
options. For example, if you want to use the `cwd` option for `find_files` to
specify that you only want to search within the folder `/foo bar/subfolder/`
you could not do that using the viml api, as the path name contains a space.
Similarly, you could NOT set the `prompt_position` to `"top"` using the
following command:
`:Telescope find_files layout_config={ "prompt_position" : "top" }`
as there are spaces in the option.
================================================================================
BUILTIN *telescope.builtin*
Telescope Builtins is a collection of community maintained pickers to support
common workflows. It can be used as reference when writing PRs, Telescope
extensions, your own custom pickers, or just as a discovery tool for all of the
amazing pickers already shipped with Telescope!
Any of these functions can just be called directly by doing:
:lua require('telescope.builtin').$NAME_OF_PICKER()
To use any of Telescope's default options or any picker-specific options, call
your desired picker by passing a lua table to the picker with all of the
options you want to use. Here's an example with the live_grep picker:
>
:lua require('telescope.builtin').live_grep({
prompt_title = 'find string in open buffers...',
grep_open_files = true
})
-- or with dropdown theme
:lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{
previewer = false
})
<
builtin.live_grep({opts}) *telescope.builtin.live_grep()*
Search for a string and get results live as you type, respects .gitignore
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{cwd} (string) root dir to search from
(default: cwd, use
utils.buffer_dir() to search
relative to open buffer)
{grep_open_files} (boolean) if true, restrict search to
open files only, mutually
exclusive with `search_dirs`
{search_dirs} (table) directory/directories/files to
search, mutually exclusive
with `grep_open_files`
{glob_pattern} (string|table) argument to be used with
`--glob`, e.g. "*.toml", can
use the opposite "!*.toml"
{type_filter} (string) argument to be used with
`--type`, e.g. "rust", see `rg
--type-list`
{additional_args} (function|table) additional arguments to be
passed on. Can be fn(opts) ->
tbl
{max_results} (number) define a upper result value
{disable_coordinates} (boolean) don't show the line & row
numbers (default: false)
builtin.grep_string({opts}) *telescope.builtin.grep_string()*
Searches for the string under your cursor in your current working directory
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{cwd} (string) root dir to search from
(default: cwd, use
utils.buffer_dir() to search
relative to open buffer)
{search} (string) the query to search
{grep_open_files} (boolean) if true, restrict search to
open files only, mutually
exclusive with `search_dirs`
{search_dirs} (table) directory/directories/files to
search, mutually exclusive
with `grep_open_files`
{use_regex} (boolean) if true, special characters
won't be escaped, allows for
using regex (default: false)
{word_match} (string) can be set to `-w` to enable
exact word matches
{additional_args} (function|table) additional arguments to be
passed on. Can be fn(opts) ->
tbl
{disable_coordinates} (boolean) don't show the line and row
numbers (default: false)
{only_sort_text} (boolean) only sort the text, not the
file, line or row (default:
false)
builtin.find_files({opts}) *telescope.builtin.find_files()*
Search for files (respecting .gitignore)
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{cwd} (string) root dir to search from
(default: cwd, use
utils.buffer_dir() to search
relative to open buffer)
{find_command} (function|table) cmd to use for the search. Can
be a fn(opts) -> tbl (default:
autodetect)
{file_entry_encoding} (string) encoding of output of
`find_command`
{follow} (boolean) if true, follows symlinks
(i.e. uses `-L` flag for the
`find` command)
{hidden} (boolean) determines whether to show
hidden files or not (default:
false)
{no_ignore} (boolean) show files ignored by
.gitignore, .ignore, etc.
(default: false)
{no_ignore_parent} (boolean) show files ignored by
.gitignore, .ignore, etc. in
parent dirs. (default: false)
{search_dirs} (table) directory/directories/files to
search
{search_file} (string) specify a filename to search
for
builtin.fd() *telescope.builtin.fd()*
This is an alias for the `find_files` picker
builtin.treesitter() *telescope.builtin.treesitter()*
Lists function names, variables, and other symbols from treesitter queries
- Default keymaps:
- `<C-l>`: show autocompletion menu to prefilter your query by kind of ts
node you want to see (i.e. `:var:`)
Options: ~
{show_line} (boolean) if true, shows the row:column that the
result is found at (default: true)
{bufnr} (number) specify the buffer number where
treesitter should run. (default:
current buffer)
{symbol_highlights} (table) string -> string. Matches symbol with
hl_group
builtin.current_buffer_fuzzy_find({opts}) *telescope.builtin.current_buffer_fuzzy_find()*
Live fuzzy search inside of the currently open buffer
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{skip_empty_lines} (boolean) if true we don't display empty lines
(default: false)
builtin.tags({opts}) *telescope.builtin.tags()*
Lists tags in current directory with tag location file preview (users are
required to run ctags -R to generate tags or update when introducing new
changes)
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{cwd} (string) root dir to search from (default: cwd, use
utils.buffer_dir() to search relative to
open buffer)
{ctags_file} (string) specify a particular ctags file to use
{show_line} (boolean) if true, shows the content of the line the
tag is found on in the picker (default:
true)
{only_sort_tags} (boolean) if true we will only sort tags (default:
false)
{fname_width} (number) defines the width of the filename section
(default: 30)
builtin.current_buffer_tags({opts}) *telescope.builtin.current_buffer_tags()*
Lists all of the tags for the currently open buffer, with a preview
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{cwd} (string) root dir to search from (default: cwd, use
utils.buffer_dir() to search relative to
open buffer)
{ctags_file} (string) specify a particular ctags file to use
{show_line} (boolean) if true, shows the content of the line the
tag is found on in the picker (default:
true)
{only_sort_tags} (boolean) if true we will only sort tags (default:
false)
{fname_width} (number) defines the width of the filename section
(default: 30)
builtin.git_files({opts}) *telescope.builtin.git_files()*
Fuzzy search for files tracked by Git. This command lists the output of the
`git ls-files` command, respects .gitignore
- Default keymaps:
- `<cr>`: opens the currently selected file
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{cwd} (string) specify the path of the repo
{use_git_root} (boolean) if we should use git root as cwd or
the cwd (important for submodule)
(default: true)
{show_untracked} (boolean) if true, adds `--others` flag to
command and shows untracked files
(default: false)
{recurse_submodules} (boolean) if true, adds the
`--recurse-submodules` flag to command
(default: false)
{git_command} (table) command that will be executed.
{"git","ls-files","--exclude-standard","--cached"}
builtin.git_commits({opts}) *telescope.builtin.git_commits()*
Lists commits for current directory with diff preview
- Default keymaps:
- `<cr>`: checks out the currently selected commit
- `<C-r>m`: resets current branch to selected commit using mixed mode
- `<C-r>s`: resets current branch to selected commit using soft mode
- `<C-r>h`: resets current branch to selected commit using hard mode
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{cwd} (string) specify the path of the repo
{use_git_root} (boolean) if we should use git root as cwd or the cwd
(important for submodule) (default: true)
{git_command} (table) command that will be executed.
{"git","log","--pretty=oneline","--abbrev-commit","--","."}
builtin.git_bcommits({opts}) *telescope.builtin.git_bcommits()*
Lists commits for current buffer with diff preview
- Default keymaps or your overridden `select_` keys:
- `<cr>`: checks out the currently selected commit
- `<c-v>`: opens a diff in a vertical split
- `<c-x>`: opens a diff in a horizontal split
- `<c-t>`: opens a diff in a new tab
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{cwd} (string) specify the path of the repo
{use_git_root} (boolean) if we should use git root as cwd or the cwd
(important for submodule) (default: true)
{current_file} (string) specify the current file that should be used
for bcommits (default: current buffer)
{git_command} (table) command that will be executed.
{"git","log","--pretty=oneline","--abbrev-commit"}
builtin.git_branches({opts}) *telescope.builtin.git_branches()*
List branches for current directory, with output from `git log --oneline`
shown in the preview window
- Default keymaps:
- `<cr>`: checks out the currently selected branch
- `<C-t>`: tracks currently selected branch
- `<C-r>`: rebases currently selected branch
- `<C-a>`: creates a new branch, with confirmation prompt before creation
- `<C-d>`: deletes the currently selected branch, with confirmation
prompt before deletion
- `<C-y>`: merges the currently selected branch, with confirmation prompt
before deletion
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{cwd} (string) specify the path of the
repo
{use_git_root} (boolean) if we should use git root
as cwd or the cwd
(important for submodule)
(default: true)
{show_remote_tracking_branches} (boolean) show remote tracking
branches like origin/main
(default: true)
{pattern} (string) specify the pattern to
match all refs
builtin.git_status({opts}) *telescope.builtin.git_status()*
Lists git status for current directory
- Default keymaps:
- `<Tab>`: stages or unstages the currently selected file
- `<cr>`: opens the currently selected file
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{cwd} (string) specify the path of the repo
{use_git_root} (boolean) if we should use git root as cwd or the cwd
(important for submodule) (default: true)
{git_icons} (table) string -> string. Matches name with icon
(see source code, make_entry.lua
git_icon_defaults)
builtin.git_stash({opts}) *telescope.builtin.git_stash()*
Lists stash items in current repository
- Default keymaps:
- `<cr>`: runs `git apply` for currently selected stash
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{cwd} (string) specify the path of the repo
{use_git_root} (boolean) if we should use git root as cwd or the cwd
(important for submodule) (default: true)
{show_branch} (boolean) if we should display the branch name for git
stash entries (default: true)
builtin.builtin({opts}) *telescope.builtin.builtin()*
Lists all of the community maintained pickers built into Telescope
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{include_extensions} (boolean) if true will show the pickers of the
installed extensions (default: false)
{use_default_opts} (boolean) if the selected picker should use its
default options (default: false)
builtin.resume({opts}) *telescope.builtin.resume()*
Opens the previous picker in the identical state (incl. multi selections)
- Notes:
- Requires `cache_picker` in setup or when having invoked pickers, see
|telescope.defaults.cache_picker|
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{cache_index} (number) what picker to resume, where 1 denotes most
recent (default: 1)
builtin.pickers({opts}) *telescope.builtin.pickers()*
Opens a picker over previously cached pickers in their preserved states
(incl. multi selections)
- Default keymaps:
- `<C-x>`: delete the selected cached picker
- Notes:
- Requires `cache_picker` in setup or when having invoked pickers, see
|telescope.defaults.cache_picker|
Parameters: ~
{opts} (table) options to pass to the picker
builtin.planets({opts}) *telescope.builtin.planets()*
Use the telescope...
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{show_pluto} (boolean) we love Pluto (default: false, because its a
hidden feature)
{show_moon} (boolean) we love the Moon (default: false, because its
a hidden feature)
builtin.symbols({opts}) *telescope.builtin.symbols()*
Lists symbols inside of `data/telescope-sources/*.json` found in your
runtime path or found in `stdpath("data")/telescope/symbols/*.json`. The
second path can be customized. We provide a couple of default symbols which
can be found in https://github.com/nvim-telescope/telescope-symbols.nvim.
This repos README also provides more information about the format in which
the symbols have to be.
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{symbol_path} (string) specify the second path. Default:
`stdpath("data")/telescope/symbols/*.json`
{sources} (table) specify a table of sources you want to load
this time
builtin.commands({opts}) *telescope.builtin.commands()*
Lists available plugin/user commands and runs them on `<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{show_buf_command} (boolean) show buf local command (Default: true)
builtin.quickfix({opts}) *telescope.builtin.quickfix()*
Lists items in the quickfix list, jumps to location on `<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{show_line} (boolean) show results text (default: true)
{trim_text} (boolean) trim results text (default: false)
{fname_width} (number) defines the width of the filename section
(default: 30)
{nr} (number) specify the quickfix list number
builtin.quickfixhistory({opts}) *telescope.builtin.quickfixhistory()*
Lists all quickfix lists in your history and open them with
`builtin.quickfix`. It seems that neovim only keeps the full history for 10
lists
Parameters: ~
{opts} (table) options to pass to the picker
builtin.loclist({opts}) *telescope.builtin.loclist()*
Lists items from the current window's location list, jumps to location on
`<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{show_line} (boolean) show results text (default: true)
{trim_text} (boolean) trim results text (default: false)
{fname_width} (number) defines the width of the filename section
(default: 30)
builtin.oldfiles({opts}) *telescope.builtin.oldfiles()*
Lists previously open files, opens on `<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{only_cwd} (boolean) show only files in the cwd (default: false)
{cwd_only} (boolean) alias for only_cwd
builtin.command_history({opts}) *telescope.builtin.command_history()*
Lists commands that were executed recently, and reruns them on `<cr>`
- Default keymaps:
- `<C-e>`: open the command line with the text of the currently selected
result populated in it
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{filter_fn} (function) filter fn(cmd:string). true if the history
command should be presented.
builtin.search_history({opts}) *telescope.builtin.search_history()*
Lists searches that were executed recently, and reruns them on `<cr>`
- Default keymaps:
- `<C-e>`: open a search window with the text of the currently selected
search result populated in it
Parameters: ~
{opts} (table) options to pass to the picker
builtin.vim_options({opts}) *telescope.builtin.vim_options()*
Lists vim options, allows you to edit the current value on `<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
builtin.help_tags({opts}) *telescope.builtin.help_tags()*
Lists available help tags and opens a new window with the relevant help
info on `<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{lang} (string) specify language (default: vim.o.helplang)
{fallback} (boolean) fallback to en if language isn't installed
(default: true)
builtin.man_pages({opts}) *telescope.builtin.man_pages()*
Lists manpage entries, opens them in a help window on `<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{sections} (table) a list of sections to search, use `{ "ALL" }`
to search in all sections (default: { "1" })
{man_cmd} (function) that returns the man command. (Default:
`apropos ""` on linux, `apropos " "` on macos)
builtin.reloader({opts}) *telescope.builtin.reloader()*
Lists lua modules and reloads them on `<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{column_len} (number) define the max column len for the module name
(default: dynamic, longest module name)
builtin.buffers({opts}) *telescope.builtin.buffers()*
Lists open buffers in current neovim instance, opens selected buffer on
`<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{show_all_buffers} (boolean) if true, show all buffers,
including unloaded buffers
(default: true)
{ignore_current_buffer} (boolean) if true, don't show the current
buffer in the list (default: false)
{only_cwd} (boolean) if true, only show buffers in the
current working directory (default:
false)
{cwd_only} (boolean) alias for only_cwd
{sort_lastused} (boolean) Sorts current and last buffer to
the top and selects the lastused
(default: false)
{sort_mru} (boolean) Sorts all buffers after most recent
used. Not just the current and last
one (default: false)
{bufnr_width} (number) Defines the width of the buffer
numbers in front of the filenames
(default: dynamic)
builtin.colorscheme({opts}) *telescope.builtin.colorscheme()*
Lists available colorschemes and applies them on `<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{enable_preview} (boolean) if true, will preview the selected color
builtin.marks({opts}) *telescope.builtin.marks()*
Lists vim marks and their value, jumps to the mark on `<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
builtin.registers({opts}) *telescope.builtin.registers()*
Lists vim registers, pastes the contents of the register on `<cr>`
- Default keymaps:
- `<C-e>`: edit the contents of the currently selected register
Parameters: ~
{opts} (table) options to pass to the picker
builtin.keymaps({opts}) *telescope.builtin.keymaps()*
Lists normal mode keymappings, runs the selected keymap on `<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{modes} (table) a list of short-named keymap modes to search
(default: { "n", "i", "c", "x" })
{show_plug} (boolean) if true, the keymaps for which the lhs
contains "<Plug>" are also shown (default:
true)
{only_buf} (boolean) if true, only show the buffer-local keymaps
(default: false)
{lhs_filter} (function) filter(lhs:string) -> boolean. true if the
keymap should be shown (optional)
builtin.filetypes({opts}) *telescope.builtin.filetypes()*
Lists all available filetypes, sets currently open buffer's filetype to
selected filetype in Telescope on `<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
builtin.highlights({opts}) *telescope.builtin.highlights()*
Lists all available highlights
Parameters: ~
{opts} (table) options to pass to the picker
builtin.autocommands({opts}) *telescope.builtin.autocommands()*
Lists vim autocommands and goes to their declaration on `<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
builtin.spell_suggest({opts}) *telescope.builtin.spell_suggest()*
Lists spelling suggestions for the current word under the cursor, replaces
word with selected suggestion on `<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
builtin.tagstack({opts}) *telescope.builtin.tagstack()*
Lists the tag stack for the current window, jumps to tag on `<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{show_line} (boolean) show results text (default: true)
{trim_text} (boolean) trim results text (default: false)
{fname_width} (number) defines the width of the filename section
(default: 30)
builtin.jumplist({opts}) *telescope.builtin.jumplist()*
Lists items from Vim's jumplist, jumps to location on `<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{show_line} (boolean) show results text (default: true)
{trim_text} (boolean) trim results text (default: false)
{fname_width} (number) defines the width of the filename section
(default: 30)
builtin.lsp_references({opts}) *telescope.builtin.lsp_references()*
Lists LSP references for word under the cursor, jumps to reference on
`<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{include_declaration} (boolean) include symbol declaration in the
lsp references (default: true)
{include_current_line} (boolean) include current line (default:
false)
{jump_type} (string) how to goto reference if there is
only one, values: "tab", "split",
"vsplit", "never"
{fname_width} (number) defines the width of the filename
section (default: 30)
{show_line} (boolean) show results text (default: true)
{trim_text} (boolean) trim results text (default: false)
builtin.lsp_incoming_calls({opts}) *telescope.builtin.lsp_incoming_calls()*
Lists LSP incoming calls for word under the cursor, jumps to reference on
`<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{fname_width} (number) defines the width of the filename section
(default: 30)
{show_line} (boolean) show results text (default: true)
{trim_text} (boolean) trim results text (default: false)
builtin.lsp_outgoing_calls({opts}) *telescope.builtin.lsp_outgoing_calls()*
Lists LSP outgoing calls for word under the cursor, jumps to reference on
`<cr>`
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{fname_width} (number) defines the width of the filename section
(default: 30)
{show_line} (boolean) show results text (default: true)
{trim_text} (boolean) trim results text (default: false)
builtin.lsp_definitions({opts}) *telescope.builtin.lsp_definitions()*
Goto the definition of the word under the cursor, if there's only one,
otherwise show all options in Telescope
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{jump_type} (string) how to goto definition if there is only one,
values: "tab", "split", "vsplit", "never"
{fname_width} (number) defines the width of the filename section
(default: 30)
{show_line} (boolean) show results text (default: true)
{trim_text} (boolean) trim results text (default: false)
builtin.lsp_type_definitions({opts}) *telescope.builtin.lsp_type_definitions()*
Goto the definition of the type of the word under the cursor, if there's
only one, otherwise show all options in Telescope
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{jump_type} (string) how to goto definition if there is only one,
values: "tab", "split", "vsplit", "never"
{fname_width} (number) defines the width of the filename section
(default: 30)
{show_line} (boolean) show results text (default: true)
{trim_text} (boolean) trim results text (default: false)
builtin.lsp_implementations({opts}) *telescope.builtin.lsp_implementations()*
Goto the implementation of the word under the cursor if there's only one,
otherwise show all options in Telescope
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{jump_type} (string) how to goto implementation if there is only
one, values: "tab", "split", "vsplit",
"never"
{fname_width} (number) defines the width of the filename section
(default: 30)
{show_line} (boolean) show results text (default: true)
{trim_text} (boolean) trim results text (default: false)
builtin.lsp_document_symbols({opts}) *telescope.builtin.lsp_document_symbols()*
Lists LSP document symbols in the current buffer
- Default keymaps:
- `<C-l>`: show autocompletion menu to prefilter your query by type of
symbol you want to see (i.e. `:variable:`)
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{fname_width} (number) defines the width of the filename
section (default: 30)
{show_line} (boolean) if true, shows the content of the
line the tag is found on (default:
false)
{symbols} (string|table) filter results by symbol kind(s)
{ignore_symbols} (string|table) list of symbols to ignore
{symbol_highlights} (table) string -> string. Matches symbol
with hl_group
builtin.lsp_workspace_symbols({opts}) *telescope.builtin.lsp_workspace_symbols()*
Lists LSP document symbols in the current workspace
- Default keymaps:
- `<C-l>`: show autocompletion menu to prefilter your query by type of
symbol you want to see (i.e. `:variable:`)
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{query} (string) for what to query the workspace
(default: "")
{fname_width} (number) defines the width of the filename
section (default: 30)
{show_line} (boolean) if true, shows the content of the
line the tag is found on (default:
false)
{symbols} (string|table) filter results by symbol kind(s)
{ignore_symbols} (string|table) list of symbols to ignore
{symbol_highlights} (table) string -> string. Matches symbol
with hl_group
builtin.lsp_dynamic_workspace_symbols({opts}) *telescope.builtin.lsp_dynamic_workspace_symbols()*
Dynamically lists LSP for all workspace symbols
- Default keymaps:
- `<C-l>`: show autocompletion menu to prefilter your query by type of
symbol you want to see (i.e. `:variable:`)
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{fname_width} (number) defines the width of the filename
section (default: 30)
{show_line} (boolean) if true, shows the content of the
line the symbol is found on
(default: false)
{symbols} (string|table) filter results by symbol kind(s)
{ignore_symbols} (string|table) list of symbols to ignore
{symbol_highlights} (table) string -> string. Matches symbol
with hl_group
builtin.diagnostics({opts}) *telescope.builtin.diagnostics()*
Lists diagnostics
- Fields:
- `All severity flags can be passed as `string` or `number` as per
`:vim.diagnostic.severity:`
- Default keymaps:
- `<C-l>`: show autocompletion menu to prefilter your query with the
diagnostic you want to see (i.e. `:warning:`)
Parameters: ~
{opts} (table) options to pass to the picker
Options: ~
{bufnr} (number|nil) Buffer number to get diagnostics
from. Use 0 for current buffer or
nil for all buffers
{severity} (string|number) filter diagnostics by severity name
(string) or id (number)
{severity_limit} (string|number) keep diagnostics equal or more
severe wrt severity name (string)
or id (number)
{severity_bound} (string|number) keep diagnostics equal or less
severe wrt severity name (string)
or id (number)
{root_dir} (string|boolean) if set to string, get diagnostics
only for buffers under this dir
otherwise cwd
{no_unlisted} (boolean) if true, get diagnostics only for
listed buffers
{no_sign} (boolean) hide DiagnosticSigns from Results
(default: false)
{line_width} (number) set length of diagnostic entry text
in Results
{namespace} (number) limit your diagnostics to a
specific namespace
================================================================================
THEMES *telescope.themes*
Themes are ways to combine several elements of styling together.
They are helpful for managing the several different UI aspects for telescope
and provide a simple interface for users to get a particular "style" of picker.
themes.get_dropdown() *telescope.themes.get_dropdown()*
Dropdown style theme.
Usage:
>
local opts = {...} -- picker options
local builtin = require('telescope.builtin')
local themes = require('telescope.themes')
builtin.find_files(themes.get_dropdown(opts))
<
themes.get_cursor() *telescope.themes.get_cursor()*
Cursor style theme.
Usage:
>
local opts = {...} -- picker options
local builtin = require('telescope.builtin')
local themes = require('telescope.themes')
builtin.find_files(themes.get_cursor(opts))
<
themes.get_ivy() *telescope.themes.get_ivy()*
Ivy style theme.
Usage:
>
local opts = {...} -- picker options
local builtin = require('telescope.builtin')
local themes = require('telescope.themes')
builtin.find_files(themes.get_ivy(opts))
<
================================================================================
MAPPINGS *telescope.mappings*
|telescope.mappings| is used to configure the keybindings within a telescope
picker. These key binds are only local to the picker window and will be cleared
once you exit the picker.
We provide multiple configuration options to make it easy for you to adjust
telescope's default key bindings and create your own custom key binds.
To see many of the builtin actions that you can use as values for this table,
see |telescope.actions|
Format is:
>
{
mode = { ..keys }
}
<
where {mode} is the one character letter for a mode ('i' for insert, 'n' for
normal).
For example:
>
mappings = {
i = {
["<esc>"] = require('telescope.actions').close,
},
}
<
To disable a keymap, put `[map] = false`
For example:
>
{
...,
["<C-n>"] = false,
...,
}
<
To override behavior of a key, simply set the value to be a function (either by
requiring an action or by writing your own function)
>
{
...,
["<C-i>"] = require('telescope.actions').select_default,
...,
}
<
If the function you want is part of `telescope.actions`, then you can simply
supply the function name as a string. For example, the previous option is
equivalent to:
>
{
...,
["<C-i>"] = "select_default",
...,
}
<
You can also add other mappings using tables with `type = "command"`. For
example:
>
{
...,
["jj"] = { "<esc>", type = "command" },
["kk"] = { "<cmd>echo \"Hello, World!\"<cr>", type = "command" },)
...,
}
<
You can also add additional options for mappings of any type ("action" and
"command"). For example:
>
{
...,
["<C-j>"] = {
actions.move_selection_next, type = "action",
opts = { nowait = true, silent = true }
},
...,
}
<
There are three main places you can configure |telescope.mappings|. These are
ordered from the lowest priority to the highest priority.
1. |telescope.defaults.mappings|
2. In the |telescope.setup()| table, inside a picker with a given name, use the
`mappings` key
>
require("telescope").setup {
pickers = {
find_files = {
mappings = {
n = {
["kj"] = "close",
},
},
},
},
}
<
3. `attach_mappings` function for a particular picker.
>
require("telescope.builtin").find_files {
attach_mappings = function(_, map)
map("i", "asdf", function(_prompt_bufnr)
print "You typed asdf"
end)
map({"i", "n"}, "<C-r>", function(_prompt_bufnr)
print "You typed <C-r>"
end)
-- needs to return true if you want to map default_mappings and
-- false if not
return true
end,
}
<
================================================================================
LAYOUT *telescope.layout*
The layout of telescope pickers can be adjusted using the
|telescope.defaults.layout_strategy| and |telescope.defaults.layout_config|
options. For example, the following configuration changes the default layout
strategy and the default size of the picker:
>
require('telescope').setup{
defaults = {
layout_strategy = 'vertical',
layout_config = { height = 0.95 },
},
}
<
────────────────────────────────────────────────────────────────────────────────
Layout strategies are different functions to position telescope.
All layout strategies are functions with the following signature:
>
function(picker, columns, lines, layout_config)
-- Do some calculations here...
return {
preview = preview_configuration
results = results_configuration,
prompt = prompt_configuration,
}
end
<
Parameters: ~
- picker : A Picker object. (docs coming soon)
- columns : (number) Columns in the vim window
- lines : (number) Lines in the vim window
- layout_config : (table) The configuration values specific to the picker.
This means you can create your own layout strategy if you want! Just be aware
for now that we may change some APIs or interfaces, so they may break if you
create your own.
A good method for creating your own would be to copy one of the strategies that
most resembles what you want from
"./lua/telescope/pickers/layout_strategies.lua" in the telescope repo.
layout_strategies.horizontal() *telescope.layout.horizontal()*
Horizontal layout has two columns, one for the preview and one for the
prompt and results.
┌──────────────────────────────────────────────────┐
│ │
│ ┌───────────────────┐┌───────────────────┐ │
│ │ ││ │ │
│ │ ││ │ │
│ │ ││ │ │
│ │ Results ││ │ │
│ │ ││ Preview │ │
│ │ ││ │ │
│ │ ││ │ │
│ └───────────────────┘│ │ │
│ ┌───────────────────┐│ │ │
│ │ Prompt ││ │ │
│ └───────────────────┘└───────────────────┘ │
│ │
└──────────────────────────────────────────────────┘
`picker.layout_config` shared options:
- anchor:
- Which edge/corner to pin the picker to
- See |resolver.resolve_anchor_pos()|
- height:
- How tall to make Telescope's entire layout
- See |resolver.resolve_height()|
- mirror: Flip the location of the results/prompt and preview windows
- prompt_position:
- Where to place prompt window.
- Available Values: 'bottom', 'top'
- scroll_speed: The number of lines to scroll through the previewer
- width:
- How wide to make Telescope's entire layout
- See |resolver.resolve_width()|
`picker.layout_config` unique options:
- preview_cutoff: When columns are less than this value, the preview will be disabled
- preview_width:
- Change the width of Telescope's preview window
- See |resolver.resolve_width()|
layout_strategies.center() *telescope.layout.center()*
Centered layout with a combined block of the prompt and results aligned to
the middle of the screen. The preview window is then placed in the
remaining space above or below, according to `anchor` or `mirror`.
Particularly useful for creating dropdown menus (see |telescope.themes| and
|themes.get_dropdown()|).
Note that vertical anchoring, i.e. `anchor` containing `"N"` or `"S"`, will
override `mirror` config. For `"N"` anchoring preview will be placed below
prompt/result block. For `"S"` anchoring preview will be placed above
prompt/result block. For horizontal only anchoring preview will be placed
according to `mirror` config, default is above the prompt/result block.
┌──────────────────────────────────────────────────┐
│ ┌────────────────────────────────────────┐ │
│ | Preview | │
│ | Preview | │
│ └────────────────────────────────────────┘ │
│ ┌────────────────────────────────────────┐ │
│ | Prompt | │
│ ├────────────────────────────────────────┤ │
│ | Result | │
│ | Result | │
│ └────────────────────────────────────────┘ │
│ │
│ │
│ │
│ │
└──────────────────────────────────────────────────┘
`picker.layout_config` shared options:
- anchor:
- Which edge/corner to pin the picker to
- See |resolver.resolve_anchor_pos()|
- height:
- How tall to make Telescope's entire layout
- See |resolver.resolve_height()|
- mirror: Flip the location of the results/prompt and preview windows
- prompt_position:
- Where to place prompt window.
- Available Values: 'bottom', 'top'
- scroll_speed: The number of lines to scroll through the previewer
- width:
- How wide to make Telescope's entire layout
- See |resolver.resolve_width()|
`picker.layout_config` unique options:
- preview_cutoff: When lines are less than this value, the preview will be disabled
layout_strategies.cursor() *telescope.layout.cursor()*
Cursor layout dynamically positioned below the cursor if possible. If there
is no place below the cursor it will be placed above.
┌──────────────────────────────────────────────────┐
│ │
│ █ │
│ ┌──────────────┐┌─────────────────────┐ │
│ │ Prompt ││ Preview │ │
│ ├──────────────┤│ Preview │ │
│ │ Result ││ Preview │ │
│ │ Result ││ Preview │ │
│ └──────────────┘└─────────────────────┘ │
│ █ │
│ │
│ │
│ │
│ │
│ │
└──────────────────────────────────────────────────┘
`picker.layout_config` shared options:
- height:
- How tall to make Telescope's entire layout
- See |resolver.resolve_height()|
- scroll_speed: The number of lines to scroll through the previewer
- width:
- How wide to make Telescope's entire layout
- See |resolver.resolve_width()|
`picker.layout_config` unique options:
- preview_cutoff: When columns are less than this value, the preview will be disabled
- preview_width:
- Change the width of Telescope's preview window
- See |resolver.resolve_width()|
layout_strategies.vertical() *telescope.layout.vertical()*
Vertical layout stacks the items on top of each other. Particularly useful
with thinner windows.
┌──────────────────────────────────────────────────┐
│ │
│ ┌────────────────────────────────────────┐ │
│ | Preview | │
│ | Preview | │
│ | Preview | │
│ └────────────────────────────────────────┘ │
│ ┌────────────────────────────────────────┐ │
│ | Result | │
│ | Result | │
│ └────────────────────────────────────────┘ │
│ ┌────────────────────────────────────────┐ │
│ | Prompt | │
│ └────────────────────────────────────────┘ │
│ │
└──────────────────────────────────────────────────┘
`picker.layout_config` shared options:
- anchor:
- Which edge/corner to pin the picker to
- See |resolver.resolve_anchor_pos()|
- height:
- How tall to make Telescope's entire layout
- See |resolver.resolve_height()|
- mirror: Flip the location of the results/prompt and preview windows
- prompt_position:
- Where to place prompt window.
- Available Values: 'bottom', 'top'
- scroll_speed: The number of lines to scroll through the previewer
- width:
- How wide to make Telescope's entire layout
- See |resolver.resolve_width()|
`picker.layout_config` unique options:
- preview_cutoff: When lines are less than this value, the preview will be disabled
- preview_height:
- Change the height of Telescope's preview window
- See |resolver.resolve_height()|
layout_strategies.flex() *telescope.layout.flex()*
Flex layout swaps between `horizontal` and `vertical` strategies based on
the window width
- Supports |layout_strategies.vertical| or |layout_strategies.horizontal|
features
`picker.layout_config` shared options:
- anchor:
- Which edge/corner to pin the picker to
- See |resolver.resolve_anchor_pos()|
- height:
- How tall to make Telescope's entire layout
- See |resolver.resolve_height()|
- mirror: Flip the location of the results/prompt and preview windows
- prompt_position:
- Where to place prompt window.
- Available Values: 'bottom', 'top'
- scroll_speed: The number of lines to scroll through the previewer
- width:
- How wide to make Telescope's entire layout
- See |resolver.resolve_width()|
`picker.layout_config` unique options:
- flip_columns: The number of columns required to move to horizontal mode
- flip_lines: The number of lines required to move to horizontal mode
- horizontal: Options to pass when switching to horizontal layout
- vertical: Options to pass when switching to vertical layout
layout_strategies.bottom_pane() *telescope.layout.bottom_pane()*
Bottom pane can be used to create layouts similar to "ivy".
For an easy ivy configuration, see |themes.get_ivy()|
================================================================================
RESOLVE *telescope.resolve*
Provides "resolver functions" to allow more customisable inputs for options.
resolver.resolve_height() *telescope.resolve.resolve_height()*
Converts input to a function that returns the height. The input must take
one of five forms:
1. 0 <= number < 1
This means total height as a percentage.
2. 1 <= number
This means total height as a fixed number.
3. function
Must have signature: function(self, max_columns, max_lines): number
4. table of the form: { val, max = ..., min = ... }
val has to be in the first form 0 <= val < 1 and only one is given,
`min` or `max` as fixed number
5. table of the form: {padding = `foo`}
where `foo` has one of the previous three forms.
The height is then set to be the remaining space after padding. For
example, if the window has height 50, and the input is {padding = 5},
the height returned will be `40 = 50 - 2*5`
The returned function will have signature: function(self, max_columns,
max_lines): number
resolver.resolve_width() *telescope.resolve.resolve_width()*
Converts input to a function that returns the width. The input must take
one of five forms:
1. 0 <= number < 1
This means total width as a percentage.
2. 1 <= number
This means total width as a fixed number.
3. function
Must have signature: function(self, max_columns, max_lines): number
4. table of the form: { val, max = ..., min = ... }
val has to be in the first form 0 <= val < 1 and only one is given,
`min` or `max` as fixed number
5. table of the form: {padding = `foo`}
where `foo` has one of the previous three forms.
The width is then set to be the remaining space after padding. For
example, if the window has width 100, and the input is {padding = 5},
the width returned will be `90 = 100 - 2*5`
The returned function will have signature: function(self, max_columns,
max_lines): number
resolver.resolve_anchor_pos() *telescope.resolve.resolve_anchor_pos()*
Calculates the adjustment required to move the picker from the middle of
the screen to an edge or corner.
The `anchor` can be any of the following strings:
- "", "CENTER", "NW", "N", "NE", "E", "SE", "S", "SW", "W" The anchors
have the following meanings:
- "" or "CENTER":
the picker will remain in the middle of the screen.
- Compass directions:
the picker will move to the corresponding edge/corner e.g. "NW" -> "top
left corner", "E" -> "right edge", "S" -> "bottom edge"
================================================================================
MAKE_ENTRY *telescope.make_entry*
Each picker has a finder made up of two parts, the results which are the data
to be displayed, and the entry_maker. These entry_makers are functions returned
from make_entry functions. These will be referred to as entry_makers in the
following documentation.
Every entry maker returns a function that accepts the data to be used for an
entry. This function will return an entry table (or nil, meaning skip this
entry) which contains the following important keys:
- value any: value key can be anything but still required
- valid bool (optional): is an optional key because it defaults to true but if
the key is set to false it will not be displayed by the picker
- ordinal string: is the text that is used for filtering
- display string|function: is either a string of the text that is being
displayed or a function receiving the entry at a later stage, when the entry
is actually being displayed. A function can be useful here if a complex
calculation has to be done. `make_entry` can also return a second value - a
highlight array which will then apply to the line. Highlight entry in this
array has the following signature `{ { start_col, end_col }, hl_group }`
- filename string (optional): will be interpreted by the default `<cr>` action
as open this file
- bufnr number (optional): will be interpreted by the default `<cr>` action as
open this buffer
- lnum number (optional): lnum value which will be interpreted by the default
`<cr>` action as a jump to this line
- col number (optional): col value which will be interpreted by the default
`<cr>` action as a jump to this column
For more information on easier displaying, see
|telescope.pickers.entry_display|
TODO: Document something we call `entry_index`
================================================================================
ENTRY_DISPLAY *telescope.pickers.entry_display*
Entry Display is used to format each entry shown in the result panel.
Entry Display create() will give us a function based on the configuration of
column widths we pass into it. We then can use this function n times to return
a string based on structured input.
Note that if you call `create()` inside `make_display` it will be called for
every single entry. So it is suggested to do this outside of `make_display` for
the best performance.
The create function will use the column widths passed to it in
configuration.items. Each item in that table is the number of characters in the
column. It's also possible for the final column to not have a fixed width, this
will be shown in the configuration as 'remaining = true'.
An example of this configuration is shown for the buffers picker:
>
local displayer = entry_display.create {
separator = " ",
items = {
{ width = opts.bufnr_width },
{ width = 4 },
{ width = icon_width },
{ remaining = true },
},
}
<
This shows 4 columns, the first is defined in the opts as the width we'll use
when display_string is the number of the buffer. The second has a fixed width
of 4 and the third column's width will be decided by the width of the icons we
use. The fourth column will use the remaining space. Finally, we have also
defined the separator between each column will be the space " ".
An example of how the display reference will be used is shown, again for the
buffers picker:
>
return displayer {
{ entry.bufnr, "TelescopeResultsNumber" },
{ entry.indicator, "TelescopeResultsComment" },
{ icon, hl_group },
display_bufname .. ":" .. entry.lnum,
}
<
There are two types of values each column can have. Either a simple String or a
table containing the String as well as the hl_group.
The displayer can return values, string and an optional highlights. The string
is all the text to be displayed for this entry as a single string. If parts of
the string are to be highlighted they will be described in the highlights
table.
For a better understanding of how create() and displayer are used it's best to
look at the code in make_entry.lua.
================================================================================
UTILS *telescope.utils*
Utilities for writing telescope pickers
utils.transform_path({opts}, {path}) *telescope.utils.transform_path()*
Transform path is a util function that formats a path based on path_display
found in `opts` or the default value from config. It is meant to be used in
make_entry to have a uniform interface for builtins as well as extensions
utilizing the same user configuration Note: It is only supported inside
`make_entry`/`make_display` the use of this function outside of telescope
might yield to undefined behavior and will not be addressed by us
Parameters: ~
{opts} (table) The opts the users passed into the picker. Might
contains a path_display key
{path} (string) The path that should be formatted
Return: ~
string: The transformed path ready to be displayed
utils.notify({funname}, {opts}) *telescope.utils.notify()*
Telescope Wrapper around vim.notify
Parameters: ~
{funname} (string) name of the function that will be
{opts} (table) opts.level string, opts.msg string, opts.once bool
================================================================================
ACTIONS *telescope.actions*
These functions are useful for people creating their own mappings.
Actions can be either normal functions that expect the `prompt_bufnr` as first
argument (1) or they can be a custom telescope type called "action" (2).
(1) The `prompt_bufnr` of a normal function denotes the identifier of your
picker which can be used to access the picker state. In practice, users most
commonly access from both picker and global state via the following:
>
-- for utility functions
local action_state = require "telescope.actions.state"
local actions = {}
actions.do_stuff = function(prompt_bufnr)
local current_picker = action_state.get_current_picker(prompt_bufnr) -- picker state
local entry = action_state.get_selected_entry()
end
<
See |telescope.actions.state| for more information.
(2) To transform a module of functions into a module of "action"s, you need to
do the following:
>
local transform_mod = require("telescope.actions.mt").transform_mod
local mod = {}
mod.a1 = function(prompt_bufnr)
-- your code goes here
-- You can access the picker/global state as described above in (1).
end
mod.a2 = function(prompt_bufnr)
-- your code goes here
end
mod = transform_mod(mod)
-- Now the following is possible. This means that actions a2 will be executed
-- after action a1. You can chain as many actions as you want.
local action = mod.a1 + mod.a2
action(bufnr)
<
Another interesting thing to do is that these actions now have functions you
can call. These functions include `:replace(f)`, `:replace_if(f, c)`,
`replace_map(tbl)` and `enhance(tbl)`. More information on these functions can
be found in the `developers.md` and `lua/tests/automated/action_spec.lua` file.
actions.move_selection_next({prompt_bufnr}) *telescope.actions.move_selection_next()*
Move the selection to the next entry
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.move_selection_previous({prompt_bufnr}) *telescope.actions.move_selection_previous()*
Move the selection to the previous entry
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.move_selection_worse({prompt_bufnr}) *telescope.actions.move_selection_worse()*
Move the selection to the entry that has a worse score
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.move_selection_better({prompt_bufnr}) *telescope.actions.move_selection_better()*
Move the selection to the entry that has a better score
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.move_to_top({prompt_bufnr}) *telescope.actions.move_to_top()*
Move to the top of the picker
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.move_to_middle({prompt_bufnr}) *telescope.actions.move_to_middle()*
Move to the middle of the picker
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.move_to_bottom({prompt_bufnr}) *telescope.actions.move_to_bottom()*
Move to the bottom of the picker
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.add_selection({prompt_bufnr}) *telescope.actions.add_selection()*
Add current entry to multi select
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.remove_selection({prompt_bufnr}) *telescope.actions.remove_selection()*
Remove current entry from multi select
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.toggle_selection({prompt_bufnr}) *telescope.actions.toggle_selection()*
Toggle current entry status for multi select
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.select_all({prompt_bufnr}) *telescope.actions.select_all()*
Multi select all entries.
- Note: selected entries may include results not visible in the results pop
up.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.drop_all({prompt_bufnr}) *telescope.actions.drop_all()*
Drop all entries from the current multi selection.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.toggle_all({prompt_bufnr}) *telescope.actions.toggle_all()*
Toggle multi selection for all entries.
- Note: toggled entries may include results not visible in the results pop
up.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.preview_scrolling_up({prompt_bufnr}) *telescope.actions.preview_scrolling_up()*
Scroll the preview window up
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.preview_scrolling_down({prompt_bufnr}) *telescope.actions.preview_scrolling_down()*
Scroll the preview window down
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.results_scrolling_up({prompt_bufnr}) *telescope.actions.results_scrolling_up()*
Scroll the results window up
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.results_scrolling_down({prompt_bufnr}) *telescope.actions.results_scrolling_down()*
Scroll the results window down
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.center({prompt_bufnr}) *telescope.actions.center()*
Center the cursor in the window, can be used after selecting a file to edit
You can just map `actions.select_default + actions.center`
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.select_default({prompt_bufnr}) *telescope.actions.select_default()*
Perform default action on selection, usually something like
`:edit <selection>`
i.e. open the selection in the current buffer
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.select_horizontal({prompt_bufnr}) *telescope.actions.select_horizontal()*
Perform 'horizontal' action on selection, usually something like
`:new <selection>`
i.e. open the selection in a new horizontal split
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.select_vertical({prompt_bufnr}) *telescope.actions.select_vertical()*
Perform 'vertical' action on selection, usually something like
`:vnew <selection>`
i.e. open the selection in a new vertical split
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.select_tab({prompt_bufnr}) *telescope.actions.select_tab()*
Perform 'tab' action on selection, usually something like
`:tabedit <selection>`
i.e. open the selection in a new tab
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.select_drop({prompt_bufnr}) *telescope.actions.select_drop()*
Perform 'drop' action on selection, usually something like
`:drop <selection>`
i.e. open the selection in a window
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.select_tab_drop({prompt_bufnr}) *telescope.actions.select_tab_drop()*
Perform 'tab drop' action on selection, usually something like
`:tab drop <selection>`
i.e. open the selection in a new tab
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.file_edit({prompt_bufnr}) *telescope.actions.file_edit()*
Perform file edit on selection, usually something like
`:edit <selection>`
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.file_split({prompt_bufnr}) *telescope.actions.file_split()*
Perform file split on selection, usually something like
`:new <selection>`
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.file_vsplit({prompt_bufnr}) *telescope.actions.file_vsplit()*
Perform file vsplit on selection, usually something like
`:vnew <selection>`
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.file_tab({prompt_bufnr}) *telescope.actions.file_tab()*
Perform file tab on selection, usually something like
`:tabedit <selection>`
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.close({prompt_bufnr}) *telescope.actions.close()*
Close the Telescope window, usually used within an action
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions._close({prompt_bufnr}) *telescope.actions._close()*
Close the Telescope window, usually used within an action
Deprecated and no longer needed, does the same as
|telescope.actions.close|. Might be removed in the future
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.edit_command_line({prompt_bufnr}) *telescope.actions.edit_command_line()*
Set a value in the command line and don't run it, making it editable.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.set_command_line({prompt_bufnr}) *telescope.actions.set_command_line()*
Set a value in the command line and run it
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.edit_search_line({prompt_bufnr}) *telescope.actions.edit_search_line()*
Set a value in the search line and don't search for it, making it editable.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.set_search_line({prompt_bufnr}) *telescope.actions.set_search_line()*
Set a value in the search line and search for it
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.edit_register({prompt_bufnr}) *telescope.actions.edit_register()*
Edit a register
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.paste_register({prompt_bufnr}) *telescope.actions.paste_register()*
Paste the selected register into the buffer
Note: only meant to be used inside builtin.registers
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.insert_symbol({prompt_bufnr}) *telescope.actions.insert_symbol()*
Insert a symbol into the current buffer (while switching to normal mode)
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.insert_symbol_i({prompt_bufnr}) *telescope.actions.insert_symbol_i()*
Insert a symbol into the current buffer and keeping the insert mode.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.git_create_branch({prompt_bufnr}) *telescope.actions.git_create_branch()*
Create and checkout a new git branch if it doesn't already exist
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.git_apply_stash({prompt_bufnr}) *telescope.actions.git_apply_stash()*
Applies an existing git stash
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.git_checkout({prompt_bufnr}) *telescope.actions.git_checkout()*
Checkout an existing git branch
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.git_switch_branch({prompt_bufnr}) *telescope.actions.git_switch_branch()*
Switch to git branch.
If the branch already exists in local, switch to that. If the branch is
only in remote, create new branch tracking remote and switch to new one.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.git_track_branch({prompt_bufnr}) *telescope.actions.git_track_branch()*
Tell git to track the currently selected remote branch in Telescope
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.git_delete_branch({prompt_bufnr}) *telescope.actions.git_delete_branch()*
Delete the currently selected branch
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.git_merge_branch({prompt_bufnr}) *telescope.actions.git_merge_branch()*
Merge the currently selected branch
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.git_rebase_branch({prompt_bufnr}) *telescope.actions.git_rebase_branch()*
Rebase to selected git branch
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.git_reset_mixed({prompt_bufnr}) *telescope.actions.git_reset_mixed()*
Reset to selected git commit using mixed mode
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.git_reset_soft({prompt_bufnr}) *telescope.actions.git_reset_soft()*
Reset to selected git commit using soft mode
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.git_reset_hard({prompt_bufnr}) *telescope.actions.git_reset_hard()*
Reset to selected git commit using hard mode
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.git_checkout_current_buffer({prompt_bufnr}) *telescope.actions.git_checkout_current_buffer()*
Checkout a specific file for a given sha
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.git_staging_toggle({prompt_bufnr}) *telescope.actions.git_staging_toggle()*
Stage/unstage selected file
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.send_selected_to_qflist({prompt_bufnr}) *telescope.actions.send_selected_to_qflist()*
Sends the selected entries to the quickfix list, replacing the previous
entries.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.add_selected_to_qflist({prompt_bufnr}) *telescope.actions.add_selected_to_qflist()*
Adds the selected entries to the quickfix list, keeping the previous
entries.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.send_to_qflist({prompt_bufnr}) *telescope.actions.send_to_qflist()*
Sends all entries to the quickfix list, replacing the previous entries.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.add_to_qflist({prompt_bufnr}) *telescope.actions.add_to_qflist()*
Adds all entries to the quickfix list, keeping the previous entries.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.send_selected_to_loclist({prompt_bufnr}) *telescope.actions.send_selected_to_loclist()*
Sends the selected entries to the location list, replacing the previous
entries.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.add_selected_to_loclist({prompt_bufnr}) *telescope.actions.add_selected_to_loclist()*
Adds the selected entries to the location list, keeping the previous
entries.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.send_to_loclist({prompt_bufnr}) *telescope.actions.send_to_loclist()*
Sends all entries to the location list, replacing the previous entries.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.add_to_loclist({prompt_bufnr}) *telescope.actions.add_to_loclist()*
Adds all entries to the location list, keeping the previous entries.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.smart_send_to_qflist({prompt_bufnr}) *telescope.actions.smart_send_to_qflist()*
Sends the selected entries to the quickfix list, replacing the previous
entries. If no entry was selected, sends all entries.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.smart_add_to_qflist({prompt_bufnr}) *telescope.actions.smart_add_to_qflist()*
Adds the selected entries to the quickfix list, keeping the previous
entries. If no entry was selected, adds all entries.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.smart_send_to_loclist({prompt_bufnr}) *telescope.actions.smart_send_to_loclist()*
Sends the selected entries to the location list, replacing the previous
entries. If no entry was selected, sends all entries.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.smart_add_to_loclist({prompt_bufnr}) *telescope.actions.smart_add_to_loclist()*
Adds the selected entries to the location list, keeping the previous
entries. If no entry was selected, adds all entries.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.complete_tag({prompt_bufnr}) *telescope.actions.complete_tag()*
Open completion menu containing the tags which can be used to filter the
results in a faster way
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.cycle_history_next({prompt_bufnr}) *telescope.actions.cycle_history_next()*
Cycle to the next search prompt in the history
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.cycle_history_prev({prompt_bufnr}) *telescope.actions.cycle_history_prev()*
Cycle to the previous search prompt in the history
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.open_qflist({prompt_bufnr}) *telescope.actions.open_qflist()*
Open the quickfix list. It makes sense to use this in combination with one
of the send_to_qflist actions `actions.smart_send_to_qflist +
actions.open_qflist`
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.open_loclist({prompt_bufnr}) *telescope.actions.open_loclist()*
Open the location list. It makes sense to use this in combination with one
of the send_to_loclist actions `actions.smart_send_to_qflist +
actions.open_qflist`
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.delete_buffer({prompt_bufnr}) *telescope.actions.delete_buffer()*
Delete the selected buffer or all the buffers selected using multi
selection.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.cycle_previewers_next({prompt_bufnr}) *telescope.actions.cycle_previewers_next()*
Cycle to the next previewer if there is one available.
This action is not mapped on default.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.cycle_previewers_prev({prompt_bufnr}) *telescope.actions.cycle_previewers_prev()*
Cycle to the previous previewer if there is one available.
This action is not mapped on default.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.remove_selected_picker({prompt_bufnr}) *telescope.actions.remove_selected_picker()*
Removes the selected picker in |builtin.pickers|.
This action is not mapped by default and only intended for
|builtin.pickers|.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.which_key({prompt_bufnr}) *telescope.actions.which_key()*
Display the keymaps of registered actions similar to which-key.nvim.
- Notes:
- The defaults can be overridden via |action_generate.which_key|.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.to_fuzzy_refine({prompt_bufnr}) *telescope.actions.to_fuzzy_refine()*
Move from a none fuzzy search to a fuzzy one
This action is meant to be used in live_grep and
lsp_dynamic_workspace_symbols
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
================================================================================
ACTIONS_STATE *telescope.actions.state*
Functions to be used to determine the current state of telescope.
Generally used from within other |telescope.actions|
action_state.get_selected_entry() *telescope.actions.state.get_selected_entry()*
Get the current entry
action_state.get_current_line() *telescope.actions.state.get_current_line()*
Gets the current line
action_state.get_current_picker({prompt_bufnr}) *telescope.actions.state.get_current_picker()*
Gets the current picker
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
================================================================================
ACTIONS_SET *telescope.actions.set*
Telescope action sets are used to provide an interface for managing actions
that all primarily do the same thing, but with slight tweaks.
For example, when editing files you may want it in the current split, a
vertical split, etc. Instead of making users have to overwrite EACH of those
every time they want to change this behavior, they can instead replace the
`set` itself and then it will work great and they're done.
action_set.shift_selection({prompt_bufnr}, {change}) *telescope.actions.set.shift_selection()*
Move the current selection of a picker {change} rows. Handles not
overflowing / underflowing the list.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
{change} (number) The amount to shift the selection by
action_set.select({prompt_bufnr}, {type}) *telescope.actions.set.select()*
Select the current entry. This is the action set to overwrite common
actions by the user.
By default maps to editing a file.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
{type} (string) The type of selection to make
action_set.edit({prompt_bufnr}, {command}) *telescope.actions.set.edit()*
Edit a file based on the current selection.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
{command} (string) The command to use to open the file.
action_set.scroll_previewer({prompt_bufnr}, {direction}) *telescope.actions.set.scroll_previewer()*
Scrolls the previewer up or down. Defaults to a half page scroll, but can
be overridden using the `scroll_speed` option in `layout_config`. See
|telescope.layout| for more details.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
{direction} (number) The direction of the scrolling
action_set.scroll_results({prompt_bufnr}, {direction}) *telescope.actions.set.scroll_results()*
Scrolls the results up or down. Defaults to a half page scroll, but can be
overridden using the `scroll_speed` option in `layout_config`. See
|telescope.layout| for more details.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
{direction} (number) The direction of the scrolling
================================================================================
ACTIONS_LAYOUT *telescope.actions.layout*
The layout actions are actions to be used to change the layout of a picker.
action_layout.toggle_preview({prompt_bufnr}) *telescope.actions.layout.toggle_preview()*
Toggle preview window.
- Note: preview window can be toggled even if preview is set to false.
This action is not mapped by default.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
action_layout.toggle_prompt_position({prompt_bufnr}) *telescope.actions.layout.toggle_prompt_position()*
Toggles the `prompt_position` option between "top" and "bottom". Checks if
`prompt_position` is an option for the current layout.
This action is not mapped by default.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
action_layout.toggle_mirror({prompt_bufnr}) *telescope.actions.layout.toggle_mirror()*
Toggles the `mirror` option between `true` and `false`. Checks if `mirror`
is an option for the current layout.
This action is not mapped by default.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
action_layout.cycle_layout_next({prompt_bufnr}) *telescope.actions.layout.cycle_layout_next()*
Cycles to the next layout in `cycle_layout_list`.
This action is not mapped by default.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
action_layout.cycle_layout_prev({prompt_bufnr}) *telescope.actions.layout.cycle_layout_prev()*
Cycles to the previous layout in `cycle_layout_list`.
This action is not mapped by default.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
================================================================================
ACTIONS_UTILS *telescope.actions.utils*
Utilities to wrap functions around picker selections and entries.
Generally used from within other |telescope.actions|
utils.map_entries({prompt_bufnr}, {f}) *telescope.actions.utils.map_entries()*
Apply `f` to the entries of the current picker.
- Notes:
- Mapped entries include all currently filtered results, not just the
visible ones.
- Indices are 1-indexed, whereas rows are 0-indexed.
- Warning: `map_entries` has no return value.
- The below example showcases how to collect results
Usage:
>
local action_state = require "telescope.actions.state"
local action_utils = require "telescope.actions.utils"
function entry_value_by_row()
local prompt_bufnr = vim.api.nvim_get_current_buf()
local current_picker = action_state.get_current_picker(prompt_bufnr)
local results = {}
action_utils.map_entries(prompt_bufnr, function(entry, index, row)
results[row] = entry.value
end)
return results
end
<
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
{f} (function) Function to map onto entries of picker that
takes (entry, index, row) as viable
arguments
utils.map_selections({prompt_bufnr}, {f}) *telescope.actions.utils.map_selections()*
Apply `f` to the multi selections of the current picker and return a table
of mapped selections.
- Notes:
- Mapped selections may include results not visible in the results pop
up.
- Selected entries are returned in order of their selection.
- Warning: `map_selections` has no return value.
- The below example showcases how to collect results
Usage:
>
local action_state = require "telescope.actions.state"
local action_utils = require "telescope.actions.utils"
function selection_by_index()
local prompt_bufnr = vim.api.nvim_get_current_buf()
local current_picker = action_state.get_current_picker(prompt_bufnr)
local results = {}
action_utils.map_selections(prompt_bufnr, function(entry, index)
results[index] = entry.value
end)
return results
end
<
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
{f} (function) Function to map onto selection of picker
that takes (selection) as a viable argument
utils.get_registered_mappings({prompt_bufnr}) *telescope.actions.utils.get_registered_mappings()*
Utility to collect mappings of prompt buffer in array of `{mode, keybind,
name}`.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
================================================================================
ACTIONS_GENERATE *telescope.actions.generate*
Module for convenience to override defaults of corresponding
|telescope.actions| at |telescope.setup()|.
General usage:
>
require("telescope").setup {
defaults = {
mappings = {
n = {
["?"] = action_generate.which_key {
name_width = 20, -- typically leads to smaller floats
max_height = 0.5, -- increase potential maximum height
separator = " > ", -- change sep between mode, keybind, and name
close_with_action = false, -- do not close float on action
},
},
},
},
}
<
action_generate.which_key({opts}) *telescope.actions.generate.which_key()*
Display the keymaps of registered actions similar to which-key.nvim.
- Floating window:
- Appears on the opposite side of the prompt.
- Resolves to minimum required number of lines to show hints with `opts`
or truncates entries at `max_height`.
- Closes automatically on action call and can be disabled with by setting
`close_with_action` to false.
Parameters: ~
{opts} (table) options to pass to toggling registered actions
Fields: ~
{max_height} (number) % of max. height or no. of rows
for hints (default: 0.4), see
|resolver.resolve_height()|
{only_show_current_mode} (boolean) only show keymaps for the current
mode (default: true)
{mode_width} (number) fixed width of mode to be shown
(default: 1)
{keybind_width} (number) fixed width of keybind to be shown
(default: 7)
{name_width} (number) fixed width of action name to be
shown (default: 30)
{column_padding} (string) string to split; can be used for
vertical separator (default: " ")
{mode_hl} (string) hl group of mode (default:
TelescopeResultsConstant)
{keybind_hl} (string) hl group of keybind (default:
TelescopeResultsVariable)
{name_hl} (string) hl group of action name (default:
TelescopeResultsFunction)
{column_indent} (number) number of left-most spaces before
keybinds are shown (default: 4)
{line_padding} (number) row padding in top and bottom of
float (default: 1)
{separator} (string) separator string between mode, key
bindings, and action (default: "
-> ")
{close_with_action} (boolean) registered action will close
keymap float (default: true)
{normal_hl} (string) winhl of "Normal" for keymap hints
floating window (default:
"TelescopePrompt")
{border_hl} (string) winhl of "Normal" for keymap
borders (default:
"TelescopePromptBorder")
{winblend} (number) pseudo-transparency of keymap
hints floating window
================================================================================
PREVIEWERS *telescope.previewers*
Provides a Previewer table that has to be implemented by each previewer. To
achieve this, this module also provides two wrappers that abstract most of the
work and make it really easy to create new previewers.
- `previewers.new_termopen_previewer`
- `previewers.new_buffer_previewer`
Furthermore, there are a collection of previewers already defined which can be
used for every picker, as long as the entries of the picker provide the
necessary fields. The more important ones are
- `previewers.cat`
- `previewers.vimgrep`
- `previewers.qflist`
- `previewers.vim_buffer_cat`
- `previewers.vim_buffer_vimgrep`
- `previewers.vim_buffer_qflist`
Previewers can be disabled for any builtin or custom picker by doing :Telescope
find_files previewer=false
previewers.Previewer() *telescope.previewers.Previewer()*
This is the base table all previewers have to implement. It's possible to
write a wrapper for this because most previewers need to have the same keys
set. Examples of wrappers are:
- `new_buffer_previewer`
- `new_termopen_previewer`
To create a new table do following:
- `local new_previewer = Previewer:new(opts)`
What `:new` expects is listed below
The interface provides the following set of functions. All of them, besides
`new`, will be handled by telescope pickers.
- `:new(opts)`
- `:preview(entry, status)`
- `:teardown()`
- `:send_input(input)`
- `:scroll_fn(direction)`
`Previewer:new()` expects a table as input with following keys:
- `setup` function(self): Will be called the first time preview will be
called.
- `teardown` function(self): Will be called on clean up.
- `preview_fn` function(self, entry, status): Will be called each time a
new entry was selected.
- `title` function(self): Will return the static title of the previewer.
- `dynamic_title` function(self, entry): Will return the dynamic title of
the previewer. Will only be called when config value
dynamic_preview_title is true.
- `send_input` function(self, input): This is meant for
`termopen_previewer` and it can be used to send input to the terminal
application, like less.
- `scroll_fn` function(self, direction): Used to make scrolling work.
previewers.new() *telescope.previewers.new()*
A shorthand for creating a new Previewer. The provided table will be
forwarded to `Previewer:new(...)`
previewers.new_termopen_previewer() *telescope.previewers.new_termopen_previewer()*
Is a wrapper around Previewer and helps with creating a new
`termopen_previewer`.
It requires you to specify one table entry `get_command(entry, status)`.
This `get_command` function has to return the terminal command that will be
executed for each entry. Example:
>
get_command = function(entry, status)
return { 'bat', entry.path }
end
<
Additionally you can define:
- `title` a static title for example "File Preview"
- `dyn_title(self, entry)` a dynamic title function which gets called when
config value `dynamic_preview_title = true`
It's an easy way to get your first previewer going and it integrates well
with `bat` and `less`. Providing out of the box scrolling if the command
uses less.
Furthermore, it will forward all `config.set_env` environment variables to
that terminal process.
previewers.cat() *telescope.previewers.cat()*
Provides a `termopen_previewer` which has the ability to display files. It
will always show the top of the file and has support for `bat`(prioritized)
and `cat`. Each entry has to provide either the field `path` or `filename`
in order to make this previewer work.
The preferred way of using this previewer is like this
`require('telescope.config').values.cat_previewer` This will respect user
configuration and will use `buffer_previewers` in case it's configured that
way.
previewers.vimgrep() *telescope.previewers.vimgrep()*
Provides a `termopen_previewer` which has the ability to display files at
the provided line. It has support for `bat`(prioritized) and `cat`. Each
entry has to provide either the field `path` or `filename` and a `lnum`
field in order to make this previewer work.
The preferred way of using this previewer is like this
`require('telescope.config').values.grep_previewer` This will respect user
configuration and will use `buffer_previewers` in case it's configured that
way.
previewers.qflist() *telescope.previewers.qflist()*
Provides a `termopen_previewer` which has the ability to display files at
the provided line or range. It has support for `bat`(prioritized) and
`cat`. Each entry has to provide either the field `path` or `filename`,
`lnum` and a `start` and `finish` range in order to make this previewer
work.
The preferred way of using this previewer is like this
`require('telescope.config').values.qflist_previewer` This will respect
user configuration and will use buffer previewers in case it's configured
that way.
previewers.new_buffer_previewer() *telescope.previewers.new_buffer_previewer()*
An interface to instantiate a new `buffer_previewer`. That means that the
content actually lives inside a vim buffer which enables us more control
over the actual content. For example, we can use `vim.fn.search` to jump to
a specific line or reuse buffers/already opened files more easily. This
interface is more complex than `termopen_previewer` but offers more
flexibility over your content. It was designed to display files but was
extended to also display the output of terminal commands.
In the following options, state table and general tips are mentioned to
make your experience with this previewer more seamless.
options:
- `define_preview = function(self, entry, status)` (required) Is called
for each selected entry, after each selection_move (up or down) and is
meant to handle things like reading file, jump to line or attach a
highlighter.
- `setup = function(self)` (optional) Is called once at the beginning,
before the preview for the first entry is displayed. You can return a
table of vars that will be available in `self.state` in each
`define_preview` call.
- `teardown = function(self)` (optional) Will be called at the end, when
the picker is being closed and is meant to clean up everything that was
allocated by the previewer. The `buffer_previewer` will automatically
clean up all created buffers. So you only need to handle things that
were introduced by you.
- `keep_last_buf = true` (optional) Will not delete the last selected
buffer. This would allow you to reuse that buffer in the select action.
For example, that buffer can be opened in a new split, rather than
recreating that buffer in an action. To access the last buffer number:
`require('telescope.state').get_global_key("last_preview_bufnr")`
- `get_buffer_by_name = function(self, entry)` Allows you to set a unique
name for each buffer. This is used for caching purposes.
`self.state.bufname` will be nil if the entry was never loaded or the
unique name when it was loaded once. For example, useful if you have
one file but multiple entries. This happens for grep and lsp builtins.
So to make the cache work only load content if `self.state.bufname ~=
entry.your_unique_key`
- `title` a static title for example "File Preview"
- `dyn_title(self, entry)` a dynamic title function which gets called
when config value `dynamic_preview_title = true`
`self.state` table:
- `self.state.bufnr` Is the current buffer number, in which you have to
write the loaded content. Don't create a buffer yourself, otherwise
it's not managed by the buffer_previewer interface and you will
probably be better off writing your own interface.
- self.state.winid Current window id. Useful if you want to set the
cursor to a provided line number.
- self.state.bufname Will return the current buffer name, if
`get_buffer_by_name` is defined. nil will be returned if the entry was
never loaded or when `get_buffer_by_name` is not set.
Tips:
- If you want to display content of a terminal job, use:
`require('telescope.previewers.utils').job_maker(cmd, bufnr, opts)`
- `cmd` table: for example { 'git', 'diff', entry.value }
- `bufnr` number: in which the content will be written
- `opts` table: with following keys
- `bufname` string: used for cache
- `value` string: used for cache
- `mode` string: either "insert" or "append". "insert" is default
- `env` table: define environment variables. Example:
- `{ ['PAGER'] = '', ['MANWIDTH'] = 50 }`
- `cwd` string: define current working directory for job
- `callback` function(bufnr, content): will be called when job is
done. Content will be nil if job is already loaded. So you can do
highlighting only the first time the previewer is created for
that entry. Use the returned `bufnr` and not `self.state.bufnr`
in callback, because state can already be changed at this point
in time.
- If you want to attach a highlighter use:
- `require('telescope.previewers.utils').highlighter(bufnr, ft)`
- This will prioritize tree sitter highlighting if available for
environment and language.
- `require('telescope.previewers.utils').regex_highlighter(bufnr, ft)`
- `require('telescope.previewers.utils').ts_highlighter(bufnr, ft)`
- If you want to use `vim.fn.search` or similar you need to run it in
that specific buffer context. Do
>
vim.api.nvim_buf_call(bufnr, function()
-- for example `search` and `matchadd`
end)
<
to achieve that.
- If you want to read a file into the buffer it's best to use
`buffer_previewer_maker`. But access this function with
`require('telescope.config').values.buffer_previewer_maker` because it
can be redefined by users.
previewers.buffer_previewer_maker({filepath}, {bufnr}, {opts}) *telescope.previewers.buffer_previewer_maker()*
A universal way of reading a file into a buffer previewer. It handles async
reading, cache, highlighting, displaying directories and provides a
callback which can be used, to jump to a line in the buffer.
Parameters: ~
{filepath} (string) String to the filepath, will be expanded
{bufnr} (number) Where the content will be written
{opts} (table) keys: `use_ft_detect`, `bufname` and `callback`
previewers.vim_buffer_cat() *telescope.previewers.vim_buffer_cat()*
A previewer that is used to display a file. It uses the `buffer_previewer`
interface and won't jump to the line. To integrate this one into your own
picker make sure that the field `path` or `filename` is set for each entry.
The preferred way of using this previewer is like this
`require('telescope.config').values.file_previewer` This will respect user
configuration and will use `termopen_previewer` in case it's configured
that way.
previewers.vim_buffer_vimgrep() *telescope.previewers.vim_buffer_vimgrep()*
A previewer that is used to display a file and jump to the provided line.
It uses the `buffer_previewer` interface. To integrate this one into your
own picker make sure that the field `path` or `filename` and `lnum` is set
in each entry. If the latter is not present, it will default to the first
line. The preferred way of using this previewer is like this
`require('telescope.config').values.grep_previewer` This will respect user
configuration and will use `termopen_previewer` in case it's configured
that way.
previewers.vim_buffer_qflist() *telescope.previewers.vim_buffer_qflist()*
Is the same as `vim_buffer_vimgrep` and only exists for consistency with
`term_previewers`.
The preferred way of using this previewer is like this
`require('telescope.config').values.qflist_previewer` This will respect
user configuration and will use `termopen_previewer` in case it's
configured that way.
previewers.git_branch_log() *telescope.previewers.git_branch_log()*
A previewer that shows a log of a branch as graph
previewers.git_stash_diff() *telescope.previewers.git_stash_diff()*
A previewer that shows a diff of a stash
previewers.git_commit_diff_to_parent() *telescope.previewers.git_commit_diff_to_parent()*
A previewer that shows a diff of a commit to a parent commit.
The run command is `git --no-pager diff SHA^! -- $CURRENT_FILE`
The current file part is optional. So is only uses it with bcommits.
previewers.git_commit_diff_to_head() *telescope.previewers.git_commit_diff_to_head()*
A previewer that shows a diff of a commit to head.
The run command is `git --no-pager diff --cached $SHA -- $CURRENT_FILE`
The current file part is optional. So is only uses it with bcommits.
previewers.git_commit_diff_as_was() *telescope.previewers.git_commit_diff_as_was()*
A previewer that shows a diff of a commit as it was.
The run command is `git --no-pager show $SHA:$CURRENT_FILE` or `git
--no-pager show $SHA`
previewers.git_commit_message() *telescope.previewers.git_commit_message()*
A previewer that shows the commit message of a diff.
The run command is `git --no-pager log -n 1 $SHA`
previewers.git_file_diff() *telescope.previewers.git_file_diff()*
A previewer that shows the current diff of a file. Used in git_status.
The run command is `git --no-pager diff $FILE`
previewers.display_content() *telescope.previewers.display_content()*
A deprecated way of displaying content more easily. Was written at a time,
where the buffer_previewer interface wasn't present. Nowadays it's easier
to just use this. We will keep it around for backwards compatibility
because some extensions use it. It doesn't use cache or some other clever
tricks.
================================================================================
HISTORY *telescope.actions.history*
A base implementation of a prompt history that provides a simple history and
can be replaced with a custom implementation.
For example: We provide an extension for a smart history that uses sql.nvim to
map histories to metadata, like the calling picker or cwd.
So you have a history for:
- find_files project_1
- grep_string project_1
- live_grep project_1
- find_files project_2
- grep_string project_2
- live_grep project_2
- etc
See https://github.com/nvim-telescope/telescope-smart-history.nvim
histories.History() *telescope.actions.history.History()*
Manages prompt history
Fields: ~
{enabled} (boolean) Will indicate if History is enabled or disabled
{path} (string) Will point to the location of the history file
{limit} (string) Will have the limit of the history. Can be nil,
if limit is disabled.
{content} (table) History table. Needs to be filled by your own
History implementation
{index} (number) Used to keep track of the next or previous index.
Default is #content + 1
histories.History:new({opts}) *telescope.actions.history.History:new()*
Create a new History
Parameters: ~
{opts} (table) Defines the behavior of History
Fields: ~
{init} (function) Will be called after handling configuration
(required)
{append} (function) How to append a new prompt item (required)
{reset} (function) What happens on reset. Will be called when
telescope closes (required)
{pre_get} (function) Will be called before a next or previous item
will be returned (optional)
histories.new() *telescope.actions.history.new()*
Shorthand to create a new history
histories.History:reset() *telescope.actions.history.History:reset()*
Will reset the history index to the default initial state. Will happen
after the picker closed
histories.History:append({line}, {picker}, {no_reset}) *telescope.actions.history.History:append()*
Append a new line to the history
Parameters: ~
{line} (string) current line that will be appended
{picker} (table) the current picker object
{no_reset} (boolean) On default it will reset the state at the end.
If you don't want to do this set to true
histories.History:get_next({line}, {picker}) *telescope.actions.history.History:get_next()*
Will return the next history item. Can be nil if there are no next items
Parameters: ~
{line} (string) the current line
{picker} (table) the current picker object
Return: ~
string: the next history item
histories.History:get_prev({line}, {picker}) *telescope.actions.history.History:get_prev()*
Will return the previous history item. Can be nil if there are no previous
items
Parameters: ~
{line} (string) the current line
{picker} (table) the current picker object
Return: ~
string: the previous history item
histories.get_simple_history() *telescope.actions.history.get_simple_history()*
A simple implementation of history.
It will keep one unified history across all pickers.
vim:tw=78:ts=8:ft=help:norl:
|