feat!: Add sortignorecase/sortignoredia options to decouple sorting from searching

* add sortignorecase option for sorting

* format code

* remove unnecessary position updates

* decouple sorting and searching sensitivity options

* Decouple sorting and searching case/diacritics sensitivity
This commit is contained in:
ivan authored and GitHub committed 2026-04-27 13:10:52 +10:00
1 parent e22aea7f33
commit 8018ebbda5
5 files changed
+119 -55

No files matched your search

+14 -4
View File
@@ -316,6 +316,8 @@ The following options can be used to customize the behavior of lf:
smartcase bool (default true)
smartdia bool (default false)
sortby string (default 'natural')
sortignorecase bool (default true)
sortignoredia bool (default true)
statfmt string (default "\033[36m%p\033[0m| %c| %u| %g| %S| %t| -> %l")
tabstop int (default 8)
tagfmt string (default "\033[31m")
@@ -981,11 +983,11 @@ This option does not have any effect on Windows.
## ignorecase (bool) (default true)
Ignore case in sorting and search patterns.
Ignore case in search patterns. See also `sortignorecase`.
## ignoredia (bool) (default true)
Ignore diacritics in sorting and search patterns.
Ignore diacritics in search patterns. See also `sortignoredia`.
## incfilter (bool) (default false)
@@ -1197,7 +1199,7 @@ Determines whether file sizes are displayed using binary units (`1K` is 1024 byt
## smartcase (bool) (default true)
Override `ignorecase` option when the pattern contains an uppercase character.
Override `ignorecase` option for searching when the pattern contains an uppercase character.
This option has no effect when `ignorecase` is disabled.
## smartdia (bool) (default false)
@@ -1221,6 +1223,14 @@ The following sort types are supported:
ctime time of last status (inode) change
custom property defined via `addcustominfo` (empty by default)
## sortignorecase (bool) (default true)
Ignore case when sorting. See also `ignorecase`.
## sortignoredia (bool) (default true)
Ignore diacritics when sorting. See also `ignoredia`.
## statfmt (string) (default `\033[36m%p\033[0m| %c| %u| %g| %S| %t| -> %l`)
Format string of the file info shown in the bottom left corner.
@@ -1494,7 +1504,7 @@ Command `set` is used to set an option which can be a boolean, integer, or strin
set sortby "time" # string value with double quotes (backslash escapes)
Command `setlocal` is used to set a local option for a directory which can be a boolean or string.
Currently supported local options are `dircounts`, `dirfirst`, `dironly`, `hidden`, `info`, `reverse` and `sortby`.
Currently supported local options are `dircounts`, `dirfirst`, `dironly`, `hidden`, `info`, `reverse`, `sortby`, `sortignorecase` and `sortignoredia`.
setlocal /foo/bar hidden # boolean enable
setlocal /foo/bar hidden true # boolean enable