@@ -1080,50 +1080,6 @@ highlight group is not, hard linking as follows: >
10801080 NvimTreeLspDiagnosticsHintFolderText NvimTreeDiagnosticHintFolderHL
10811081<
10821082
1083- ==============================================================================
1084- Hidden Display *nvim-tree-hidden-display*
1085-
1086- Show a summary of hidden files below the tree highlighted with `NvimTreeHiddenDisplay
1087-
1088- Configure via | nvim_tree.config.renderer | {hidden_display}
1089-
1090- *nvim_tree.config.renderer.hidden_display*
1091- • `none ` : disabled
1092- • `simple` : show how many hidden files are in a folder
1093- • `all ` : show how many hidden and the number of hidden files by reason
1094- • `fun(hidden_stats: table<string, integer>): string`: returns a summary of hidden stats
1095-
1096- Example `" all" ` :
1097- If a folder has 14 hidden items for various reasons, the display might show: >
1098- (14 total git: 5, dotfile: 9)
1099- <
1100- If a function is provided, it receives a table `hidden_stats` where keys are
1101- reasons and values are the count of hidden files for that reason.
1102-
1103- The `hidden_stats` argument is structured as follows, where <num> is the number
1104- of hidden files related to the field: >
1105- hidden_stats = {
1106- bookmark = <num>,
1107- buf = <num>,
1108- custom = <num>,
1109- dotfile = <num>,
1110- git = <num>,
1111- live_filter = <num>,
1112- }
1113- <
1114- Example of function that can be passed: >lua
1115- function(hidden_stats)
1116- local total_count = 0
1117- for reason, count in pairs(hidden_stats) do
1118- total_count = total_count + count
1119- end
1120-
1121- if total_count > 0 then
1122- return "(" .. tostring(total_count) .. " hidden)"
1123- end
1124- return nil
1125- end
1126- <
11271083
11281084==============================================================================
11291085Config *nvim-tree-config*
@@ -1376,6 +1332,19 @@ Config: renderer *nvim-tree-config-renderer*
13761332 end
13771333<
13781334
1335+ {hidden_display} *nvim_tree.config.renderer.hidden_display*
1336+
1337+ Summary of hidden nodes, below the last node in the directory, highlighted
1338+ with `NvimTreeHiddenDisplay` .
1339+ • `" none" ` : disabled, default
1340+ • `" simple" ` : total number of hidden files e.g.
1341+ • (3 hidden)
1342+ • `" all" ` : total and by reason: the filter that hid the node e.g.
1343+ • (14 total git: 5, dotfile: 9)
1344+ • `(fun(hidden_stats: nvim_tree.config.renderer.hidden_stats): string)`
1345+
1346+ See | nvim_tree.config.renderer.hidden_stats | for details and example.
1347+
13791348 Fields: ~
13801349 • {add_trailing}? (`boolean ` , default: `false` ) Appends a
13811350 trailing slash to folder and symlink folder
@@ -1393,7 +1362,7 @@ Config: renderer *nvim-tree-config-renderer*
13931362 • {indent_width}? (`integer` , default: `2 ` ) Number of spaces
13941363 for each tree nesting level. Minimum 1.
13951364 • {hidden_display}? (`nvim_tree.config.renderer.hidden_display` , default: `none ` )
1396- | nvim-tree-hidden-display |
1365+ | nvim_tree.config.renderer.hidden_display |
13971366 • {symlink_destination}? (`boolean ` , default: `true` ) Appends an
13981367 arrow followed by the target of the
13991368 symlink.
@@ -1422,6 +1391,35 @@ Config: renderer *nvim-tree-config-renderer*
14221391 • {icons} ? (`nvim_tree.config.renderer.icons` )
14231392 | nvim_tree.config.renderer.icons |
14241393
1394+ *nvim_tree.config.renderer.hidden_stats*
1395+ Number of hidden nodes in a directory by reason: the filter that hid the
1396+ node.
1397+
1398+ Passed to your | nvim_tree.config.renderer.hidden_display | function e.g. >lua
1399+
1400+ ---@param hidden_stats nvim_tree.config.renderer.hidden_stats
1401+ ---@return string? summary
1402+ local my_hidden_display = function(hidden_stats)
1403+ local total_count = 0
1404+ for reason, count in pairs(hidden_stats) do
1405+ total_count = total_count + count
1406+ end
1407+
1408+ if total_count > 0 then
1409+ return "(" .. tostring(total_count) .. " hidden)"
1410+ end
1411+ return nil
1412+ end
1413+ <
1414+
1415+ Fields: ~
1416+ • {bookmark} (`integer` )
1417+ • {buf} (`integer` )
1418+ • {custom} (`integer` )
1419+ • {dotfile} (`integer` )
1420+ • {git} (`integer` )
1421+ • {live_filter} (`integer` )
1422+
14251423*nvim_tree.config.renderer.icons*
14261424 Icons and separators
14271425
0 commit comments