Skip to content

Commit fd49b1f

Browse files
committed
feat(#2948): improve doc
1 parent 3b60fa7 commit fd49b1f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

doc/nvim-tree-lua.txt

+12-12
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ CONTENTS *nvim-tree*
5353
9. Events |nvim-tree-events|
5454
10. Prompts |nvim-tree-prompts|
5555
11. Decorators |nvim-tree-decorators|
56+
11.1 Decorator Example |nvim-tree-decorator-example|
5657
12. OS Specific Restrictions |nvim-tree-os-specific|
5758
13. Netrw |nvim-tree-netrw|
5859
14. Legacy |nvim-tree-legacy|
@@ -426,7 +427,7 @@ Following is the default configuration. See |nvim-tree-opts| for details. >lua
426427
special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
427428
hidden_display = "none",
428429
symlink_destination = true,
429-
decorators = { "Git", "Opened", "Hidden", "Modified", "Bookmarks", "Diagnostics", "Copied", "Cut", },
430+
decorators = { "Git", "Open", "Hidden", "Modified", "Bookmark", "Diagnostics", "Copied", "Cut", },
430431
highlight_git = "none",
431432
highlight_diagnostics = "none",
432433
highlight_opened_files = "none",
@@ -933,10 +934,10 @@ Uses strings to specify builtin decorators otherwise specify your
933934
Type: `nvim_tree.api.decorator.Name[]`, Default: >lua
934935
{
935936
"Git",
936-
"Opened",
937+
"Open",
937938
"Hidden",
938939
"Modified",
939-
"Bookmarks",
940+
"Bookmark",
940941
"Diagnostics",
941942
"Copied",
942943
"Cut",
@@ -2777,26 +2778,25 @@ Decorators may:
27772778
- Set highlight group for the name or icons
27782779
- Override node icon
27792780

2780-
Create your decorator class via `api.decorator.UserDecorator:extend()` and add it
2781-
to |nvim-tree.renderer.decorators|
2781+
See `api_decorator.lua` for decorator class definition and full documentation.
27822782

2783-
e.g. default decorators with an user decorator being overridden only by Cut: >lua
2783+
Specify decorators and their precedence via |nvim-tree.renderer.decorators|
2784+
e.g. defaults with a user decorator being overridden only by Cut: >lua
27842785
{
27852786
"Git",
2786-
"Opened",
2787+
"Open",
27872788
"Hidden",
27882789
"Modified",
2789-
"Bookmarks",
2790+
"Bookmark",
27902791
"Diagnostics",
27912792
"Copied",
27922793
MyDecorator,
27932794
"Cut",
27942795
}
27952796
<
2796-
See `api_decorator.lua` for decorator class definition and full documentation.
2797-
2798-
Example decorator: >lua
2799-
2797+
==============================================================================
2798+
11.1. DECORATOR EXAMPLE *nvim-tree-decorator-example*
2799+
>lua
28002800
---Create your decorator class
28012801
---@class (exact) MyDecorator: nvim_tree.api.decorator.UserDecorator
28022802
---@field private my_icon nvim_tree.api.HighlightedString

0 commit comments

Comments
 (0)