Skip to content

Commit

Permalink
feat(#2948): improve doc
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-courtis committed Dec 1, 2024
1 parent 3b60fa7 commit fd49b1f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions doc/nvim-tree-lua.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ CONTENTS *nvim-tree*
9. Events |nvim-tree-events|
10. Prompts |nvim-tree-prompts|
11. Decorators |nvim-tree-decorators|
11.1 Decorator Example |nvim-tree-decorator-example|
12. OS Specific Restrictions |nvim-tree-os-specific|
13. Netrw |nvim-tree-netrw|
14. Legacy |nvim-tree-legacy|
Expand Down Expand Up @@ -426,7 +427,7 @@ Following is the default configuration. See |nvim-tree-opts| for details. >lua
special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
hidden_display = "none",
symlink_destination = true,
decorators = { "Git", "Opened", "Hidden", "Modified", "Bookmarks", "Diagnostics", "Copied", "Cut", },
decorators = { "Git", "Open", "Hidden", "Modified", "Bookmark", "Diagnostics", "Copied", "Cut", },
highlight_git = "none",
highlight_diagnostics = "none",
highlight_opened_files = "none",
Expand Down Expand Up @@ -933,10 +934,10 @@ Uses strings to specify builtin decorators otherwise specify your
Type: `nvim_tree.api.decorator.Name[]`, Default: >lua
{
"Git",
"Opened",
"Open",
"Hidden",
"Modified",
"Bookmarks",
"Bookmark",
"Diagnostics",
"Copied",
"Cut",
Expand Down Expand Up @@ -2777,26 +2778,25 @@ Decorators may:
- Set highlight group for the name or icons
- Override node icon

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

e.g. default decorators with an user decorator being overridden only by Cut: >lua
Specify decorators and their precedence via |nvim-tree.renderer.decorators|
e.g. defaults with a user decorator being overridden only by Cut: >lua
{
"Git",
"Opened",
"Open",
"Hidden",
"Modified",
"Bookmarks",
"Bookmark",
"Diagnostics",
"Copied",
MyDecorator,
"Cut",
}
<
See `api_decorator.lua` for decorator class definition and full documentation.

Example decorator: >lua

==============================================================================
11.1. DECORATOR EXAMPLE *nvim-tree-decorator-example*
>lua
---Create your decorator class
---@class (exact) MyDecorator: nvim_tree.api.decorator.UserDecorator
---@field private my_icon nvim_tree.api.HighlightedString
Expand Down

0 comments on commit fd49b1f

Please sign in to comment.