feat: add sort_by "suffix" (#2307)

* feat: adds new type of sorting based on the filename's suffix

* chore(syntax): using string colon methods

* fix(regex): use alphanumeric match for extensions

* feat: adds new type of sorting based on the filename's suffix

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
Cyber Oliveira
2023-07-09 00:49:41 -03:00
committed by GitHub
parent 04b2c1e08c
commit a708bd2413
2 changed files with 54 additions and 2 deletions

View File

@@ -568,8 +568,10 @@ Reloads the explorer every time a buffer is written to.
*nvim-tree.sort_by*
Changes how files within the same directory are sorted.
Can be one of `name`, `case_sensitive`, `modification_time`, `extension`,
`filetype` or a function.
Can be one of `"name"`, `"case_sensitive"`, `"modification_time"`, `"extension"`,
`"suffix"`, `"filetype"` or a function.
`"extension"` uses all suffixes e.g. `foo.tar.gz` -> `.tar.gz`
`"suffix"` uses the last e.g. `.gz`
Type: `string` | `function(nodes)`, Default: `"name"`
Function may perform a sort or return a string with one of the above