feat: mapping and options to sort entries in help window (#2482)

* feat: add option to sort entries in help window

* stylua

* Add keymap to toggle sorting methods

* Bug fix

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
Azad
2023-10-22 23:57:49 +02:00
committed by GitHub
parent c2194e940c
commit 78a9ca5ed6
3 changed files with 68 additions and 22 deletions

View File

@@ -29,9 +29,10 @@ CONTENTS *nvim-tree*
5.14 Opts: Trash |nvim-tree-opts-trash|
5.15 Opts: Tab |nvim-tree-opts-tab|
5.16 Opts: Notify |nvim-tree-opts-notify|
5.17 Opts: UI |nvim-tree-opts-ui|
5.18 Opts: Experimental |nvim-tree-opts-experimental|
5.19 Opts: Log |nvim-tree-opts-log|
5.17 Opts: Help |nvim-tree-opts-help|
5.18 Opts: UI |nvim-tree-opts-ui|
5.19 Opts: Experimental |nvim-tree-opts-experimental|
5.20 Opts: Log |nvim-tree-opts-log|
6. API |nvim-tree-api|
6.1 API Tree |nvim-tree-api.tree|
6.2 API File System |nvim-tree-api.fs|
@@ -565,6 +566,9 @@ Following is the default configuration. See |nvim-tree-opts| for details.
threshold = vim.log.levels.INFO,
absolute_path = true,
},
help = {
sort_by = "key",
},
ui = {
confirm = {
remove = true,
@@ -1433,7 +1437,16 @@ Whether to use absolute paths or item names in fs action notifications.
Type: `boolean`, Default: `true`
==============================================================================
5.17 OPTS: UI *nvim-tree-opts-ui*
5.17 OPTS: HELP *nvim-tree-opts-help*
*nvim-tree.help.sort_by*
Defines how mappings are sorted in the help window.
Can be `"key"` (sort alphabetically by keymap)
or `"desc"` (sort alphabetically by description).
Type: `string`, Default: `"key"`
==============================================================================
5.18 OPTS: UI *nvim-tree-opts-ui*
*nvim-tree.ui.confirm*
Confirmation prompts.
@@ -1447,14 +1460,14 @@ Confirmation prompts.
Type: `boolean`, Default: `true`
==============================================================================
5.18 OPTS: EXPERIMENTAL *nvim-tree-opts-experimental*
5.19 OPTS: EXPERIMENTAL *nvim-tree-opts-experimental*
*nvim-tree.experimental*
Experimental features that may become default or optional functionality.
In the event of a problem please disable the experiment and raise an issue.
==============================================================================
5.19 OPTS: LOG *nvim-tree-opts-log*
5.20 OPTS: LOG *nvim-tree-opts-log*
Configuration for diagnostic logging.