-
Notifications
You must be signed in to change notification settings - Fork 330
/
doc.txt
2102 lines (1526 loc) · 71 KB
/
doc.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
NAME
lf - terminal file manager
SYNOPSIS
lf [-command command] [-config path] [-cpuprofile path] [-doc]
[-last-dir-path path] [-log path] [-memprofile path] [-print-last-dir]
[-print-selection] [-remote command] [-selection-path path] [-server]
[-single] [-version] [-help] [cd-or-select-path]
DESCRIPTION
lf is a terminal file manager.
The source code can be found in the repository at
https://github.com/gokcehan/lf
This documentation can either be read from the terminal using lf -doc or
online at https://github.com/gokcehan/lf/blob/master/doc.md You can also
use the doc command (default <f-1>) 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
You can run lf -help to see descriptions of command line options.
QUICK REFERENCE
The following commands are provided by lf:
quit (default 'q')
up (default 'k' and '<up>')
half-up (default '<c-u>')
page-up (default '<c-b>' and '<pgup>')
scroll-up (default '<c-y>')
down (default 'j' and '<down>')
half-down (default '<c-d>')
page-down (default '<c-f>' and '<pgdn>')
scroll-down (default '<c-e>')
updir (default 'h' and '<left>')
open (default 'l' and '<right>')
jump-next (default ']')
jump-prev (default '[')
top (default 'gg' and '<home>')
bottom (default 'G' and '<end>')
high (default 'H')
middle (default 'M')
low (default 'L')
toggle
invert (default 'v')
invert-below
unselect (default 'u')
glob-select
glob-unselect
calcdirsize
clearmaps
copy (default 'y')
cut (default 'd')
paste (default 'p')
clear (default 'c')
sync
draw
redraw (default '<c-l>')
load
reload (default '<c-r>')
echo
echomsg
echoerr
cd
select
delete (modal)
rename (modal) (default 'r')
source
push
read (modal) (default ':')
shell (modal) (default '$')
shell-pipe (modal) (default '%')
shell-wait (modal) (default '!')
shell-async (modal) (default '&')
find (modal) (default 'f')
find-back (modal) (default 'F')
find-next (default ';')
find-prev (default ',')
search (modal) (default '/')
search-back (modal) (default '?')
search-next (default 'n')
search-prev (default 'N')
filter (modal)
setfilter
mark-save (modal) (default 'm')
mark-load (modal) (default "'")
mark-remove (modal) (default '"')
tag
tag-toggle (default 't')
The following command line commands are provided by lf:
cmd-escape (default '<esc>')
cmd-complete (default '<tab>')
cmd-menu-complete
cmd-menu-complete-back
cmd-menu-accept
cmd-enter (default '<c-j>' and '<enter>')
cmd-interrupt (default '<c-c>')
cmd-history-next (default '<c-n>' and '<down>')
cmd-history-prev (default '<c-p>' and '<up>')
cmd-left (default '<c-b>' and '<left>')
cmd-right (default '<c-f>' and '<right>')
cmd-home (default '<c-a>' and '<home>')
cmd-end (default '<c-e>' and '<end>')
cmd-delete (default '<c-d>' and '<delete>')
cmd-delete-back (default '<backspace>' and '<backspace2>')
cmd-delete-home (default '<c-u>')
cmd-delete-end (default '<c-k>')
cmd-delete-unix-word (default '<c-w>')
cmd-yank (default '<c-y>')
cmd-transpose (default '<c-t>')
cmd-transpose-word (default '<a-t>')
cmd-word (default '<a-f>')
cmd-word-back (default '<a-b>')
cmd-delete-word (default '<a-d>')
cmd-delete-word-back (default '<a-backspace>' and '<a-backspace2>')
cmd-capitalize-word (default '<a-c>')
cmd-uppercase-word (default '<a-u>')
cmd-lowercase-word (default '<a-l>')
The following options can be used to customize the behavior of lf:
anchorfind bool (default true)
autoquit bool (default true)
borderfmt string (default "\033[0m")
cleaner string (default '')
copyfmt string (default "\033[7;33m")
cursoractivefmt string (default "\033[7m")
cursorparentfmt string (default "\033[7m")
cursorpreviewfmt string (default "\033[4m")
cutfmt string (default "\033[7;31m")
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 '%f.~%n~')
errorfmt string (default "\033[7;31;47m")
filesep string (default "\n")
findlen int (default 1)
globfilter bool (default false)
globsearch bool (default false)
hidden bool (default false)
hiddenfiles []string (default '.*' for Unix and '' for Windows)
history bool (default true)
icons bool (default false)
ifs string (default '')
ignorecase bool (default true)
ignoredia bool (default true)
incfilter bool (default false)
incsearch bool (default false)
info []string (default '')
infotimefmtnew string (default 'Jan _2 15:04')
infotimefmtold string (default 'Jan _2 2006')
locale string (default '')
mouse bool (default false)
number bool (default false)
numberfmt string (default "\033[33m")
period int (default 0)
preserve []string (default "mode")
preview bool (default true)
previewer string (default '')
promptfmt string (default "\033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m")
ratios []int (default '1:2:3')
relativenumber bool (default false)
reverse bool (default false)
roundbox bool (default false)
rulerfmt string (default " %a| %p| \033[7;31m %m \033[0m| \033[7;33m %c \033[0m| \033[7;35m %s \033[0m| \033[7;34m %f \033[0m| %i/%t")
scrolloff int (default 0)
selectfmt string (default "\033[7;35m")
selmode string (default 'all')
shell string (default 'sh' for Unix and 'cmd' for Windows)
shellflag string (default '-c' for Unix and '/c' for Windows)
shellopts []string (default '')
showbinds bool (default true)
sixel bool (default false)
smartcase bool (default true)
smartdia bool (default false)
sortby string (default 'natural')
statfmt string (default "\033[36m%p\033[0m| %c| %u| %g| %S| %t| -> %l")
tabstop int (default 8)
tagfmt string (default "\033[31m")
tempmarks string (default '')
timefmt string (default 'Mon Jan _2 15:04:05 2006')
truncatechar string (default '~')
truncatepct int (default 100)
waitmsg string (default 'Press any key to continue')
watch bool (default false)
wrapscan bool (default true)
wrapscroll bool (default false)
user_{option} string (default none)
The following environment variables are exported for shell commands:
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
The following special shell commands are used to customize the behavior
of lf when defined:
open
paste
rename
delete
pre-cd
on-cd
on-focus-gained
on-focus-lost
on-init
on-select
on-redraw
on-quit
The following commands/keybindings are provided by default:
Unix
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 "query $id maps" | $PAGER
cmd cmaps $lf -remote "query $id cmaps" | $PAGER
cmd cmds $lf -remote "query $id cmds" | $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 "query %id% maps" | %PAGER%
cmd cmaps !%lf% -remote "query %id% cmaps" | %PAGER%
cmd cmds !%lf% -remote "query %id% cmds" | %PAGER%
The following additional keybindings are provided by default:
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 ~
map <space> :toggle; down
If the mouse option is enabled, mouse buttons have the following default
effects:
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.
CONFIGURATION
Configuration files should be located at:
OS system-wide user-specific
Unix /etc/lf/lfrc ~/.config/lf/lfrc
Windows C:\ProgramData\lf\lfrc C:\Users\<user>\AppData\Local\lf\lfrc
The colors file should be located at:
OS system-wide user-specific
Unix /etc/lf/colors ~/.config/lf/colors
Windows C:\ProgramData\lf\colors C:\Users\<user>\AppData\Local\lf\colors
The icons file should be located at:
OS system-wide user-specific
Unix /etc/lf/icons ~/.config/lf/icons
Windows C:\ProgramData\lf\icons C:\Users\<user>\AppData\Local\lf\icons
The selection file should be located at:
Unix ~/.local/share/lf/files
Windows C:\Users\<user>\AppData\Local\lf\files
The marks file should be located at:
Unix ~/.local/share/lf/marks
Windows C:\Users\<user>\AppData\Local\lf\marks
The tags file should be located at:
Unix ~/.local/share/lf/tags
Windows C:\Users\<user>\AppData\Local\lf\tags
The history file should be located at:
Unix ~/.local/share/lf/history
Windows C:\Users\<user>\AppData\Local\lf\history
You can configure these locations with the following variables given
with their order of precedences and their default values:
Unix
$LF_CONFIG_HOME
$XDG_CONFIG_HOME
~/.config
$LF_DATA_HOME
$XDG_DATA_HOME
~/.local/share
Windows
%ProgramData%
C:\ProgramData
%LF_CONFIG_HOME%
%LOCALAPPDATA%
C:\Users\<user>\AppData\Local
A sample configuration file can be found at
https://github.com/gokcehan/lf/blob/master/etc/lfrc.example
COMMANDS
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.
quit (default q)
Quit lf and return to the shell.
up (default k and <up>), half-up (default <c-u>), page-up (default <c-b> and <pgup>), scroll-up (default <c-y>), down (default j and <down>), half-down (default <c-d>), page-down (default <c-f> and <pgdn>), scroll-down (default <c-e>)
Move/scroll the current file selection upwards/downwards by one/half a
page/full page.
updir (default h and <left>)
Change the current working directory to the parent directory.
open (default l and <right>)
If the current file is a directory, then change the current directory to
it, otherwise, execute the open command. A default open command is
provided to call the default system opener asynchronously with the
current file as the argument. A custom open command can be defined to
override this default.
jump-next (default ]), jump-prev (default [)
Change the current working directory to the next/previous jumplist item.
top (default gg and <home>), bottom (default G and <end>)
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 3G
to move to the third line.
high (default H), middle (default M), low (default L)
Move the current file selection to the high/middle/low of the screen.
toggle
Toggle the selection of the current file or files given as arguments.
invert (default v)
Reverse the selection of all files in the current directory (i.e. toggle
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 invert with unselect (i.e.
cmd select-all :unselect; invert), though this will also remove
selections in other directories.
invert-below
Reverse the selection (i.e. toggle) of all files at or after the current
file in the current directory.
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 not
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.
This command is experimental and may be removed once a better
replacement for the visual mode is implemented in lf. If you'd like to
experiment with using this command, you should bind it to a key (e.g. V)
for a better experience.
unselect (default u)
Remove the selection of all files in all directories.
glob-select, glob-unselect
Select/unselect files that match the given glob.
calcdirsize
Calculate the total size for each of the selected directories. Option
info should include size and option dircounts should be disabled to show
this size. If the total size of a directory is not calculated, it will
be shown as -.
clearmaps
Remove all keybindings associated with the map command. This command can
be used in the config file to remove the default keybindings. For safety
purposes, : is left mapped to the read command, and cmap keybindings are
retained so that it is still possible to exit lf using :quit.
copy (default y)
If there are no selections, save the path of the current file to the
copy buffer, otherwise, copy the paths of selected files.
cut (default d)
If there are no selections, save the path of the current file to the cut
buffer, otherwise, copy the paths of selected files.
paste (default p)
Copy/Move files in the copy/cut buffer to the current working directory.
A custom paste command can be defined to override this default.
clear (default c)
Clear file paths in copy/cut buffer.
sync
Synchronize copied/cut files with the server. This command is
automatically called when required.
draw
Draw the screen. This command is automatically called when required.
redraw (default <c-l>)
Synchronize the terminal and redraw the screen.
load
Load modified files and directories. This command is automatically
called when required.
reload (default <c-r>)
Flush the cache and reload all files and directories.
echo
Print the given arguments to the message line at the bottom.
echomsg
Print the given arguments to the message line at the bottom and also to
the log file.
echoerr
Print given arguments to the message line at the bottom as errorfmt and
also to the log file.
cd
Change the working directory to the given argument.
select
Change the current file selection to the given argument.
delete (modal)
Remove the current file or selected file(s). A custom delete command can
be defined to override this default.
rename (modal) (default r)
Rename the current file using the built-in method. A custom rename
command can be defined to override this default.
source
Read the configuration file given in the argument.
push
Simulate key pushes given in the argument.
read (modal) (default :)
Read a command to evaluate.
shell (modal) (default $)
Read a shell command to execute.
shell-pipe (modal) (default %)
Read a shell command to execute piping its standard I/O to the bottom
statline.
shell-wait (modal) (default !)
Read a shell command to execute and wait for a key press in the end.
shell-async (modal) (default &)
Read a shell command to execute asynchronously without standard I/O.
find (modal) (default f), find-back (modal) (default F), find-next (default ;), find-prev (default ,)
Read key(s) to find the appropriate file name match in the
forward/backward direction and jump to the next/previous match.
search (default /), search-back (default ?), search-next (default n), search-prev (default N)
Read a pattern to search for a file name match in the forward/backward
direction and jump to the next/previous match.
filter (modal), setfilter
Command filter reads a pattern to filter out and only view files
matching the pattern. Command setfilter does the same but uses an
argument to set the filter immediately. You can supply an argument to
filter to use as the starting prompt.
mark-save (modal) (default m)
Save the current directory as a bookmark assigned to the given key.
mark-load (modal) (default ')
Change the current directory to the bookmark assigned to the given key.
A special bookmark ' holds the previous directory after a mark-load, cd,
or select command.
mark-remove (modal) (default ")
Remove a bookmark assigned to the given key.
tag
Tag a file with * or a single-width character given in the argument. You
can define a new tag-clearing command by combining tag with tag-toggle
(i.e. cmd tag-clear :tag; tag-toggle).
tag-toggle (default t)
Tag a file with * or a single width character given in the argument if
the file is untagged, otherwise remove the tag.
COMMAND LINE COMMANDS
The prompt character specifies which of the several command-line modes
you are in. For example, the read command takes you to the : mode.
When the cursor is at the first character in : mode, pressing one of the
keys !, $, %, or & takes you to the corresponding mode. You can go back
with cmd-delete-back (<backspace> by default).
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.
cmd-escape (default <esc>)
Quit command line mode and return to normal mode.
cmd-complete (default <tab>)
Autocomplete the current word.
cmd-menu-complete, cmd-menu-complete-back
Autocomplete the current word with the menu selection. You need to
assign keys to these commands (e.g.
cmap <tab> cmd-menu-complete; cmap <backtab> cmd-menu-complete-back).
You can use the assigned keys to display the menu and then cycle through
completion options.
cmd-menu-accept
Accept the currently selected match in menu completion and close the
menu.
cmd-enter (default <c-j> and <enter>)
Execute the current line.
cmd-interrupt (default <c-c>)
Interrupt the current shell-pipe command and return to the normal mode.
cmd-history-next (default <c-n> and <down>), cmd-history-prev (default <c-p> and <up>)
Go to the next/previous item in the history.
cmd-left (default <c-b> and <left>), cmd-right (default <c-f> and <right>)
Move the cursor to the left/right.
cmd-home (default <c-a> and <home>), cmd-end (default <c-e> and <end>)
Move the cursor to the beginning/end of the line.
cmd-delete (default <c-d> and <delete>)
Delete the next character.
cmd-delete-back (default <backspace> and <backspace2>)
Delete the previous character. When at the beginning of a prompt,
returns either to normal mode or to : mode.
cmd-delete-home (default <c-u>), cmd-delete-end (default <c-k>)
Delete everything up to the beginning/end of the line.
cmd-delete-unix-word (default <c-w>)
Delete the previous unix word.
cmd-yank (default <c-y>)
Paste the buffer content containing the last deleted item.
cmd-transpose (default <c-t>), cmd-transpose-word (default <a-t>)
Transpose the positions of the last two characters/words.
cmd-word (default <a-f>), cmd-word-back (default <a-b>)
Move the cursor by one word in the forward/backward direction.
cmd-delete-word (default <a-d>)
Delete the next word in the forward direction.
cmd-delete-word-back (default <a-backspace> and <a-backspace2>)
Delete the previous word in the backward direction.
cmd-capitalize-word (default <a-c>), cmd-uppercase-word (default <a-u>), cmd-lowercase-word (default <a-l>)
Capitalize/uppercase/lowercase the current word and jump to the next
word.
OPTIONS
This section shows information about options to customize the behavior.
Character : is used as the separator for list options []int and
[]string.
anchorfind (bool) (default true)
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.
autoquit (bool) (default true)
Automatically quit the server when there are no clients left connected.
borderfmt (string) (default \033[0m)
Format string of the box drawing characters enabled by the drawbox
option.
cleaner (string) (default ``) (not called if empty)
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.
copyfmt (string) (default \033[7;33m)
Format string of the indicator for files to be copied.
cursoractivefmt (string) (default \033[7m), cursorparentfmt string (default \033[7m), cursorpreviewfmt string (default \033[4m)
Format strings for highlighting the cursor. cursoractivefmt applies in
the current directory pane, cursorparentfmt applies in panes that show
parents of the current directory, and cursorpreviewfmt applies in panes
that preview directories.
The default is to make the active cursor and the parent directory cursor
inverted. The preview cursor is underlined.
Some other possibilities to consider for the preview or parent cursors:
an empty string for no cursor, \033[7;2m for dimmed inverted text
(visibility varies by terminal), \033[7;90m for inverted text with grey
(aka "brightblack") background.
If the format string contains the characters %s, it is interpreted as a
format string for fmt.Sprintf. Such a string should end with the
terminal reset sequence. For example, \033[4m%s\033[0m has the same
effect as \033[4m.
cutfmt (string) (default \033[7;31m)
Format string of the indicator for files to be cut.
dircache (bool) (default true)
Cache directory contents.
dircounts (bool) (default false)
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 calcdirsize. 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 info has a size 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 999+.
dirfirst (bool) (default true)
Show directories first above regular files.
dironly (bool) (default false)
Show only directories.
dirpreviews (bool) (default false)
If enabled, directories will also be passed to the previewer script.
This allows custom previews for directories.
drawbox (bool) (default false)
Draw boxes around panes with box drawing characters.
dupfilefmt (string) (default %f.~%n~)
Format string of file name when creating duplicate files. With the
default format, copying a file abc.txt to the same directory will result
in a duplicate file called abc.txt.~1~. Special expansions are provided,
%f as the file name, %b for the basename (file name without extension),
%e as the extension (including the dot) and %n as the number of
duplicates.
errorfmt (string) (default \033[7;31;47m)
Format string of error messages shown in the bottom message line.
If the format string contains the characters %s, it is interpreted as a
format string for fmt.Sprintf. Such a string should end with the
terminal reset sequence. For example, \033[4m%s\033[0m has the same
effect as \033[4m.
filesep (string) (default \n)
File separator used in environment variables fs and fx.
findlen (int) (default 1)
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.
globfilter (bool) (default false)
Patterns are treated as globs for the filter command, see globsearch for
more details.
globsearch (bool) (default false)
When this option is enabled, search command patterns are considered as
globs, otherwise, they are literals. With globbing, * matches any
sequence, ? matches any character, and [...] or [^...] matches character
sets or ranges. Otherwise, these characters are interpreted as they are.
hidden (bool) (default false)
Show hidden files. On Unix systems, hidden files are determined by the
value of hiddenfiles. On Windows, files with hidden attributes are also
considered hidden files.
hiddenfiles ([]string) (default .* for Unix and `` for Windows)
List of hidden file glob patterns. Patterns can be given as relative or
absolute paths. Globbing supports the usual special characters, * to
match any sequence, ? to match any character, and [...] or [^...] to
match character sets or ranges. In addition, if a pattern starts with !,
then its matches are excluded from hidden files. To add multiple
patterns, use : as a separator. Example: .*:lost+found:*.bak
history (bool) (default true)
Save command history.
icons (bool) (default false)
Show icons before each item in the list.
ifs (string) (default ``)
Sets IFS variable in shell commands. It works by adding the assignment
to the beginning of the command string as IFS=...; .... The reason is
that IFS 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.
ignorecase (bool) (default true)
Ignore case in sorting and search patterns.
ignoredia (bool) (default true)
Ignore diacritics in sorting and search patterns.
incsearch (bool) (default false)
Jump to the first match after each keystroke during searching.
incfilter (bool) (default false)
Apply filter pattern after each keystroke during filtering.
info ([]string) (default ``)
A list of information that is shown for directory items at the right
side of the pane. Currently supported information types are size, time,
atime, ctime, perm, user and group. Information is only shown when the
pane width is more than twice the width of information.
infotimefmtnew (string) (default Jan _2 15:04)
Format string of the file time shown in the info column when it matches
this year.
infotimefmtold (string) (default Jan _2 2006)
Format string of the file time shown in the info column when it doesn't
match this year.
locale (string) (default ``)
An IETF BCP 47 language tag (e.g. zh-CN) for specifying the locale used
when using sort type natural and name.
An empty string means disable locale ordering, and the special value *
is used to indicate reading the locale setting from the system
environment.
mouse (bool) (default false)
Send mouse events as input.
number (bool) (default false)
Show the position number for directory items on the left side of the
pane. When the relativenumber option is enabled, only the current line
shows the absolute position and relative positions are shown for the
rest.
numberfmt (string) (default \033[33m)
Format string of the position number for each line.
period (int) (default 0)
Set the interval in seconds for periodic checks of directory updates.
This works by periodically calling the load 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.
preserve ([]string) (default mode)
List of attributes that are preserved when copying files. Currently
supported attributes are mode (i.a. access mode) and timestamps (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.
preview (bool) (default true)
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 binary.
previewer (string) (default ``) (not filtered if empty)
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.
promptfmt (string) (default \033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m)
Format string of the prompt shown in the top line. Special expansions
are provided, %u as the user name, %h as the hostname, %w as the working
directory, %d as the working directory with a trailing path separator,
%f as the file name, and %F as the current filter. %S 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 ~ 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.
ratios ([]int) (default 1:2:3)
List of ratios of pane widths. Number of items in the list determines
the number of panes in the UI. When the preview option is enabled, the
rightmost number is used for the width of the preview pane.
relativenumber (bool) (default false)
Show the position number relative to the current line. When number is
enabled, the current line shows the absolute position, otherwise nothing
is shown.
reverse (bool) (default false)
Reverse the direction of sort.
roundbox (bool) (default false)
Draw rounded outer corners when the drawbox option is enabled.
rulerfmt (string) (default %a| %p| \033[7;31m %m \033[0m| \033[7;33m %c \033[0m| \033[7;35m %s \033[0m| \033[7;34m %f \033[0m| %i/%t)
Format string of the ruler shown in the bottom right corner. Special
expansions are provided, %a as the pressed keys, %p as the progress of
file operations, %m as the number of files to be cut (moved), %c as the
number of files to be copied, %s as the number of selected files, %f as
the filter, %i as the position of the cursor, %t as the number of files
shown in the current directory, %h as the number of files hidden in the
current directory, and %d as the amount of free disk space remaining.
Additional expansions are provided for environment variables exported by
lf, in the form %{lf_<name>} (e.g. %{lf_selmode}). This is useful for
displaying the current settings. Expansions are also provided for
user-defined options, in the form %{lf_user_<name>} (e.g.
%{lf_user_foo}). The | character splits the format string into sections.
Any section containing a failed expansion (result is a blank string) is
discarded and not shown.
selectfmt (string) (default \033[7;35m)
Format string of the indicator for files that are selected.
selmode (string) (default all)
Selection mode for commands. When set to all it will use the selected
files from all directories. When set to dir it will only use the