feat(#2364): add option to sort files first (#2366)

* feat(#2364): add option to show files first

* Refactor `folders_or_files_first` function

* Improve readability

* Remove `fallback` from `folders_or_files_first` function

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
Azad
2023-08-26 06:15:56 +02:00
committed by GitHub
parent 807dc05156
commit d11d701857
3 changed files with 42 additions and 32 deletions

View File

@@ -308,6 +308,7 @@ applying configuration.
sort = {
sorter = "name",
folders_first = true,
files_first = false,
},
root_dirs = {},
prefer_startup_root = false,
@@ -589,6 +590,11 @@ File and folder sorting options.
function.
Type: `boolean`, Default: `true`
*nvim-tree.sort.files_first*
Sort files before folders. Has no effect when |nvim-tree.sort.sorter| is a
function. If set to `true` it overrides |nvim-tree.sort.folders_first|.
Type: `boolean`, Default: `false`
*nvim-tree.hijack_unnamed_buffer_when_opening*
Opens in place of the unnamed buffer if it's empty.
Type: `boolean`, Default: `false`