Skip to content

Commit 0bcd9b5

Browse files
committed
doc(#2934): tidy and format nvim_tree.Config.LiveFilter, Modified, Tab, Trash
1 parent 2b5ab07 commit 0bcd9b5

2 files changed

Lines changed: 95 additions & 45 deletions

File tree

doc/nvim-tree-lua.txt

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3785,12 +3785,16 @@ Lua module: nvim_tree *nvim-tree-module*
37853785
was previously closed.
37863786

37873787
*nvim_tree.Config.LiveFilter*
3788+
Configurations for the live_filtering feature. The live filter allows you
3789+
to filter the tree nodes dynamically, based on regex matching (see
3790+
|vim.regex|). This feature is bound to the `f` key by default. The filter
3791+
can be cleared with the `F` key by default.
37883792

37893793
Fields: ~
3790-
{prefix}? (`string`) Prefix of the filter displayed in
3791-
the buffer. Default: `"[FILTER]: "`
3792-
• {always_show_folders}? (`boolean`) Whether to filter folders or not.
3793-
Default: `true`
3794+
{prefix}? (`string`, default: `[FILTER]: `) Prefix of
3795+
the filter displayed in the buffer.
3796+
• {always_show_folders}? (`boolean`, default: `true`) Whether to filter
3797+
folders or not.
37943798

37953799
*nvim_tree.Config.Log*
37963800

@@ -3822,17 +3826,19 @@ Lua module: nvim_tree *nvim-tree-module*
38223826
verbose. Default: `false`
38233827

38243828
*nvim_tree.Config.Modified*
3829+
Indicate which file have unsaved modification. To see modified status in
3830+
the tree you will need to set:
3831+
|nvim_tree.Config.Renderer.Icons.Show| `modified` to `true` OR
3832+
|nvim_tree.Config.Renderer| `highlight_modified` to `true`
38253833

38263834
Fields: ~
3827-
{enable}? (`boolean`) Enable / disable the feature.
3828-
Default: `false`
3829-
• {show_on_dirs}? (`boolean`) Show modified indication on
3830-
directory whose children are modified. Default:
3831-
`true`
3832-
• {show_on_open_dirs}? (`boolean`) Show modified indication on open
3833-
directories. Only relevant when
3834-
|modified.show_on_dirs| is `true`. Default:
3835-
`false` @see nvim-tree.modified.show_on_dirs
3835+
{enable}? (`boolean`, default: `false`) Enable modified.
3836+
• {show_on_dirs}? (`boolean`, default: `true`) Show modified
3837+
indication on directory whose children are
3838+
modified.
3839+
• {show_on_open_dirs}? (`boolean`, default: `false`) Show modified
3840+
indication on open directories. Only relevant
3841+
when `show_on_dirs` is `true`.
38363842

38373843
*nvim_tree.Config.Notify*
38383844

@@ -4145,30 +4151,28 @@ Lua module: nvim_tree *nvim-tree-module*
41454151
*nvim_tree.Config.Tab*
41464152

41474153
Fields: ~
4148-
{sync}? (`nvim_tree.Config.Tab.Sync`) Configuration for syncing
4149-
nvim-tree across tabs.
4154+
{sync}? (`nvim_tree.Config.Tab.Sync`) |nvim_tree.Config.Tab.Sync|
41504155

41514156
*nvim_tree.Config.Tab.Sync*
4157+
Configuration for syncing nvim-tree across tabs.
41524158

41534159
Fields: ~
4154-
{open}? (`boolean`) Opens the tree automatically when switching
4155-
tabpage or opening a new tabpage if the tree was previously
4156-
open. Default: `false`
4157-
{close}? (`boolean`) Closes the tree across all tabpages when the
4158-
tree is closed. Default: `false`
4159-
{ignore}? (`string[]`) List of filetypes or buffer names on new tab
4160-
that will prevent |nvim-tree.tab.sync.open| and
4161-
|nvim-tree.tab.sync.close| Default: `{}`
4160+
{open}? (`boolean`, default: `false`) Opens the tree automatically
4161+
when switching tabpage or opening a new tabpage if the tree
4162+
was previously open.
4163+
{close}? (`boolean`, default: `false`) Closes the tree across all
4164+
tabpages when the tree is closed.
4165+
{ignore}? (`string[]`, default: `{}`) List of filetypes or buffer
4166+
names on new tab that will prevent `open` and `close`
41624167

41634168
*nvim_tree.Config.Trash*
41644169

41654170
Fields: ~
4166-
{cmd}? (`string`) The command used to trash items (must be installed
4167-
on your system). Default linux `"gio trash"` from glib2 is a
4168-
commonly shipped linux package. macOS default `"trash"`
4169-
requires the homebrew package `trash` Windows default
4170-
`"trash"` requires `trash-cli` or similar Default:
4171-
`"gio trash"` or `"trash"`
4171+
{cmd}? (`string`, default: `gio trash` or `trash`) The command used
4172+
to trash items, which must be installed on your system.
4173+
• linux: `gio trash`, from linux package `glib2`
4174+
• macOS: `trash`, from homebrew package `trash`
4175+
• windows: `trash`, requires `trash-cli` or similar
41724176

41734177
*nvim_tree.Config.UI*
41744178

lua/nvim-tree/_meta/config.lua

Lines changed: 62 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ error("Cannot require a meta file")
2626
---
2727
---Keeps the cursor on the first letter of the filename when moving in the tree.
2828
---(default: `false`)
29-
---@field hijack_cursor? boolean
29+
---@field hijack_cursor? boolean
3030
---
3131
---Reloads the explorer every time a buffer is written to.
3232
---(default: `true`)
3333
---@field auto_reload_on_write? boolean
3434
---
3535
---Completely disable |netrw|, see |nvim-tree-netrw| for details. It is strongly advised to eagerly disable netrw, due to race conditions at vim startup.
3636
---(default: `false`)
37-
---@field disable_netrw? boolean
37+
---@field disable_netrw? boolean
3838
---
3939
---Hijack netrw windows, ignored when `disable_netrw` is `true`
4040
---(default: `true`)
41-
---@field hijack_netrw? boolean
41+
---@field hijack_netrw? boolean
4242
---
4343
---Opens in place of the unnamed buffer if it's empty.
4444
---(default: `false`)
@@ -51,7 +51,7 @@ error("Cannot require a meta file")
5151
---
5252
---Prefer startup root directory when updating root directory of the tree. Only relevant when |nvim_tree.Config.UpdateFocusedFile| `update_root` is `true`
5353
---(default: `false`)
54-
---@field prefer_startup_root? boolean
54+
---@field prefer_startup_root? boolean
5555
---
5656
---Changes the tree root directory on |DirChanged| and refreshes the tree.
5757
---(default: `false`)
@@ -63,11 +63,11 @@ error("Cannot require a meta file")
6363
---
6464
---Change cwd of nvim-tree to that of new buffer's when opening nvim-tree.
6565
---(default: `false`)
66-
---@field respect_buf_cwd? boolean
66+
---@field respect_buf_cwd? boolean
6767
---
6868
---Use |vim.ui.select| style prompts. Necessary when using a UI prompt decorator such as dressing.nvim or telescope-ui-select.nvim
6969
---(default: `false`)
70-
---@field select_prompts? boolean
70+
---@field select_prompts? boolean
7171
---
7272
---|nvim_tree.Config.Sort|
7373
---@field sort? nvim_tree.Config.Sort
@@ -246,37 +246,83 @@ error("Cannot require a meta file")
246246
-- Modified
247247
--
248248

249+
---Indicate which file have unsaved modification.
250+
---To see modified status in the tree you will need to set:
251+
--- - |nvim_tree.Config.Renderer.Icons.Show| `modified` to `true` OR
252+
--- - |nvim_tree.Config.Renderer| `highlight_modified` to `true`
249253
---@class nvim_tree.Config.Modified
250-
---@field enable? boolean Enable / disable the feature. Default: `false`
251-
---@field show_on_dirs? boolean Show modified indication on directory whose children are modified. Default: `true`
252-
---@field show_on_open_dirs? boolean Show modified indication on open directories. Only relevant when |modified.show_on_dirs| is `true`. Default: `false` @see nvim-tree.modified.show_on_dirs
254+
---
255+
---Enable modified.
256+
---(default: `false`)
257+
---@field enable? boolean
258+
---
259+
---Show modified indication on directory whose children are modified.
260+
---(default: `true`)
261+
---@field show_on_dirs? boolean
262+
---
263+
---Show modified indication on open directories. Only relevant when `show_on_dirs` is `true`.
264+
---(default: `false`)
265+
---@field show_on_open_dirs? boolean
253266

254267
--
255268
-- Tab
256269
--
257270

271+
258272
---@class nvim_tree.Config.Tab
259-
---@field sync? nvim_tree.Config.Tab.Sync Configuration for syncing nvim-tree across tabs.
273+
---
274+
---|nvim_tree.Config.Tab.Sync|
275+
---@field sync? nvim_tree.Config.Tab.Sync
276+
277+
--
278+
-- Tab.Sync
279+
--
260280

281+
---Configuration for syncing nvim-tree across tabs.
261282
---@class nvim_tree.Config.Tab.Sync
262-
---@field open? boolean Opens the tree automatically when switching tabpage or opening a new tabpage if the tree was previously open. Default: `false`
263-
---@field close? boolean Closes the tree across all tabpages when the tree is closed. Default: `false`
264-
---@field ignore? string[] List of filetypes or buffer names on new tab that will prevent |nvim-tree.tab.sync.open| and |nvim-tree.tab.sync.close| Default: `{}`
283+
---
284+
---Opens the tree automatically when switching tabpage or opening a new tabpage if the tree was previously open.
285+
---(default: `false`)
286+
---@field open? boolean
287+
---
288+
---Closes the tree across all tabpages when the tree is closed.
289+
---(default: `false`)
290+
---@field close? boolean
291+
---
292+
---
293+
---List of filetypes or buffer names on new tab that will prevent `open` and `close`
294+
---(default: `{}`)
295+
---@field ignore? string[]
265296

266297
--
267298
-- Trash
268299
--
269300

270301
---@class nvim_tree.Config.Trash
271-
---@field cmd? string The command used to trash items (must be installed on your system). Default linux `"gio trash"` from glib2 is a commonly shipped linux package. macOS default `"trash"` requires the homebrew package `trash` Windows default `"trash"` requires `trash-cli` or similar Default: `"gio trash"` or `"trash"`
302+
---
303+
---The command used to trash items, which must be installed on your system.
304+
--- - linux: `gio trash`, from linux package `glib2`
305+
--- - macOS: `trash`, from homebrew package `trash`
306+
--- - windows: `trash`, requires `trash-cli` or similar
307+
---(default: `gio trash` or `trash`)
308+
---@field cmd? string
272309

273310
--
274311
-- Live Filter
275312
--
276313

314+
--- Configurations for the live_filtering feature. The live filter allows you to filter the tree nodes dynamically, based on regex matching (see |vim.regex|).
315+
---
316+
--- This feature is bound to the `f` key by default. The filter can be cleared with the `F` key by default.
277317
---@class nvim_tree.Config.LiveFilter
278-
---@field prefix? string Prefix of the filter displayed in the buffer. Default: `"[FILTER]: "`
279-
---@field always_show_folders? boolean Whether to filter folders or not. Default: `true`
318+
---
319+
---Prefix of the filter displayed in the buffer.
320+
---(default: `[FILTER]: `)
321+
---@field prefix? string
322+
---
323+
---Whether to filter folders or not.
324+
---(default: `true`)
325+
---@field always_show_folders? boolean
280326

281327
--
282328
-- System Open

0 commit comments

Comments
 (0)