Make duplicated file format configurable (#1315)

* Make duplicated file format configurable

* Add %b and %f options to dupfilefmt
This commit is contained in:
David Pedersen authored and GitHub committed 2023-07-04 12:29:24 +03:00
1 parent 835c5b35e2
commit f20d0e5fb4
8 files changed
+47 -4

No files matched your search

+9
View File
@@ -133,6 +133,7 @@ The following options can be used to customize the behavior of lf:
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)
@@ -761,6 +762,14 @@ custom previews for directories.
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 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.