File: lf.1

package info (click to toggle)
lf 34%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,296 kB
  • sloc: sh: 126; makefile: 23; csh: 4
file content (2442 lines) | stat: -rw-r--r-- 82,680 bytes parent folder | download
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
.\" Automatically generated by Pandoc 2.11.4
.\"
.TH "LF" "1" "2025-02-09" "" "DOCUMENTATION"
.hy
.SH NAME
.PP
lf - terminal file manager
.SH SYNOPSIS
.PP
\f[B]lf\f[R] [\f[B]-command\f[R] \f[I]command\f[R]] [\f[B]-config\f[R]
\f[I]path\f[R]] [\f[B]-cpuprofile\f[R] \f[I]path\f[R]] [\f[B]-doc\f[R]]
[\f[B]-last-dir-path\f[R] \f[I]path\f[R]] [\f[B]-log path\f[R]]
[\f[B]-memprofile\f[R] \f[I]path\f[R]] [\f[B]-print-last-dir\f[R]]
[\f[B]-print-selection\f[R]] [\f[B]-remote\f[R] \f[I]command\f[R]]
[\f[B]-selection-path\f[R] \f[I]path\f[R]] [\f[B]-server\f[R]]
[\f[B]-single\f[R]] [\f[B]-version\f[R]] [\f[B]-help\f[R]]
[\f[I]cd-or-select-path\f[R]]
.SH DESCRIPTION
.PP
lf is a terminal file manager.
.PP
The source code can be found in the repository at
<https://github.com/gokcehan/lf>
.PP
This documentation can either be read from the terminal using
\f[C]lf -doc\f[R] or online at
<https://github.com/gokcehan/lf/blob/master/doc.md> You can also use the
\f[C]doc\f[R] command (default \f[C]<f-1>\f[R]) inside lf to view the
documentation in a pager.
A man page with the same content is also available in the repository at
<https://github.com/gokcehan/lf/blob/master/lf.1>
.PP
You can run \f[C]lf -help\f[R] to see descriptions of command line
options.
.SH QUICK REFERENCE
.PP
The following commands are provided by lf:
.IP
.nf
\f[C]
quit                     (default \[aq]q\[aq])
up                       (default \[aq]k\[aq] and \[aq]<up>\[aq])
half-up                  (default \[aq]<c-u>\[aq])
page-up                  (default \[aq]<c-b>\[aq] and \[aq]<pgup>\[aq])
scroll-up                (default \[aq]<c-y>\[aq])
down                     (default \[aq]j\[aq] and \[aq]<down>\[aq])
half-down                (default \[aq]<c-d>\[aq])
page-down                (default \[aq]<c-f>\[aq] and \[aq]<pgdn>\[aq])
scroll-down              (default \[aq]<c-e>\[aq])
updir                    (default \[aq]h\[aq] and \[aq]<left>\[aq])
open                     (default \[aq]l\[aq] and \[aq]<right>\[aq])
jump-next                (default \[aq]]\[aq])
jump-prev                (default \[aq][\[aq])
top                      (default \[aq]gg\[aq] and \[aq]<home>\[aq])
bottom                   (default \[aq]G\[aq] and \[aq]<end>\[aq])
high                     (default \[aq]H\[aq])
middle                   (default \[aq]M\[aq])
low                      (default \[aq]L\[aq])
toggle
invert                   (default \[aq]v\[aq])
invert-below
unselect                 (default \[aq]u\[aq])
glob-select
glob-unselect
calcdirsize
clearmaps
copy                     (default \[aq]y\[aq])
cut                      (default \[aq]d\[aq])
paste                    (default \[aq]p\[aq])
clear                    (default \[aq]c\[aq])
sync
draw
redraw                   (default \[aq]<c-l>\[aq])
load
reload                   (default \[aq]<c-r>\[aq])
echo
echomsg
echoerr
cd
select
delete         (modal)
rename         (modal)   (default \[aq]r\[aq])
source
push
read           (modal)   (default \[aq]:\[aq])
shell          (modal)   (default \[aq]$\[aq])
shell-pipe     (modal)   (default \[aq]%\[aq])
shell-wait     (modal)   (default \[aq]!\[aq])
shell-async    (modal)   (default \[aq]&\[aq])
find           (modal)   (default \[aq]f\[aq])
find-back      (modal)   (default \[aq]F\[aq])
find-next                (default \[aq];\[aq])
find-prev                (default \[aq],\[aq])
search         (modal)   (default \[aq]/\[aq])
search-back    (modal)   (default \[aq]?\[aq])
search-next              (default \[aq]n\[aq])
search-prev              (default \[aq]N\[aq])
filter         (modal)
setfilter
mark-save      (modal)   (default \[aq]m\[aq])
mark-load      (modal)   (default \[dq]\[aq]\[dq])
mark-remove    (modal)   (default \[aq]\[dq]\[aq])
tag
tag-toggle               (default \[aq]t\[aq])
\f[R]
.fi
.PP
The following command line commands are provided by lf:
.IP
.nf
\f[C]
cmd-escape               (default \[aq]<esc>\[aq])
cmd-complete             (default \[aq]<tab>\[aq])
cmd-menu-complete
cmd-menu-complete-back
cmd-menu-accept
cmd-enter                (default \[aq]<c-j>\[aq] and \[aq]<enter>\[aq])
cmd-interrupt            (default \[aq]<c-c>\[aq])
cmd-history-next         (default \[aq]<c-n>\[aq] and \[aq]<down>\[aq])
cmd-history-prev         (default \[aq]<c-p>\[aq] and \[aq]<up>\[aq])
cmd-left                 (default \[aq]<c-b>\[aq] and \[aq]<left>\[aq])
cmd-right                (default \[aq]<c-f>\[aq] and \[aq]<right>\[aq])
cmd-home                 (default \[aq]<c-a>\[aq] and \[aq]<home>\[aq])
cmd-end                  (default \[aq]<c-e>\[aq] and \[aq]<end>\[aq])
cmd-delete               (default \[aq]<c-d>\[aq] and \[aq]<delete>\[aq])
cmd-delete-back          (default \[aq]<backspace>\[aq] and \[aq]<backspace2>\[aq])
cmd-delete-home          (default \[aq]<c-u>\[aq])
cmd-delete-end           (default \[aq]<c-k>\[aq])
cmd-delete-unix-word     (default \[aq]<c-w>\[aq])
cmd-yank                 (default \[aq]<c-y>\[aq])
cmd-transpose            (default \[aq]<c-t>\[aq])
cmd-transpose-word       (default \[aq]<a-t>\[aq])
cmd-word                 (default \[aq]<a-f>\[aq])
cmd-word-back            (default \[aq]<a-b>\[aq])
cmd-delete-word          (default \[aq]<a-d>\[aq])
cmd-delete-word-back     (default \[aq]<a-backspace>\[aq] and \[aq]<a-backspace2>\[aq])
cmd-capitalize-word      (default \[aq]<a-c>\[aq])
cmd-uppercase-word       (default \[aq]<a-u>\[aq])
cmd-lowercase-word       (default \[aq]<a-l>\[aq])
\f[R]
.fi
.PP
The following options can be used to customize the behavior of lf:
.IP
.nf
\f[C]
anchorfind        bool      (default true)
autoquit          bool      (default true)
borderfmt         string    (default \[dq]\[rs]033[0m\[dq])
cleaner           string    (default \[aq]\[aq])
copyfmt           string    (default \[dq]\[rs]033[7;33m\[dq])
cursoractivefmt   string    (default \[dq]\[rs]033[7m\[dq])
cursorparentfmt   string    (default \[dq]\[rs]033[7m\[dq])
cursorpreviewfmt  string    (default \[dq]\[rs]033[4m\[dq])
cutfmt            string    (default \[dq]\[rs]033[7;31m\[dq])
dircache          bool      (default true)
dircounts         bool      (default false)
dirfirst          bool      (default true)
dironly           bool      (default false)
dirpreviews       bool      (default false)
drawbox           bool      (default false)
dupfilefmt        string    (default \[aq]%f.\[ti]%n\[ti]\[aq])
errorfmt          string    (default \[dq]\[rs]033[7;31;47m\[dq])
filesep           string    (default \[dq]\[rs]n\[dq])
findlen           int       (default 1)
globfilter        bool      (default false)
globsearch        bool      (default false)
hidden            bool      (default false)
hiddenfiles       []string  (default \[aq].*\[aq] for Unix and \[aq]\[aq] for Windows)
history           bool      (default true)
icons             bool      (default false)
ifs               string    (default \[aq]\[aq])
ignorecase        bool      (default true)
ignoredia         bool      (default true)
incfilter         bool      (default false)
incsearch         bool      (default false)
info              []string  (default \[aq]\[aq])
infotimefmtnew    string    (default \[aq]Jan _2 15:04\[aq])
infotimefmtold    string    (default \[aq]Jan _2  2006\[aq])
locale            string    (default \[aq]\[aq])
mouse             bool      (default false)
number            bool      (default false)
numberfmt         string    (default \[dq]\[rs]033[33m\[dq])
period            int       (default 0)
preserve          []string  (default \[dq]mode\[dq])
preview           bool      (default true)
previewer         string    (default \[aq]\[aq])
promptfmt         string    (default \[dq]\[rs]033[32;1m%u\[at]%h\[rs]033[0m:\[rs]033[34;1m%d\[rs]033[0m\[rs]033[1m%f\[rs]033[0m\[dq])
ratios            []int     (default \[aq]1:2:3\[aq])
relativenumber    bool      (default false)
reverse           bool      (default false)
roundbox          bool      (default false)
rulerfmt          string    (default \[dq]  %a|  %p|  \[rs]033[7;31m %m \[rs]033[0m|  \[rs]033[7;33m %c \[rs]033[0m|  \[rs]033[7;35m %s \[rs]033[0m|  \[rs]033[7;34m %f \[rs]033[0m|  %i/%t\[dq])
scrolloff         int       (default 0)
selectfmt         string    (default \[dq]\[rs]033[7;35m\[dq])
selmode           string    (default \[aq]all\[aq])
shell             string    (default \[aq]sh\[aq] for Unix and \[aq]cmd\[aq] for Windows)
shellflag         string    (default \[aq]-c\[aq] for Unix and \[aq]/c\[aq] for Windows)
shellopts         []string  (default \[aq]\[aq])
showbinds         bool      (default true)
sixel             bool      (default false)
smartcase         bool      (default true)
smartdia          bool      (default false)
sortby            string    (default \[aq]natural\[aq])
statfmt           string    (default \[dq]\[rs]033[36m%p\[rs]033[0m| %c| %u| %g| %S| %t| -> %l\[dq])
tabstop           int       (default 8)
tagfmt            string    (default \[dq]\[rs]033[31m\[dq])
tempmarks         string    (default \[aq]\[aq])
timefmt           string    (default \[aq]Mon Jan _2 15:04:05 2006\[aq])
truncatechar      string    (default \[aq]\[ti]\[aq])
truncatepct       int       (default 100)
waitmsg           string    (default \[aq]Press any key to continue\[aq])
watch             bool      (default false)
wrapscan          bool      (default true)
wrapscroll        bool      (default false)
user_{option}     string    (default none)
\f[R]
.fi
.PP
The following environment variables are exported for shell commands:
.IP
.nf
\f[C]
f
fs
fx
id
PWD
OLDPWD
LF_LEVEL
OPENER
VISUAL
EDITOR
PAGER
SHELL
lf
lf_{option}
lf_user_{option}
lf_width
lf_height
lf_count
lf_mode
\f[R]
.fi
.PP
The following special shell commands are used to customize the behavior
of lf when defined:
.IP
.nf
\f[C]
open
paste
rename
delete
pre-cd
on-cd
on-focus-gained
on-focus-lost
on-init
on-select
on-redraw
on-quit
\f[R]
.fi
.PP
The following commands/keybindings are provided by default:
.IP
.nf
\f[C]
Unix
cmd open &$OPENER \[dq]$f\[dq]
map e $$EDITOR \[dq]$f\[dq]
map i $$PAGER \[dq]$f\[dq]
map w $$SHELL
cmd doc $$lf -doc | $PAGER
map <f-1> doc
cmd maps $lf -remote \[dq]query $id maps\[dq] | $PAGER
cmd cmaps $lf -remote \[dq]query $id cmaps\[dq] | $PAGER
cmd cmds $lf -remote \[dq]query $id cmds\[dq] | $PAGER

Windows
cmd open &%OPENER% %f%
map e $%EDITOR% %f%
map i !%PAGER% %f%
map w $%SHELL%
cmd doc !%lf% -doc | %PAGER%
map <f-1> doc
cmd maps !%lf% -remote \[dq]query %id% maps\[dq] | %PAGER%
cmd cmaps !%lf% -remote \[dq]query %id% cmaps\[dq] | %PAGER%
cmd cmds !%lf% -remote \[dq]query %id% cmds\[dq] | %PAGER%
\f[R]
.fi
.PP
The following additional keybindings are provided by default:
.IP
.nf
\f[C]
map zh set hidden!
map zr set reverse!
map zn set info
map zs set info size
map zt set info time
map za set info size:time
map sn :set sortby natural; set info
map ss :set sortby size; set info size
map st :set sortby time; set info time
map sa :set sortby atime; set info atime
map sc :set sortby ctime; set info ctime
map se :set sortby ext; set info
map gh cd \[ti]
map <space> :toggle; down
\f[R]
.fi
.PP
If the \f[C]mouse\f[R] option is enabled, mouse buttons have the
following default effects:
.IP
.nf
\f[C]
Left mouse button
    Click on a file or directory to select it.

Right mouse button
    Enter a directory or open a file. Also works on the preview window.

Scroll wheel
    Move up or down. If Ctrl is pressed, scroll up or down.
\f[R]
.fi
.SH CONFIGURATION
.PP
Configuration files should be located at:
.IP
.nf
\f[C]
OS       system-wide               user-specific
Unix     /etc/lf/lfrc              \[ti]/.config/lf/lfrc
Windows  C:\[rs]ProgramData\[rs]lf\[rs]lfrc    C:\[rs]Users\[rs]<user>\[rs]AppData\[rs]Local\[rs]lf\[rs]lfrc
\f[R]
.fi
.PP
The colors file should be located at:
.IP
.nf
\f[C]
OS       system-wide               user-specific
Unix     /etc/lf/colors            \[ti]/.config/lf/colors
Windows  C:\[rs]ProgramData\[rs]lf\[rs]colors  C:\[rs]Users\[rs]<user>\[rs]AppData\[rs]Local\[rs]lf\[rs]colors
\f[R]
.fi
.PP
The icons file should be located at:
.IP
.nf
\f[C]
OS       system-wide               user-specific
Unix     /etc/lf/icons             \[ti]/.config/lf/icons
Windows  C:\[rs]ProgramData\[rs]lf\[rs]icons   C:\[rs]Users\[rs]<user>\[rs]AppData\[rs]Local\[rs]lf\[rs]icons
\f[R]
.fi
.PP
The selection file should be located at:
.IP
.nf
\f[C]
Unix     \[ti]/.local/share/lf/files
Windows  C:\[rs]Users\[rs]<user>\[rs]AppData\[rs]Local\[rs]lf\[rs]files
\f[R]
.fi
.PP
The marks file should be located at:
.IP
.nf
\f[C]
Unix     \[ti]/.local/share/lf/marks
Windows  C:\[rs]Users\[rs]<user>\[rs]AppData\[rs]Local\[rs]lf\[rs]marks
\f[R]
.fi
.PP
The tags file should be located at:
.IP
.nf
\f[C]
Unix     \[ti]/.local/share/lf/tags
Windows  C:\[rs]Users\[rs]<user>\[rs]AppData\[rs]Local\[rs]lf\[rs]tags
\f[R]
.fi
.PP
The history file should be located at:
.IP
.nf
\f[C]
Unix     \[ti]/.local/share/lf/history
Windows  C:\[rs]Users\[rs]<user>\[rs]AppData\[rs]Local\[rs]lf\[rs]history
\f[R]
.fi
.PP
You can configure these locations with the following variables given
with their order of precedences and their default values:
.IP
.nf
\f[C]
Unix
    $LF_CONFIG_HOME
    $XDG_CONFIG_HOME
    \[ti]/.config

    $LF_DATA_HOME
    $XDG_DATA_HOME
    \[ti]/.local/share

Windows
    %ProgramData%
    C:\[rs]ProgramData

    %LF_CONFIG_HOME%
    %LOCALAPPDATA%
    C:\[rs]Users\[rs]<user>\[rs]AppData\[rs]Local
\f[R]
.fi
.PP
A sample configuration file can be found at
<https://github.com/gokcehan/lf/blob/master/etc/lfrc.example>
.SH COMMANDS
.PP
This section shows information about built-in commands.
Modal commands do not take any arguments, but instead change the
operation mode to read their input conveniently, and so they are meant
to be assigned to keybindings.
.SS quit (default \f[C]q\f[R])
.PP
Quit lf and return to the shell.
.SS up (default \f[C]k\f[R] and \f[C]<up>\f[R]), half-up (default \f[C]<c-u>\f[R]), page-up (default \f[C]<c-b>\f[R] and \f[C]<pgup>\f[R]), scroll-up (default \f[C]<c-y>\f[R]), down (default \f[C]j\f[R] and \f[C]<down>\f[R]), half-down (default \f[C]<c-d>\f[R]), page-down (default \f[C]<c-f>\f[R] and \f[C]<pgdn>\f[R]), scroll-down (default \f[C]<c-e>\f[R])
.PP
Move/scroll the current file selection upwards/downwards by one/half a
page/full page.
.SS updir (default \f[C]h\f[R] and \f[C]<left>\f[R])
.PP
Change the current working directory to the parent directory.
.SS open (default \f[C]l\f[R] and \f[C]<right>\f[R])
.PP
If the current file is a directory, then change the current directory to
it, otherwise, execute the \f[C]open\f[R] command.
A default \f[C]open\f[R] command is provided to call the default system
opener asynchronously with the current file as the argument.
A custom \f[C]open\f[R] command can be defined to override this default.
.SS jump-next (default \f[C]]\f[R]), jump-prev (default \f[C][\f[R])
.PP
Change the current working directory to the next/previous jumplist item.
.SS top (default \f[C]gg\f[R] and \f[C]<home>\f[R]), bottom (default \f[C]G\f[R] and \f[C]<end>\f[R])
.PP
Move the current file selection to the top/bottom of the directory.
A count can be specified to move to a specific line, for example, use
\f[C]3G\f[R] to move to the third line.
.SS high (default \f[C]H\f[R]), middle (default \f[C]M\f[R]), low (default \f[C]L\f[R])
.PP
Move the current file selection to the high/middle/low of the screen.
.SS toggle
.PP
Toggle the selection of the current file or files given as arguments.
.SS invert (default \f[C]v\f[R])
.PP
Reverse the selection of all files in the current directory (i.e.
\f[C]toggle\f[R] all files).
Selections in other directories are not affected by this command.
You can define a new command to select all files in the directory by
combining \f[C]invert\f[R] with \f[C]unselect\f[R] (i.e.
\f[C]cmd select-all :unselect; invert\f[R]), though this will also
remove selections in other directories.
.SS invert-below
.PP
Reverse the selection (i.e.
\f[C]toggle\f[R]) of all files at or after the current file in the
current directory.
.PP
To select a contiguous block of files, use this command on the first
file you want to select.
Then, move down to the first file you do \f[I]not\f[R] want to select
(the one after the end of the desired selection) and use this command
again.
This achieves an effect similar to the visual mode in Vim.
.PP
This command is experimental and may be removed once a better
replacement for the visual mode is implemented in \f[C]lf\f[R].
If you\[aq]d like to experiment with using this command, you should bind
it to a key (e.g.
\f[C]V\f[R]) for a better experience.
.SS unselect (default \f[C]u\f[R])
.PP
Remove the selection of all files in all directories.
.SS glob-select, glob-unselect
.PP
Select/unselect files that match the given glob.
.SS calcdirsize
.PP
Calculate the total size for each of the selected directories.
Option \f[C]info\f[R] should include \f[C]size\f[R] and option
\f[C]dircounts\f[R] should be disabled to show this size.
If the total size of a directory is not calculated, it will be shown as
\f[C]-\f[R].
.SS clearmaps
.PP
Remove all keybindings associated with the \f[C]map\f[R] command.
This command can be used in the config file to remove the default
keybindings.
For safety purposes, \f[C]:\f[R] is left mapped to the \f[C]read\f[R]
command, and \f[C]cmap\f[R] keybindings are retained so that it is still
possible to exit \f[C]lf\f[R] using \f[C]:quit\f[R].
.SS copy (default \f[C]y\f[R])
.PP
If there are no selections, save the path of the current file to the
copy buffer, otherwise, copy the paths of selected files.
.SS cut (default \f[C]d\f[R])
.PP
If there are no selections, save the path of the current file to the cut
buffer, otherwise, copy the paths of selected files.
.SS paste (default \f[C]p\f[R])
.PP
Copy/Move files in the copy/cut buffer to the current working directory.
A custom \f[C]paste\f[R] command can be defined to override this
default.
.SS clear (default \f[C]c\f[R])
.PP
Clear file paths in copy/cut buffer.
.SS sync
.PP
Synchronize copied/cut files with the server.
This command is automatically called when required.
.SS draw
.PP
Draw the screen.
This command is automatically called when required.
.SS redraw (default \f[C]<c-l>\f[R])
.PP
Synchronize the terminal and redraw the screen.
.SS load
.PP
Load modified files and directories.
This command is automatically called when required.
.SS reload (default \f[C]<c-r>\f[R])
.PP
Flush the cache and reload all files and directories.
.SS echo
.PP
Print the given arguments to the message line at the bottom.
.SS echomsg
.PP
Print the given arguments to the message line at the bottom and also to
the log file.
.SS echoerr
.PP
Print given arguments to the message line at the bottom as
\f[C]errorfmt\f[R] and also to the log file.
.SS cd
.PP
Change the working directory to the given argument.
.SS select
.PP
Change the current file selection to the given argument.
.SS delete (modal)
.PP
Remove the current file or selected file(s).
A custom \f[C]delete\f[R] command can be defined to override this
default.
.SS rename (modal) (default \f[C]r\f[R])
.PP
Rename the current file using the built-in method.
A custom \f[C]rename\f[R] command can be defined to override this
default.
.SS source
.PP
Read the configuration file given in the argument.
.SS push
.PP
Simulate key pushes given in the argument.
.SS read (modal) (default \f[C]:\f[R])
.PP
Read a command to evaluate.
.SS shell (modal) (default \f[C]$\f[R])
.PP
Read a shell command to execute.
.SS shell-pipe (modal) (default \f[C]%\f[R])
.PP
Read a shell command to execute piping its standard I/O to the bottom
statline.
.SS shell-wait (modal) (default \f[C]!\f[R])
.PP
Read a shell command to execute and wait for a key press in the end.
.SS shell-async (modal) (default \f[C]&\f[R])
.PP
Read a shell command to execute asynchronously without standard I/O.
.SS find (modal) (default \f[C]f\f[R]), find-back (modal) (default \f[C]F\f[R]), find-next (default \f[C];\f[R]), find-prev (default \f[C],\f[R])
.PP
Read key(s) to find the appropriate file name match in the
forward/backward direction and jump to the next/previous match.
.SS search (default \f[C]/\f[R]), search-back (default \f[C]?\f[R]), search-next (default \f[C]n\f[R]), search-prev (default \f[C]N\f[R])
.PP
Read a pattern to search for a file name match in the forward/backward
direction and jump to the next/previous match.
.SS filter (modal), setfilter
.PP
Command \f[C]filter\f[R] reads a pattern to filter out and only view
files matching the pattern.
Command \f[C]setfilter\f[R] does the same but uses an argument to set
the filter immediately.
You can supply an argument to \f[C]filter\f[R] to use as the starting
prompt.
.SS mark-save (modal) (default \f[C]m\f[R])
.PP
Save the current directory as a bookmark assigned to the given key.
.SS mark-load (modal) (default \f[C]\[aq]\f[R])
.PP
Change the current directory to the bookmark assigned to the given key.
A special bookmark \f[C]\[aq]\f[R] holds the previous directory after a
\f[C]mark-load\f[R], \f[C]cd\f[R], or \f[C]select\f[R] command.
.SS mark-remove (modal) (default \f[C]\[dq]\f[R])
.PP
Remove a bookmark assigned to the given key.
.SS tag
.PP
Tag a file with \f[C]*\f[R] or a single-width character given in the
argument.
You can define a new tag-clearing command by combining \f[C]tag\f[R]
with \f[C]tag-toggle\f[R] (i.e.
\f[C]cmd tag-clear :tag; tag-toggle\f[R]).
.SS tag-toggle (default \f[C]t\f[R])
.PP
Tag a file with \f[C]*\f[R] or a single width character given in the
argument if the file is untagged, otherwise remove the tag.
.SH COMMAND LINE COMMANDS
.PP
The prompt character specifies which of the several command-line modes
you are in.
For example, the \f[C]read\f[R] command takes you to the \f[C]:\f[R]
mode.
.PP
When the cursor is at the first character in \f[C]:\f[R] mode, pressing
one of the keys \f[C]!\f[R], \f[C]$\f[R], \f[C]%\f[R], or \f[C]&\f[R]
takes you to the corresponding mode.
You can go back with \f[C]cmd-delete-back\f[R] (\f[C]<backspace>\f[R] by
default).
.PP
The command line commands should be mostly compatible with readline
keybindings.
A character refers to a Unicode code point, a word consists of letters
and digits, and a unix word consists of any non-blank characters.
.SS cmd-escape (default \f[C]<esc>\f[R])
.PP
Quit command line mode and return to normal mode.
.SS cmd-complete (default \f[C]<tab>\f[R])
.PP
Autocomplete the current word.
.SS cmd-menu-complete, cmd-menu-complete-back
.PP
Autocomplete the current word with the menu selection.
You need to assign keys to these commands (e.g.
\f[C]cmap <tab> cmd-menu-complete; cmap <backtab> cmd-menu-complete-back\f[R]).
You can use the assigned keys to display the menu and then cycle through
completion options.
.SS cmd-menu-accept
.PP
Accept the currently selected match in menu completion and close the
menu.
.SS cmd-enter (default \f[C]<c-j>\f[R] and \f[C]<enter>\f[R])
.PP
Execute the current line.
.SS cmd-interrupt (default \f[C]<c-c>\f[R])
.PP
Interrupt the current shell-pipe command and return to the normal mode.
.SS cmd-history-next (default \f[C]<c-n>\f[R] and \f[C]<down>\f[R]), cmd-history-prev (default \f[C]<c-p>\f[R] and \f[C]<up>\f[R])
.PP
Go to the next/previous item in the history.
.SS cmd-left (default \f[C]<c-b>\f[R] and \f[C]<left>\f[R]), cmd-right (default \f[C]<c-f>\f[R] and \f[C]<right>\f[R])
.PP
Move the cursor to the left/right.
.SS cmd-home (default \f[C]<c-a>\f[R] and \f[C]<home>\f[R]), cmd-end (default \f[C]<c-e>\f[R] and \f[C]<end>\f[R])
.PP
Move the cursor to the beginning/end of the line.
.SS cmd-delete (default \f[C]<c-d>\f[R] and \f[C]<delete>\f[R])
.PP
Delete the next character.
.SS cmd-delete-back (default \f[C]<backspace>\f[R] and \f[C]<backspace2>\f[R])
.PP
Delete the previous character.
When at the beginning of a prompt, returns either to normal mode or to
\f[C]:\f[R] mode.
.SS cmd-delete-home (default \f[C]<c-u>\f[R]), cmd-delete-end (default \f[C]<c-k>\f[R])
.PP
Delete everything up to the beginning/end of the line.
.SS cmd-delete-unix-word (default \f[C]<c-w>\f[R])
.PP
Delete the previous unix word.
.SS cmd-yank (default \f[C]<c-y>\f[R])
.PP
Paste the buffer content containing the last deleted item.
.SS cmd-transpose (default \f[C]<c-t>\f[R]), cmd-transpose-word (default \f[C]<a-t>\f[R])
.PP
Transpose the positions of the last two characters/words.
.SS cmd-word (default \f[C]<a-f>\f[R]), cmd-word-back (default \f[C]<a-b>\f[R])
.PP
Move the cursor by one word in the forward/backward direction.
.SS cmd-delete-word (default \f[C]<a-d>\f[R])
.PP
Delete the next word in the forward direction.
.SS cmd-delete-word-back (default \f[C]<a-backspace>\f[R] and \f[C]<a-backspace2>\f[R])
.PP
Delete the previous word in the backward direction.
.SS cmd-capitalize-word (default \f[C]<a-c>\f[R]), cmd-uppercase-word (default \f[C]<a-u>\f[R]), cmd-lowercase-word (default \f[C]<a-l>\f[R])
.PP
Capitalize/uppercase/lowercase the current word and jump to the next
word.
.SH OPTIONS
.PP
This section shows information about options to customize the behavior.
Character \f[C]:\f[R] is used as the separator for list options
\f[C][]int\f[R] and \f[C][]string\f[R].
.SS anchorfind (bool) (default true)
.PP
When this option is enabled, the find command starts matching patterns
from the beginning of file names, otherwise, it can match at an
arbitrary position.
.SS autoquit (bool) (default true)
.PP
Automatically quit the server when there are no clients left connected.
.SS borderfmt (string) (default \f[C]\[rs]033[0m\f[R])
.PP
Format string of the box drawing characters enabled by the
\f[C]drawbox\f[R] option.
.SS cleaner (string) (default \[ga]\[ga]) (not called if empty)
.PP
Set the path of a cleaner file.
The file should be executable.
This file is called if previewing is enabled, the previewer is set, and
the previously selected file has its preview cache disabled.
The following arguments are passed to the file, (1) current file name,
(2) width, (3) height, (4) horizontal position, (5) vertical position of
preview pane and (6) next file name to be previewed respectively.
Preview cleaning is disabled when the value of this option is left
empty.
.SS copyfmt (string) (default \f[C]\[rs]033[7;33m\f[R])
.PP
Format string of the indicator for files to be copied.
.SS cursoractivefmt (string) (default \f[C]\[rs]033[7m\f[R]), cursorparentfmt string (default \f[C]\[rs]033[7m\f[R]), cursorpreviewfmt string (default \f[C]\[rs]033[4m\f[R])
.PP
Format strings for highlighting the cursor.
\f[C]cursoractivefmt\f[R] applies in the current directory pane,
\f[C]cursorparentfmt\f[R] applies in panes that show parents of the
current directory, and \f[C]cursorpreviewfmt\f[R] applies in panes that
preview directories.
.PP
The default is to make the active cursor and the parent directory cursor
inverted.
The preview cursor is underlined.
.PP
Some other possibilities to consider for the preview or parent cursors:
an empty string for no cursor, \f[C]\[rs]033[7;2m\f[R] for dimmed
inverted text (visibility varies by terminal), \f[C]\[rs]033[7;90m\f[R]
for inverted text with grey (aka \[dq]brightblack\[dq]) background.
.PP
If the format string contains the characters \f[C]%s\f[R], it is
interpreted as a format string for \f[C]fmt.Sprintf\f[R].
Such a string should end with the terminal reset sequence.
For example, \f[C]\[rs]033[4m%s\[rs]033[0m\f[R] has the same effect as
\f[C]\[rs]033[4m\f[R].
.SS cutfmt (string) (default \f[C]\[rs]033[7;31m\f[R])
.PP
Format string of the indicator for files to be cut.
.SS dircache (bool) (default true)
.PP
Cache directory contents.
.SS dircounts (bool) (default false)
.PP
When this option is enabled, directory sizes show the number of items
inside instead of the total size of the directory, which needs to be
calculated for each directory using \f[C]calcdirsize\f[R].
This information needs to be calculated by reading the directory and
counting the items inside.
Therefore, this option is disabled by default for performance reasons.
This option only has an effect when \f[C]info\f[R] has a \f[C]size\f[R]
field and the pane is wide enough to show the information.
999 items are counted per directory at most, and bigger directories are
shown as \f[C]999+\f[R].
.SS dirfirst (bool) (default true)
.PP
Show directories first above regular files.
.SS dironly (bool) (default false)
.PP
Show only directories.
.SS dirpreviews (bool) (default false)
.PP
If enabled, directories will also be passed to the previewer script.
This allows custom previews for directories.
.SS drawbox (bool) (default false)
.PP
Draw boxes around panes with box drawing characters.
.SS dupfilefmt (string) (default \f[C]%f.\[ti]%n\[ti]\f[R])
.PP
Format string of file name when creating duplicate files.
With the default format, copying a file \f[C]abc.txt\f[R] to the same
directory will result in a duplicate file called
\f[C]abc.txt.\[ti]1\[ti]\f[R].
Special expansions are provided, \f[C]%f\f[R] as the file name,
\f[C]%b\f[R] for the basename (file name without extension),
\f[C]%e\f[R] as the extension (including the dot) and \f[C]%n\f[R] as
the number of duplicates.
.SS errorfmt (string) (default \f[C]\[rs]033[7;31;47m\f[R])
.PP
Format string of error messages shown in the bottom message line.
.PP
If the format string contains the characters \f[C]%s\f[R], it is
interpreted as a format string for \f[C]fmt.Sprintf\f[R].
Such a string should end with the terminal reset sequence.
For example, \f[C]\[rs]033[4m%s\[rs]033[0m\f[R] has the same effect as
\f[C]\[rs]033[4m\f[R].
.SS filesep (string) (default \f[C]\[rs]n\f[R])
.PP
File separator used in environment variables \f[C]fs\f[R] and
\f[C]fx\f[R].
.SS findlen (int) (default 1)
.PP
Number of characters prompted for the find command.
When this value is set to 0, find command prompts until there is only a
single match left.
.SS globfilter (bool) (default false)
.PP
Patterns are treated as globs for the filter command, see
\f[C]globsearch\f[R] for more details.
.SS globsearch (bool) (default false)
.PP
When this option is enabled, search command patterns are considered as
globs, otherwise, they are literals.
With globbing, \f[C]*\f[R] matches any sequence, \f[C]?\f[R] matches any
character, and \f[C][...]\f[R] or \f[C][\[ha]...]\f[R] matches character
sets or ranges.
Otherwise, these characters are interpreted as they are.
.SS hidden (bool) (default false)
.PP
Show hidden files.
On Unix systems, hidden files are determined by the value of
\f[C]hiddenfiles\f[R].
On Windows, files with hidden attributes are also considered hidden
files.
.SS hiddenfiles ([]string) (default \f[C].*\f[R] for Unix and \[ga]\[ga] for Windows)
.PP
List of hidden file glob patterns.
Patterns can be given as relative or absolute paths.
Globbing supports the usual special characters, \f[C]*\f[R] to match any
sequence, \f[C]?\f[R] to match any character, and \f[C][...]\f[R] or
\f[C][\[ha]...]\f[R] to match character sets or ranges.
In addition, if a pattern starts with \f[C]!\f[R], then its matches are
excluded from hidden files.
To add multiple patterns, use \f[C]:\f[R] as a separator.
Example: \f[C].*:lost+found:*.bak\f[R]
.SS history (bool) (default true)
.PP
Save command history.
.SS icons (bool) (default false)
.PP
Show icons before each item in the list.
.SS ifs (string) (default \[ga]\[ga])
.PP
Sets \f[C]IFS\f[R] variable in shell commands.
It works by adding the assignment to the beginning of the command string
as \f[C]IFS=...; ...\f[R].
The reason is that \f[C]IFS\f[R] variable is not inherited by the shell
for security reasons.
This method assumes a POSIX shell syntax so it can fail for non-POSIX
shells.
This option has no effect when the value is left empty.
This option does not have any effect on Windows.
.SS ignorecase (bool) (default true)
.PP
Ignore case in sorting and search patterns.
.SS ignoredia (bool) (default true)
.PP
Ignore diacritics in sorting and search patterns.
.SS incsearch (bool) (default false)
.PP
Jump to the first match after each keystroke during searching.
.SS incfilter (bool) (default false)
.PP
Apply filter pattern after each keystroke during filtering.
.SS info ([]string) (default \[ga]\[ga])
.PP
A list of information that is shown for directory items at the right
side of the pane.
Currently supported information types are \f[C]size\f[R],
\f[C]time\f[R], \f[C]atime\f[R], \f[C]ctime\f[R], \f[C]perm\f[R],
\f[C]user\f[R] and \f[C]group\f[R].
Information is only shown when the pane width is more than twice the
width of information.
.SS infotimefmtnew (string) (default \f[C]Jan _2 15:04\f[R])
.PP
Format string of the file time shown in the info column when it matches
this year.
.SS infotimefmtold (string) (default \f[C]Jan _2  2006\f[R])
.PP
Format string of the file time shown in the info column when it
doesn\[aq]t match this year.
.SS locale (string) (default \[ga]\[ga])
.PP
An IETF BCP 47 language tag (e.g.
\f[C]zh-CN\f[R]) for specifying the locale used when using sort type
\f[C]natural\f[R] and \f[C]name\f[R].
An empty string means disable locale ordering, and the special value
\f[C]*\f[R] is used to indicate reading the locale setting from the
system environment.
This feature is currently experimental.
.SS mouse (bool) (default false)
.PP
Send mouse events as input.
.SS number (bool) (default false)
.PP
Show the position number for directory items on the left side of the
pane.
When the \f[C]relativenumber\f[R] option is enabled, only the current
line shows the absolute position and relative positions are shown for
the rest.
.SS numberfmt (string) (default \f[C]\[rs]033[33m\f[R])
.PP
Format string of the position number for each line.
.SS period (int) (default 0)
.PP
Set the interval in seconds for periodic checks of directory updates.
This works by periodically calling the \f[C]load\f[R] command.
Note that directories are already updated automatically in many cases.
This option can be useful when there is an external process changing the
displayed directory and you are not doing anything in lf.
Periodic checks are disabled when the value of this option is set to
zero.
.SS preserve ([]string) (default \f[C]mode\f[R])
.PP
List of attributes that are preserved when copying files.
Currently supported attributes are \f[C]mode\f[R] (i.a.
access mode) and \f[C]timestamps\f[R] (i.e.
modification time and access time).
Note that preserving other attributes like ownership of change/birth
timestamp is desirable, but not portably supported in Go.
.SS preview (bool) (default true)
.PP
Show previews of files and directories at the rightmost pane.
If the file has more lines than the preview pane, the rest of the lines
are not read.
Files containing the null character (U+0000) in the read portion are
considered binary files and displayed as \f[C]binary\f[R].
.SS previewer (string) (default \[ga]\[ga]) (not filtered if empty)
.PP
Set the path of a previewer file to filter the content of regular files
for previewing.
The file should be executable.
The following arguments are passed to the file, (1) current file name,
(2) width, (3) height, (4) horizontal position, and (5) vertical
position of preview pane respectively.
SIGPIPE signal is sent when enough lines are read.
If the previewer returns a non-zero exit code, then the preview cache
for the given file is disabled.
This means that if the file is selected in the future, the previewer is
called once again.
Preview filtering is disabled and files are displayed as they are when
the value of this option is left empty.
.SS promptfmt (string) (default \f[C]\[rs]033[32;1m%u\[at]%h\[rs]033[0m:\[rs]033[34;1m%d\[rs]033[0m\[rs]033[1m%f\[rs]033[0m\f[R])
.PP
Format string of the prompt shown in the top line.
Special expansions are provided, \f[C]%u\f[R] as the user name,
\f[C]%h\f[R] as the hostname, \f[C]%w\f[R] as the working directory,
\f[C]%d\f[R] as the working directory with a trailing path separator,
\f[C]%f\f[R] as the file name, and \f[C]%F\f[R] as the current filter.
\f[C]%S\f[R] may be used once and will provide a spacer so that the
following parts are right aligned on the screen.
The home folder is shown as \f[C]\[ti]\f[R] in the working directory
expansion.
Directory names are automatically shortened to a single character
starting from the leftmost parent when the prompt does not fit the
screen.
.SS ratios ([]int) (default \f[C]1:2:3\f[R])
.PP
List of ratios of pane widths.
Number of items in the list determines the number of panes in the UI.
When the \f[C]preview\f[R] option is enabled, the rightmost number is
used for the width of the preview pane.
.SS relativenumber (bool) (default false)
.PP
Show the position number relative to the current line.
When \f[C]number\f[R] is enabled, the current line shows the absolute
position, otherwise nothing is shown.
.SS reverse (bool) (default false)
.PP
Reverse the direction of sort.
.SS roundbox (bool) (default false)
.PP
Draw rounded outer corners when the \f[C]drawbox\f[R] option is enabled.
.SS rulerfmt (string) (default \f[C]  %a|  %p|  \[rs]033[7;31m %m \[rs]033[0m|  \[rs]033[7;33m %c \[rs]033[0m|  \[rs]033[7;35m %s \[rs]033[0m|  \[rs]033[7;34m %f \[rs]033[0m|  %i/%t\f[R])
.PP
Format string of the ruler shown in the bottom right corner.
Special expansions are provided, \f[C]%a\f[R] as the pressed keys,
\f[C]%p\f[R] as the progress of file operations, \f[C]%m\f[R] as the
number of files to be cut (moved), \f[C]%c\f[R] as the number of files
to be copied, \f[C]%s\f[R] as the number of selected files, \f[C]%f\f[R]
as the filter, \f[C]%i\f[R] as the position of the cursor, \f[C]%t\f[R]
as the number of files shown in the current directory, \f[C]%h\f[R] as
the number of files hidden in the current directory, and \f[C]%d\f[R] as
the amount of free disk space remaining.
Additional expansions are provided for environment variables exported by
lf, in the form \f[C]%{lf_<name>}\f[R] (e.g.
\f[C]%{lf_selmode}\f[R]).
This is useful for displaying the current settings.
Expansions are also provided for user-defined options, in the form
\f[C]%{lf_user_<name>}\f[R] (e.g.
\f[C]%{lf_user_foo}\f[R]).
The \f[C]|\f[R] character splits the format string into sections.
Any section containing a failed expansion (result is a blank string) is
discarded and not shown.
.SS selectfmt (string) (default \f[C]\[rs]033[7;35m\f[R])
.PP
Format string of the indicator for files that are selected.
.SS selmode (string) (default \f[C]all\f[R])
.PP
Selection mode for commands.
When set to \f[C]all\f[R] it will use the selected files from all
directories.
When set to \f[C]dir\f[R] it will only use the selected files in the
current directory.
.SS scrolloff (int) (default 0)
.PP
Minimum number of offset lines shown at all times at the top and bottom
of the screen when scrolling.
The current line is kept in the middle when this option is set to a
large value that is bigger than the half of number of lines.
A smaller offset can be used when the current file is close to the
beginning or end of the list to show the maximum number of items.
.SS shell (string) (default \f[C]sh\f[R] for Unix and \f[C]cmd\f[R] for Windows)
.PP
Shell executable to use for shell commands.
Shell commands are executed as
\f[C]shell shellopts shellflag command -- arguments\f[R].
.SS shellflag (string) (default \f[C]-c\f[R] for Unix and \f[C]/c\f[R] for Windows)
.PP
Command line flag used to pass shell commands.
.SS shellopts ([]string) (default \[ga]\[ga])
.PP
List of shell options to pass to the shell executable.
.SS showbinds (bool) (default true)
.PP
Show bindings associated with pressed keys.
.SS sixel (bool) (default false)
.PP
Render sixel images in preview.
.SS smartcase (bool) (default true)
.PP
Override \f[C]ignorecase\f[R] option when the pattern contains an
uppercase character.
This option has no effect when \f[C]ignorecase\f[R] is disabled.
.SS smartdia (bool) (default false)
.PP
Override \f[C]ignoredia\f[R] option when the pattern contains a
character with diacritic.
This option has no effect when \f[C]ignoredia\f[R] is disabled.
.SS sortby (string) (default \f[C]natural\f[R])
.PP
Sort type for directories.
Currently supported sort types are \f[C]natural\f[R], \f[C]name\f[R],
\f[C]size\f[R], \f[C]time\f[R], \f[C]ctime\f[R], \f[C]atime\f[R], and
\f[C]ext\f[R].
.SS statfmt (string) (default \f[C]\[rs]033[36m%p\[rs]033[0m| %c| %u| %g| %S| %t| -> %l\f[R])
.PP
Format string of the file info shown in the bottom left corner.
Special expansions are provided, \f[C]%p\f[R] as the file permissions,
\f[C]%c\f[R] as the link count, \f[C]%u\f[R] as the user, \f[C]%g\f[R]
as the group, \f[C]%s\f[R] as the file size, \f[C]%S\f[R] as the file
size but with a fixed width of four characters (left-padded with
spaces), \f[C]%t\f[R] as the last modified time, and \f[C]%l\f[R] as the
link target.
The \f[C]|\f[R] character splits the format string into sections.
Any section containing a failed expansion (result is a blank string) is
discarded and not shown.
.SS tabstop (int) (default 8)
.PP
Number of space characters to show for horizontal tabulation (U+0009)
character.
.SS tagfmt (string) (default \f[C]\[rs]033[31m\f[R])
.PP
Format string of the tags.
.PP
If the format string contains the characters \f[C]%s\f[R], it is
interpreted as a format string for \f[C]fmt.Sprintf\f[R].
Such a string should end with the terminal reset sequence.
For example, \f[C]\[rs]033[4m%s\[rs]033[0m\f[R] has the same effect as
\f[C]\[rs]033[4m\f[R].
.SS tempmarks (string) (default \[ga]\[ga])
.PP
Marks to be considered temporary (e.g.
\f[C]abc\f[R] refers to marks \f[C]a\f[R], \f[C]b\f[R], and
\f[C]c\f[R]).
These marks are not synced to other clients and they are not saved in
the bookmarks file.
Note that the special bookmark \f[C]\[ga]\f[R] is always treated as
temporary and it does not need to be specified.
.SS timefmt (string) (default \f[C]Mon Jan _2 15:04:05 2006\f[R])
.PP
Format string of the file modification time shown in the bottom line.
.SS truncatechar (string) (default \f[C]\[ti]\f[R])
.PP
The truncate character that is shown at the end when the file name does
not fit into the pane.
.SS truncatepct (int) (default 100)
.PP
When a filename is too long to be shown completely, the available space
is partitioned into two pieces.
truncatepct defines a fraction (in percent between 0 and 100) for the
size of the first piece, which will show the beginning of the filename.
The second piece will show the end of the filename and will use the rest
of the available space.
Both pieces are separated by the truncation character (truncatechar).
A value of 100 will only show the beginning of the filename, while a
value of 0 will only show the end of the filename, e.g.:
.IP \[bu] 2
\f[C]set truncatepct 100\f[R] -> \f[C]very-long-filename-tr\[ti]\f[R]
(default)
.IP \[bu] 2
\f[C]set truncatepct 50\f[R] -> \f[C]very-long-f\[ti]-truncated\f[R]
.IP \[bu] 2
\f[C]set truncatepct 0\f[R] -> \f[C]\[ti]ng-filename-truncated\f[R]
.SS waitmsg (string) (default \f[C]Press any key to continue\f[R])
.PP
String shown after commands of shell-wait type.
.SS watch (bool) (default false)
.PP
Watch the filesystem for changes using \f[C]fsnotify\f[R] to
automatically refresh file information.
FUSE is currently not supported due to limitations in
\f[C]fsnotify\f[R].
.SS wrapscan (bool) (default true)
.PP
Searching can wrap around the file list.
.SS wrapscroll (bool) (default false)
.PP
Scrolling can wrap around the file list.
.SS user_{option} (string) (default none)
.PP
Any option that is prefixed with \f[C]user_\f[R] is a user-defined
option and can be set to any string.
Inside a user-defined command, the value will be provided in the
\f[C]lf_user_{option}\f[R] environment variable.
These options are not used by lf and are not persisted.
.SH ENVIRONMENT VARIABLES
.PP
The following variables are exported for shell commands: These are
referred to with a \f[C]$\f[R] prefix on POSIX shells (e.g.
\f[C]$f\f[R]), between \f[C]%\f[R] characters on Windows cmd (e.g.
\f[C]%f%\f[R]), and with a \f[C]$env:\f[R] prefix on Windows PowerShell
(e.g.
\f[C]$env:f\f[R]).
.SS f
.PP
Current file selection as a full path.
.SS fs
.PP
Selected file(s) separated with the value of \f[C]filesep\f[R] option as
full path(s).
.SS fx
.PP
Selected file(s) (i.e.
\f[C]fs\f[R]) if there are any selected files, otherwise current file
selection (i.e.
\f[C]f\f[R]).
.SS id
.PP
Id of the running client.
.SS PWD
.PP
Present working directory.
.SS OLDPWD
.PP
Initial working directory.
.SS LF_LEVEL
.PP
The value of this variable is set to the current nesting level when you
run lf from a shell spawned inside lf.
You can add the value of this variable to your shell prompt to make it
clear that your shell runs inside lf.
For example, with POSIX shells, you can use
\f[C][ -n \[dq]$LF_LEVEL\[dq] ] && PS1=\[dq]$PS1\[dq]\[dq](lf level: $LF_LEVEL) \[dq]\f[R]
in your shell configuration file (e.g.
\f[C]\[ti]/.bashrc\f[R]).
.SS OPENER
.PP
If this variable is set in the environment, use the same value.
Otherwise, this is set to \f[C]start\f[R] in Windows, \f[C]open\f[R] in
MacOS, \f[C]xdg-open\f[R] in others.
.SS EDITOR
.PP
If VISUAL is set in the environment, use its value.
Otherwise, use the value of the environment variable EDITOR.
If neither variable is set, this is set to \f[C]vi\f[R] on Unix,
\f[C]notepad\f[R] in Windows.
.SS PAGER
.PP
If this variable is set in the environment, use the same value.
Otherwise, this is set to \f[C]less\f[R] on Unix, \f[C]more\f[R] in
Windows.
.SS SHELL
.PP
If this variable is set in the environment, use the same value.
Otherwise, this is set to \f[C]sh\f[R] on Unix, \f[C]cmd\f[R] in
Windows.
.SS lf
.PP
Absolute path to the currently running lf binary, if it can be found.
Otherwise, this is set to the string \f[C]lf\f[R].
.SS lf_{option}
.PP
Value of the {option}.
.SS lf_user_{option}
.PP
Value of the user_{option}.
.SS lf_width, lf_height
.PP
Width/Height of the terminal.
.SS lf_count
.PP
Value of the count associated with the current command.
.SS lf_mode
.PP
Current mode that \f[C]lf\f[R] is operating in.
This is useful for customizing keybindings depending on what the current
mode is.
Possible values are \f[C]delete\f[R], \f[C]rename\f[R],
\f[C]filter\f[R], \f[C]find\f[R], \f[C]mark\f[R], \f[C]search\f[R],
\f[C]command\f[R], \f[C]shell\f[R], \f[C]pipe\f[R] (when running a
shell-pipe command), \f[C]normal\f[R], and \f[C]unknown\f[R].
.SH SPECIAL COMMANDS
.PP
This section shows information about special shell commands.
.SS open
.PP
This shell command can be defined to override the default \f[C]open\f[R]
command when the current file is not a directory.
.SS paste
.PP
This shell command can be defined to override the default
\f[C]paste\f[R] command.
.SS rename
.PP
This shell command can be defined to override the default
\f[C]rename\f[R] command.
.SS delete
.PP
This shell command can be defined to override the default
\f[C]delete\f[R] command.
.SS pre-cd
.PP
This shell command can be defined to be executed before changing a
directory.
.SS on-cd
.PP
This shell command can be defined to be executed after changing a
directory.
.SS on-focus-gained
.PP
This shell command can be defined to be executed when the terminal gains
focus.
.SS on-focus-lost
.PP
This shell command can be defined to be executed when the terminal loses
focus.
.SS on-init
.PP
This shell command can be defined to be executed after initializing and
connecting to the server.
.SS on-select
.PP
This shell command can be defined to be executed after the selection
changes.
.SS on-redraw
.PP
This shell command can be defined to be executed after the screen is
redrawn or if the terminal is resized.
.SS on-quit
.PP
This shell command can be defined to be executed before quitting.
.SH PREFIXES
.PP
The following command prefixes are used by lf:
.IP
.nf
\f[C]
:  read (default)  builtin/custom command
$  shell           shell command
%  shell-pipe      shell command running with the UI
!  shell-wait      shell command waiting for a key press
&  shell-async     shell command running asynchronously
\f[R]
.fi
.PP
The same evaluator is used for the command line and the configuration
file for reading shell commands.
The difference is that prefixes are not necessary in the command line.
Instead, different modes are provided to read corresponding commands.
These modes are mapped to the prefix keys above by default.
.SH SYNTAX
.PP
Characters from \f[C]#\f[R] to newline are comments and ignored:
.IP
.nf
\f[C]
# comments start with \[ga]#\[ga]
\f[R]
.fi
.PP
There are five special commands (\f[C]set\f[R], \f[C]setlocal\f[R],
\f[C]map\f[R], \f[C]cmap\f[R], and \f[C]cmd\f[R]) for configuration.
.PP
Command \f[C]set\f[R] is used to set an option which can be a boolean,
integer, or string:
.IP
.nf
\f[C]
set hidden         # boolean enable
set hidden true    # boolean enable
set nohidden       # boolean disable
set hidden false   # boolean disable
set hidden!        # boolean toggle
set scrolloff 10   # integer value
set sortby time    # string value w/o quotes
set sortby \[aq]time\[aq]  # string value with single quotes (whitespaces)
set sortby \[dq]time\[dq]  # string value with double quotes (backslash escapes)
\f[R]
.fi
.PP
Command \f[C]setlocal\f[R] is used to set a local option for a directory
which can be a boolean or string.
Currently supported local options are \f[C]dirfirst\f[R],
\f[C]dironly\f[R], \f[C]hidden\f[R], \f[C]info\f[R], \f[C]reverse\f[R],
\f[C]sortby\f[R] and \f[C]locale\f[R].
Adding a trailing path separator (i.e.
\f[C]/\f[R] for Unix and \f[C]\[rs]\f[R] for Windows) sets the option
for the given directory along with its subdirectories:
.IP
.nf
\f[C]
setlocal /foo/bar hidden         # boolean enable
setlocal /foo/bar hidden true    # boolean enable
setlocal /foo/bar nohidden       # boolean disable
setlocal /foo/bar hidden false   # boolean disable
setlocal /foo/bar hidden!        # boolean toggle
setlocal /foo/bar sortby time    # string value w/o quotes
setlocal /foo/bar sortby \[aq]time\[aq]  # string value with single quotes (whitespaces)
setlocal /foo/bar sortby \[dq]time\[dq]  # string value with double quotes (backslash escapes)
setlocal /foo/bar  hidden        # for only \[aq]/foo/bar\[aq] directory
setlocal /foo/bar/ hidden        # for \[aq]/foo/bar\[aq] and its subdirectories (e.g. \[aq]/foo/bar/baz\[aq])
\f[R]
.fi
.PP
Command \[aq]map\[aq] is used to bind a key to a command which can be a
builtin command, custom command, or shell command:
.IP
.nf
\f[C]
map gh cd \[ti]        # builtin command
map D trash        # custom command
map i $less $f     # shell command
map U !du -csh *   # waiting shell command
\f[R]
.fi
.PP
Command \[aq]cmap\[aq] is used to bind a key on the command line to a
command line command or any other command:
.IP
.nf
\f[C]
cmap <c-g> cmd-escape
cmap <a-i> set incsearch!
\f[R]
.fi
.PP
You can delete an existing binding by leaving the expression empty:
.IP
.nf
\f[C]
map gh             # deletes \[aq]gh\[aq] mapping
cmap <c-g>         # deletes \[aq]<c-g>\[aq] mapping
\f[R]
.fi
.PP
Command \f[C]cmd\f[R] is used to define a custom command:
.IP
.nf
\f[C]
cmd usage $du -h -d1 | less
\f[R]
.fi
.PP
You can delete an existing command by leaving the expression empty:
.IP
.nf
\f[C]
cmd trash          # deletes \[aq]trash\[aq] command
\f[R]
.fi
.PP
If there is no prefix then \f[C]:\f[R] is assumed:
.IP
.nf
\f[C]
map zt set info time
\f[R]
.fi
.PP
An explicit \f[C]:\f[R] can be provided to group statements until a
newline which is especially useful for \f[C]map\f[R] and \f[C]cmd\f[R]
commands:
.IP
.nf
\f[C]
map st :set sortby time; set info time
\f[R]
.fi
.PP
If you need multiline you can wrap statements in \f[C]{{\f[R] and
\f[C]}}\f[R] after the proper prefix.
.IP
.nf
\f[C]
map st :{{
    set sortby time
    set info time
}}
\f[R]
.fi
.SH KEY MAPPINGS
.PP
Regular keys are assigned to a command with the usual syntax:
.IP
.nf
\f[C]
map a down
\f[R]
.fi
.PP
Keys combined with the shift key simply use the uppercase letter:
.IP
.nf
\f[C]
map A down
\f[R]
.fi
.PP
Special keys are written in between \f[C]<\f[R] and \f[C]>\f[R]
characters and always use lowercase letters:
.IP
.nf
\f[C]
map <enter> down
\f[R]
.fi
.PP
Angle brackets can be assigned with their special names:
.IP
.nf
\f[C]
map <lt> down
map <gt> down
\f[R]
.fi
.PP
Function keys are prefixed with \f[C]f\f[R] character:
.IP
.nf
\f[C]
map <f-1> down
\f[R]
.fi
.PP
Keys combined with the control key are prefixed with a \f[C]c\f[R]
character:
.IP
.nf
\f[C]
map <c-a> down
\f[R]
.fi
.PP
Keys combined with the alt key are assigned in two different ways
depending on the behavior of your terminal.
Older terminals (e.g.
xterm) may set the 8th bit of a character when the alt key is pressed.
On these terminals, you can use the corresponding byte for the mapping:
.IP
.nf
\f[C]
map \['a] down
\f[R]
.fi
.PP
Newer terminals (e.g.
gnome-terminal) may prefix the key with an escape key when the alt key
is pressed.
lf uses the escape delaying mechanism to recognize alt keys in these
terminals (delay is 100ms).
On these terminals, keys combined with the alt key are prefixed with an
\f[C]a\f[R] character:
.IP
.nf
\f[C]
map <a-a> down
\f[R]
.fi
.PP
It is possible to combine special keys with modifiers:
.IP
.nf
\f[C]
map <a-enter> down
\f[R]
.fi
.PP
WARNING: Some key combinations will likely be intercepted by your OS,
window manager, or terminal.
Other key combinations cannot be recognized by lf due to the way
terminals work (e.g.
\f[C]Ctrl+h\f[R] combination sends a backspace key instead).
The easiest way to find out the name of a key combination and whether it
will work on your system is to press the key while lf is running and
read the name from the \f[C]unknown mapping\f[R] error.
.PP
Mouse buttons are prefixed with an \f[C]m\f[R] character:
.IP
.nf
\f[C]
map <m-1> down  # primary
map <m-2> down  # secondary
map <m-3> down  # middle
map <m-4> down
map <m-5> down
map <m-6> down
map <m-7> down
map <m-8> down
\f[R]
.fi
.PP
Mouse wheel events are also prefixed with an \f[C]m\f[R] character:
.IP
.nf
\f[C]
map <m-up>    down
map <m-down>  down
map <m-left>  down
map <m-right> down
\f[R]
.fi
.SH PUSH MAPPINGS
.PP
The usual way to map a key sequence is to assign it to a named or
unnamed command.
While this provides a clean way to remap built-in keys as well as other
commands, it can be limiting at times.
For this reason, the \f[C]push\f[R] command is provided by lf.
This command is used to simulate key pushes given as its arguments.
You can \f[C]map\f[R] a key to a \f[C]push\f[R] command with an argument
to create various keybindings.
.PP
This is mainly useful for two purposes.
First, it can be used to map a command with a command count:
.IP
.nf
\f[C]
map <c-j> push 10j
\f[R]
.fi
.PP
Second, it can be used to avoid typing the name when a command takes
arguments:
.IP
.nf
\f[C]
map r push :rename<space>
\f[R]
.fi
.PP
One thing to be careful of is that since the \f[C]push\f[R] command
works with keys instead of commands it is possible to accidentally
create recursive bindings:
.IP
.nf
\f[C]
map j push 2j
\f[R]
.fi
.PP
These types of bindings create a deadlock when executed.
.SH SHELL COMMANDS
.PP
Regular shell commands are the most basic command type that is useful
for many purposes.
For example, we can write a shell command to move the selected file(s)
to trash.
A first attempt to write such a command may look like this:
.IP
.nf
\f[C]
cmd trash ${{
    mkdir -p \[ti]/.trash
    if [ -z \[dq]$fs\[dq] ]; then
        mv \[dq]$f\[dq] \[ti]/.trash
    else
        IFS=\[dq]$(printf \[aq]\[rs]n\[rs]t\[aq])\[dq]; mv $fs \[ti]/.trash
    fi
}}
\f[R]
.fi
.PP
We check \f[C]$fs\f[R] to see if there are any selected files.
Otherwise, we just delete the current file.
Since this is such a common pattern, a separate \f[C]$fx\f[R] variable
is provided.
We can use this variable to get rid of the conditional:
.IP
.nf
\f[C]
cmd trash ${{
    mkdir -p \[ti]/.trash
    IFS=\[dq]$(printf \[aq]\[rs]n\[rs]t\[aq])\[dq]; mv $fx \[ti]/.trash
}}
\f[R]
.fi
.PP
The trash directory is checked each time the command is executed.
We can move it outside of the command so it would only run once at
startup:
.IP
.nf
\f[C]
${{ mkdir -p \[ti]/.trash }}

cmd trash ${{ IFS=\[dq]$(printf \[aq]\[rs]n\[rs]t\[aq])\[dq]; mv $fx \[ti]/.trash }}
\f[R]
.fi
.PP
Since these are one-liners, we can drop \f[C]{{\f[R] and \f[C]}}\f[R]:
.IP
.nf
\f[C]
$mkdir -p \[ti]/.trash

cmd trash $IFS=\[dq]$(printf \[aq]\[rs]n\[rs]t\[aq])\[dq]; mv $fx \[ti]/.trash
\f[R]
.fi
.PP
Finally, note that we set the \f[C]IFS\f[R] variable manually in these
commands.
Instead, we could use the \f[C]ifs\f[R] option to set it for all shell
commands (i.e.
\f[C]set ifs \[dq]\[rs]n\[dq]\f[R]).
This can be especially useful for interactive use (e.g.
\f[C]$rm $f\f[R] or \f[C]$rm $fs\f[R] would simply work).
This option is not set by default as it can behave unexpectedly for new
users.
However, use of this option is highly recommended and it is assumed in
the rest of the documentation.
.SH PIPING SHELL COMMANDS
.PP
Regular shell commands have some limitations in some cases.
When an output or error message is given and the command exits
afterwards, the ui is immediately resumed and there is no way to see the
message without dropping to shell again.
Also, even when there is no output or error, the UI still needs to be
paused while the command is running.
This can cause flickering on the screen for short commands and similar
distractions for longer commands.
.PP
Instead of pausing the UI, piping shell commands connect stdin, stdout,
and stderr of the command to the statline at the bottom of the UI.
This can be useful for programs following the Unix philosophy to give no
output in the success case, and brief error messages or prompts in other
cases.
.PP
For example, following rename command prompts for overwrite in the
statline if there is an existing file with the given name:
.IP
.nf
\f[C]
cmd rename %mv -i $f $1
\f[R]
.fi
.PP
You can also output error messages in the command and it will show up in
the statline.
For example, an alternative rename command may look like this:
.IP
.nf
\f[C]
cmd rename %[ -e $1 ] && printf \[dq]file exists\[dq] || mv $f $1
\f[R]
.fi
.PP
Note that input is line buffered and output and error are byte buffered.
.SH WAITING SHELL COMMANDS
.PP
Waiting shell commands are similar to regular shell commands except that
they wait for a key press when the command is finished.
These can be useful to see the output of a program before the UI is
resumed.
Waiting shell commands are more appropriate than piping shell commands
when the command is verbose and the output is best displayed as
multiline.
.SH ASYNCHRONOUS SHELL COMMANDS
.PP
Asynchronous shell commands are used to start a command in the
background and then resume operation without waiting for the command to
finish.
Stdin, stdout, and stderr of the command are neither connected to the
terminal nor the UI.
.SH REMOTE COMMANDS
.PP
One of the more advanced features in lf is remote commands.
All clients connect to a server on startup.
It is possible to send commands to all or any of the connected clients
over the common server.
This is used internally to notify file selection changes to other
clients.
.PP
To use this feature, you need to use a client which supports
communicating with a Unix domain socket.
OpenBSD implementation of netcat (nc) is one such example.
You can use it to send a command to the socket file:
.IP
.nf
\f[C]
echo \[aq]send echo hello world\[aq] | nc -U ${XDG_RUNTIME_DIR:-/tmp}/lf.${USER}.sock
\f[R]
.fi
.PP
Since such a client may not be available everywhere, lf comes bundled
with a command line flag to be used as such.
When using lf, you do not need to specify the address of the socket
file.
This is the recommended way of using remote commands since it is shorter
and immune to socket file address changes:
.IP
.nf
\f[C]
lf -remote \[aq]send echo hello world\[aq]
\f[R]
.fi
.PP
In this command \f[C]send\f[R] is used to send the rest of the string as
a command to all connected clients.
You can optionally give it an ID number to send a command to a single
client:
.IP
.nf
\f[C]
lf -remote \[aq]send 1234 echo hello world\[aq]
\f[R]
.fi
.PP
All clients have a unique id number but you may not be aware of the id
number when you are writing a command.
For this purpose, an \f[C]$id\f[R] variable is exported to the
environment for shell commands.
The value of this variable is set to the process ID of the client.
You can use it to send a remote command from a client to the server
which in return sends a command back to itself.
So now you can display a message in the current client by calling the
following in a shell command:
.IP
.nf
\f[C]
lf -remote \[dq]send $id echo hello world\[dq]
\f[R]
.fi
.PP
Since lf does not have control flow syntax, remote commands are used for
such needs.
For example, you can configure the number of columns in the UI with
respect to the terminal width as follows:
.IP
.nf
\f[C]
cmd recol %{{
    if [ $lf_width -le 80 ]; then
        lf -remote \[dq]send $id set ratios 1:2\[dq]
    elif [ $lf_width -le 160 ]; then
        lf -remote \[dq]send $id set ratios 1:2:3\[dq]
    else
        lf -remote \[dq]send $id set ratios 1:2:3:5\[dq]
    fi
}}
\f[R]
.fi
.PP
In addition, the \f[C]query\f[R] command can be used to obtain
information about a specific lf instance by providing its id:
.IP
.nf
\f[C]
lf -remote \[dq]query $id maps\[dq]
\f[R]
.fi
.PP
The following types of information are supported:
.IP
.nf
\f[C]
maps     list of mappings created by the \[aq]map\[aq] command
cmaps    list of mappings created by the \[aq]cmap\[aq] command
cmds     list of commands created by the \[aq]cmd\[aq] command
jumps    contents of the jump list, showing previously visited locations
history  list of previously executed commands on the command line
files    list of files in the currently open directory as displayed by lf, empty if dir is still loading
\f[R]
.fi
.PP
This is useful for scripting actions based on the internal state of lf.
For example, to select a previous command using fzf and execute it:
.IP
.nf
\f[C]
map <a-h> ${{
    clear
    cmd=$(
        lf -remote \[dq]query $id history\[dq] |
        awk -F\[aq]\[rs]t\[aq] \[aq]NR > 1 { print $NF}\[aq] |
        sort -u |
        fzf --reverse --prompt=\[aq]Execute command: \[aq]
    )
    lf -remote \[dq]send $id $cmd\[dq]
}}
\f[R]
.fi
.PP
There is also a \f[C]quit\f[R] command to quit the server when there are
no connected clients left, and a \f[C]quit!\f[R] command to force quit
the server by closing client connections first:
.IP
.nf
\f[C]
lf -remote \[aq]quit\[aq]
lf -remote \[aq]quit!\[aq]
\f[R]
.fi
.PP
Lastly, there is a \f[C]conn\f[R] command to connect the server to a
client.
This should not be needed for users.
.SH FILE OPERATIONS
.PP
lf uses its own built-in copy and move operations by default.
These are implemented as asynchronous operations and progress is shown
in the bottom ruler.
These commands do not overwrite existing files or directories with the
same name.
Instead, a suffix that is compatible with the
\f[C]--backup=numbered\f[R] option in GNU cp is added to the new files
or directories.
Only file modes and (some) timestamps can be preserved (see
\f[C]preserve\f[R] option), all other attributes are ignored including
ownership, context, and xattr.
Special files such as character and block devices, named pipes, and
sockets are skipped and links are not followed.
Moving is performed using the rename operation of the underlying OS.
For cross-device moving, lf falls back to copying and then deletes the
original files if there are no errors.
Operation errors are shown in the message line as well as the log file
and they do not preemptively finish the corresponding file operation.
.PP
File operations can be performed on the currently selected file or on
multiple files by selecting them first.
When you \f[C]copy\f[R] a file, lf doesn\[aq]t actually copy the file on
the disk, but only records its name to a file.
The actual file copying takes place when you \f[C]paste\f[R].
Similarly \f[C]paste\f[R] after a \f[C]cut\f[R] operation moves the
file.
.PP
You can customize copy and move operations by defining a \f[C]paste\f[R]
command.
This is a special command that is called when it is defined instead of
the built-in implementation.
You can use the following example as a starting point:
.IP
.nf
\f[C]
cmd paste %{{
    load=$(cat \[ti]/.local/share/lf/files)
    mode=$(echo \[dq]$load\[dq] | sed -n \[aq]1p\[aq])
    list=$(echo \[dq]$load\[dq] | sed \[aq]1d\[aq])
    if [ $mode = \[aq]copy\[aq] ]; then
        cp -R $list .
    elif [ $mode = \[aq]move\[aq] ]; then
        mv $list .
        rm \[ti]/.local/share/lf/files
        lf -remote \[aq]send clear\[aq]
    fi
}}
\f[R]
.fi
.PP
Some useful things to be considered are to use the backup
(\f[C]--backup\f[R]) and/or preserve attributes (\f[C]-a\f[R]) options
with \f[C]cp\f[R] and \f[C]mv\f[R] commands if they support it (i.e.
GNU implementation), change the command type to asynchronous, or use
\f[C]rsync\f[R] command with progress bar option for copying and feed
the progress to the client periodically with remote \f[C]echo\f[R]
calls.
.PP
By default, lf does not assign \f[C]delete\f[R] command to a key to
protect new users.
You can customize file deletion by defining a \f[C]delete\f[R] command.
You can also assign a key to this command if you like.
An example command to move selected files to a trash folder and remove
files completely after a prompt is provided in the example configuration
file.
.SH SEARCHING FILES
.PP
There are two mechanisms implemented in lf to search a file in the
current directory.
Searching is the traditional method to move the selection to a file
matching a given pattern.
Finding is an alternative way to search for a pattern possibly using
fewer keystrokes.
.PP
The searching mechanism is implemented with commands \f[C]search\f[R]
(default \f[C]/\f[R]), \f[C]search-back\f[R] (default \f[C]?\f[R]),
\f[C]search-next\f[R] (default \f[C]n\f[R]), and \f[C]search-prev\f[R]
(default \f[C]N\f[R]).
You can enable \f[C]globsearch\f[R] option to match with a glob pattern.
Globbing supports \f[C]*\f[R] to match any sequence, \f[C]?\f[R] to
match any character, and \f[C][...]\f[R] or \f[C][\[ha]...]\f[R] to
match character sets or ranges.
You can enable \f[C]incsearch\f[R] option to jump to the current match
at each keystroke while typing.
In this mode, you can either use \f[C]cmd-enter\f[R] to accept the
search or use \f[C]cmd-escape\f[R] to cancel the search.
You can also map some other commands with \f[C]cmap\f[R] to accept the
search and execute the command immediately afterwards.
For example, you can use the right arrow key to finish the search and
open the selected file with the following mapping:
.IP
.nf
\f[C]
cmap <right> :cmd-enter; open
\f[R]
.fi
.PP
The finding mechanism is implemented with commands \f[C]find\f[R]
(default \f[C]f\f[R]), \f[C]find-back\f[R] (default \f[C]F\f[R]),
\f[C]find-next\f[R] (default \f[C];\f[R]), \f[C]find-prev\f[R] (default
\f[C],\f[R]).
You can disable \f[C]anchorfind\f[R] option to match a pattern at an
arbitrary position in the filename instead of the beginning.
You can set the number of keys to match using \f[C]findlen\f[R] option.
If you set this value to zero, then the keys are read until there is
only a single match.
The default values of these two options are set to jump to the first
file with the given initial.
.PP
Some options effect both searching and finding.
You can disable \f[C]wrapscan\f[R] option to prevent searches from being
wrapped around at the end of the file list.
You can disable \f[C]ignorecase\f[R] option to match cases in the
pattern and the filename.
This option is already automatically overridden if the pattern contains
upper-case characters.
You can disable \f[C]smartcase\f[R] option to disable this behavior.
Two similar options \f[C]ignoredia\f[R] and \f[C]smartdia\f[R] are
provided to control matching diacritics in Latin letters.
.SH OPENING FILES
.PP
You can define an \f[C]open\f[R] command (default \f[C]l\f[R] and
\f[C]<right>\f[R]) to configure file opening.
This command is only called when the current file is not a directory,
otherwise, the directory is entered instead.
You can define it just as you would define any other command:
.IP
.nf
\f[C]
cmd open $vi $fx
\f[R]
.fi
.PP
It is possible to use different command types:
.IP
.nf
\f[C]
cmd open &xdg-open $f
\f[R]
.fi
.PP
You may want to use either file extensions or mime types from
\f[C]file\f[R] command:
.IP
.nf
\f[C]
cmd open ${{
    case $(file --mime-type -Lb $f) in
        text/*) vi $fx;;
        *) for f in $fx; do xdg-open $f > /dev/null 2> /dev/null & done;;
    esac
}}
\f[R]
.fi
.PP
You may want to use \f[C]setsid\f[R] before your opener command to have
persistent processes that continue to run after lf quits.
.PP
Regular shell commands (i.e.
\f[C]$\f[R]) drop to the terminal which results in a flicker for
commands that finish immediately (e.g.
\f[C]xdg-open\f[R] in the above example).
If you want to use asynchronous shell commands (i.e.
\f[C]&\f[R]) but also want to use the terminal when necessary (e.g.
\f[C]vi\f[R] in the above example), you can use a remote command:
.IP
.nf
\f[C]
cmd open &{{
    case $(file --mime-type -Lb $f) in
        text/*) lf -remote \[dq]send $id \[rs]$vi \[rs]$fx\[dq];;
        *) for f in $fx; do xdg-open $f > /dev/null 2> /dev/null & done;;
    esac
}}
\f[R]
.fi
.PP
Note that asynchronous shell commands run in their own process group by
default so they do not require the manual use of \f[C]setsid\f[R].
.PP
The following command is provided by default:
.IP
.nf
\f[C]
cmd open &$OPENER $f
\f[R]
.fi
.PP
You may also use any other existing file openers as you like.
Possible options are \f[C]libfile-mimeinfo-perl\f[R] (executable name is
\f[C]mimeopen\f[R]), \f[C]rifle\f[R] (ranger\[aq]s default file opener),
or \f[C]mimeo\f[R] to name a few.
.SH PREVIEWING FILES
.PP
lf previews files on the preview pane by printing the file until the end
or until the preview pane is filled.
This output can be enhanced by providing a custom preview script for
filtering.
This can be used to highlight source codes, list contents of archive
files or view PDF or image files to name a few.
For coloring lf recognizes ANSI escape codes.
.PP
To use this feature, you need to set the value of \f[C]previewer\f[R]
option to the path of an executable file.
Five arguments are passed to the file, (1) current file name, (2) width,
(3) height, (4) horizontal position, and (5) vertical position of
preview pane respectively.
The output of the execution is printed in the preview pane.
You may also want to use the same script in your pager mapping as well:
.IP
.nf
\f[C]
set previewer \[ti]/.config/lf/pv.sh
map i $\[ti]/.config/lf/pv.sh $f | less -R
\f[R]
.fi
.PP
For \f[C]less\f[R] pager, you may instead utilize \f[C]LESSOPEN\f[R]
mechanism so that useful information about the file such as the full
path of the file can still be displayed in the statusline below:
.IP
.nf
\f[C]
set previewer \[ti]/.config/lf/pv.sh
map i $LESSOPEN=\[aq]| \[ti]/.config/lf/pv.sh %s\[aq] less -R $f
\f[R]
.fi
.PP
Since this script is called for each file selection change it needs to
be as efficient as possible and this responsibility is left to the user.
You may use file extensions to determine the type of file more
efficiently compared to obtaining mime types from \f[C]file\f[R]
command.
Extensions can then be used to match cleanly within a conditional:
.IP
.nf
\f[C]
#!/bin/sh

case \[dq]$1\[dq] in
    *.tar*) tar tf \[dq]$1\[dq];;
    *.zip) unzip -l \[dq]$1\[dq];;
    *.rar) unrar l \[dq]$1\[dq];;
    *.7z) 7z l \[dq]$1\[dq];;
    *.pdf) pdftotext \[dq]$1\[dq] -;;
    *) highlight -O ansi \[dq]$1\[dq];;
esac
\f[R]
.fi
.PP
Another important consideration for efficiency is the use of programs
with short startup times for preview.
For this reason, \f[C]highlight\f[R] is recommended over
\f[C]pygmentize\f[R] for syntax highlighting.
Besides, it is also important that the application processes the file on
the fly rather than first reading it to the memory and then doing the
processing afterwards.
This is especially relevant for big files.
lf automatically closes the previewer script output pipe with a SIGPIPE
when enough lines are read.
When everything else fails, you can make use of the height argument to
only feed the first portion of the file to a program for preview.
Note that some programs may not respond well to SIGPIPE to exit with a
non-zero return code and avoid caching.
You may add a trailing \f[C]|| true\f[R] command to avoid such errors:
.IP
.nf
\f[C]
highlight -O ansi \[dq]$1\[dq] || true
\f[R]
.fi
.PP
You may also use an existing preview filter as you like.
Your system may already come with a preview filter named
\f[C]lesspipe\f[R].
These filters may have a mechanism to add user customizations as well.
See the related documentation for more information.
.SH CHANGING DIRECTORY
.PP
lf changes the working directory of the process to the current directory
so that shell commands always work in the displayed directory.
After quitting, it returns to the original directory where it is first
launched like all shell programs.
If you want to stay in the current directory after quitting, you can use
one of the example lfcd wrapper shell scripts provided in the repository
at <https://github.com/gokcehan/lf/tree/master/etc>
.PP
There is a special command \f[C]on-cd\f[R] that runs a shell command
when it is defined and the directory is changed.
You can define it just as you would define any other command:
.IP
.nf
\f[C]
cmd on-cd &{{
    bash -c \[aq]
    # display git repository status in your prompt
    source /usr/share/git/completion/git-prompt.sh
    GIT_PS1_SHOWDIRTYSTATE=auto
    GIT_PS1_SHOWSTASHSTATE=auto
    GIT_PS1_SHOWUNTRACKEDFILES=auto
    GIT_PS1_SHOWUPSTREAM=auto
    git=$(__git_ps1 \[dq] (%s)\[dq])
    fmt=\[dq]\[rs]033[32;1m%u\[at]%h\[rs]033[0m:\[rs]033[34;1m%d\[rs]033[0m\[rs]033[1m%f$git\[rs]033[0m\[dq]
    lf -remote \[dq]send $id set promptfmt \[rs]\[dq]$fmt\[rs]\[dq]\[dq]
    \[aq]
}}
\f[R]
.fi
.PP
If you want to print escape sequences, you may redirect \f[C]printf\f[R]
output to \f[C]/dev/tty\f[R].
The following xterm-specific escape sequence sets the terminal title to
the working directory:
.IP
.nf
\f[C]
cmd on-cd &{{
    printf \[dq]\[rs]033]0; $PWD\[rs]007\[dq] > /dev/tty
}}
\f[R]
.fi
.PP
This command runs whenever you change the directory but not on startup.
You can add an extra call to make it run on startup as well:
.IP
.nf
\f[C]
cmd on-cd &{{ ... }}
on-cd
\f[R]
.fi
.PP
Note that all shell commands are possible but \f[C]%\f[R] and
\f[C]&\f[R] are usually more appropriate as \f[C]$\f[R] and \f[C]!\f[R]
causes flickers and pauses respectively.
.PP
There is also a \f[C]pre-cd\f[R] command, that works like
\f[C]on-cd\f[R], but is run before the directory is actually changed.
.SH COLORS
.PP
lf tries to automatically adapt its colors to the environment.
It starts with a default color scheme and updates colors using values of
existing environment variables possibly by overwriting its previous
values.
Colors are set in the following order:
.IP "1." 3
default
.IP "2." 3
LSCOLORS (Mac/BSD ls)
.IP "3." 3
LS_COLORS (GNU ls)
.IP "4." 3
LF_COLORS (lf specific)
.IP "5." 3
colors file (lf specific)
.PP
Please refer to the corresponding man pages for more information about
\f[C]LSCOLORS\f[R] and \f[C]LS_COLORS\f[R].
\f[C]LF_COLORS\f[R] is provided with the same syntax as
\f[C]LS_COLORS\f[R] in case you want to configure colors only for lf but
not ls.
This can be useful since there are some differences between ls and lf,
though one should expect the same behavior for common cases.
The colors file (refer to the CONFIGURATION
section (https://github.com/gokcehan/lf/blob/master/doc.md#configuration))
is provided for easier configuration without environment variables.
This file should consist of whitespace-separated pairs with a
\f[C]#\f[R] character to start comments until the end of the line.
.PP
You can configure lf colors in two different ways.
First, you can only configure 8 basic colors used by your terminal and
lf should pick up those colors automatically.
Depending on your terminal, you should be able to select your colors
from a 24-bit palette.
This is the recommended approach as colors used by other programs will
also match each other.
.PP
Second, you can set the values of environment variables or colors file
mentioned above for fine-grained customization.
Note that \f[C]LS_COLORS/LF_COLORS\f[R] are more powerful than
\f[C]LSCOLORS\f[R] and they can be used even when GNU programs are not
installed on the system.
You can combine this second method with the first method for the best
results.
.PP
Lastly, you may also want to configure the colors of the prompt line to
match the rest of the colors.
Colors of the prompt line can be configured using the
\f[C]promptfmt\f[R] option which can include hardcoded colors as ANSI
escapes.
See the default value of this option to have an idea about how to color
this line.
.PP
It is worth noting that lf uses as many colors advertised by your
terminal\[aq]s entry in terminfo or infocmp databases on your system.
If an entry is not present, it falls back to an internal database.
If your terminal supports 24-bit colors but either does not have a
database entry or does not advertise all capabilities, you can enable
support by setting the \f[C]$COLORTERM\f[R] variable to
\f[C]truecolor\f[R] or ensuring \f[C]$TERM\f[R] is set to a value that
ends with \f[C]-truecolor\f[R].
.PP
Default lf colors are mostly taken from GNU dircolors defaults.
These defaults use 8 basic colors and bold attribute.
Default dircolors entries with background colors are simplified to avoid
confusion with current file selection in lf.
Similarly, there are only file type matchings and extension matchings
are left out for simplicity.
Default values are as follows given with their matching order in lf:
.IP
.nf
\f[C]
ln  01;36
or  31;01
tw  01;34
ow  01;34
st  01;34
di  01;34
pi  33
so  01;35
bd  33;01
cd  33;01
su  01;32
sg  01;32
ex  01;32
fi  00
\f[R]
.fi
.PP
Note that lf first tries matching file names and then falls back to file
types.
The full order of matchings from most specific to least are as follows:
.IP "1." 3
Full Path (e.g.
\f[C]\[ti]/.config/lf/lfrc\f[R])
.IP "2." 3
Dir Name (e.g.
\f[C].git/\f[R]) (only matches dirs with a trailing slash at the end)
.IP "3." 3
File Type (e.g.
\f[C]ln\f[R]) (except \f[C]fi\f[R])
.IP "4." 3
File Name (e.g.
\f[C]README*\f[R])
.IP "5." 3
File Name (e.g.
\f[C]*README\f[R])
.IP "6." 3
Base Name (e.g.
\f[C]README.*\f[R])
.IP "7." 3
Extension (e.g.
\f[C]*.txt\f[R])
.IP "8." 3
Default (i.e.
\f[C]fi\f[R])
.PP
For example, given a regular text file \f[C]/path/to/README.txt\f[R],
the following entries are checked in the configuration and the first one
to match is used:
.IP "1." 3
\f[C]/path/to/README.txt\f[R]
.IP "2." 3
(skipped since the file is not a directory)
.IP "3." 3
(skipped since the file is of type \f[C]fi\f[R])
.IP "4." 3
\f[C]README.txt*\f[R]
.IP "5." 3
\f[C]*README.txt\f[R]
.IP "6." 3
\f[C]README.*\f[R]
.IP "7." 3
\f[C]*.txt\f[R]
.IP "8." 3
\f[C]fi\f[R]
.PP
Given a regular directory \f[C]/path/to/example.d\f[R], the following
entries are checked in the configuration and the first one to match is
used:
.IP "1." 3
\f[C]/path/to/example.d\f[R]
.IP "2." 3
\f[C]example.d/\f[R]
.IP "3." 3
\f[C]di\f[R]
.IP "4." 3
\f[C]example.d*\f[R]
.IP "5." 3
\f[C]*example.d\f[R]
.IP "6." 3
\f[C]example.*\f[R]
.IP "7." 3
\f[C]*.d\f[R]
.IP "8." 3
\f[C]fi\f[R]
.PP
Note that glob-like patterns do not perform glob matching for
performance reasons.
.PP
For example, you can set a variable as follows:
.IP
.nf
\f[C]
export LF_COLORS=\[dq]\[ti]/Documents=01;31:\[ti]/Downloads=01;31:\[ti]/.local/share=01;31:\[ti]/.config/lf/lfrc=31:.git/=01;32:.git*=32:*.gitignore=32:*Makefile=32:README.*=33:*.txt=34:*.md=34:ln=01;36:di=01;34:ex=01;32:\[dq]
\f[R]
.fi
.PP
Having all entries on a single line can make it hard to read.
You may instead divide it into multiple lines in between double quotes
by escaping newlines with backslashes as follows:
.IP
.nf
\f[C]
export LF_COLORS=\[dq]\[rs]
\[ti]/Documents=01;31:\[rs]
\[ti]/Downloads=01;31:\[rs]
\[ti]/.local/share=01;31:\[rs]
\[ti]/.config/lf/lfrc=31:\[rs]
\&.git/=01;32:\[rs]
\&.git*=32:\[rs]
*.gitignore=32:\[rs]
*Makefile=32:\[rs]
README.*=33:\[rs]
*.txt=34:\[rs]
*.md=34:\[rs]
ln=01;36:\[rs]
di=01;34:\[rs]
ex=01;32:\[rs]
\[dq]
\f[R]
.fi
.PP
The \f[C]ln\f[R] entry supports the special value \f[C]target\f[R],
which will use the link target to select a style.
File name rules will still apply based on the link\[aq]s name -- this
mirrors GNU\[aq]s \f[C]ls\f[R] and \f[C]dircolors\f[R] behavior.
Having such a long variable definition in a shell configuration file
might be undesirable.
You may instead use the colors file (refer to the CONFIGURATION
section (https://github.com/gokcehan/lf/blob/master/doc.md#configuration))
for configuration.
A sample colors file can be found at
<https://github.com/gokcehan/lf/blob/master/etc/colors.example> You may
also see the wiki page for ANSI escape codes
<https://en.wikipedia.org/wiki/ANSI_escape_code>
.SH ICONS
.PP
Icons are configured using \f[C]LF_ICONS\f[R] environment variable or an
icons file (refer to the CONFIGURATION
section (https://github.com/gokcehan/lf/blob/master/doc.md#configuration)).
The variable uses the same syntax as \f[C]LS_COLORS/LF_COLORS\f[R].
Instead of colors, you should put a single characters as values of
entries.
The \f[C]ln\f[R] entry supports the special value \f[C]target\f[R],
which will use the link target to select a icon.
File name rules will still apply based on the link\[aq]s name -- this
mirrors GNU\[aq]s \f[C]ls\f[R] and \f[C]dircolors\f[R] behavior.
The icons file (refer to the CONFIGURATION
section (https://github.com/gokcehan/lf/blob/master/doc.md#configuration))
should consist of whitespace-separated arrays with a \f[C]#\f[R]
character to start comments until the end of the line.
Each line should contain 1-3 columns, first column is filetype or
filename pattern, second column is the icon, third column is an optional
icon color.
If there is only one column, means to disable rule for this filetype or
pattern.
Do not forget to add \f[C]set icons true\f[R] to your \f[C]lfrc\f[R] to
see the icons.
Default values are as follows given with their matching order in lf:
.IP
.nf
\f[C]
ln  l
or  l
tw  t
ow  d
st  t
di  d
pi  p
so  s
bd  b
cd  c
su  u
sg  g
ex  x
fi  -
\f[R]
.fi
.PP
A sample icons file can be found at
<https://github.com/gokcehan/lf/blob/master/etc/icons.example>
.PP
A sample colored icons file can be found at
<https://github.com/gokcehan/lf/blob/master/etc/icons_colored.example>