Skip to content

Commit 814dd26

Browse files
committed
doc(#2934): tidy and format nvim_tree.Config.FilesystemWatchers, Log
1 parent 0bcd9b5 commit 814dd26

2 files changed

Lines changed: 106 additions & 50 deletions

File tree

doc/nvim-tree-lua.txt

Lines changed: 46 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3681,21 +3681,27 @@ Lua module: nvim_tree *nvim-tree-module*
36813681
`vim.diagnostic.severity.ERROR`
36823682

36833683
*nvim_tree.Config.FilesystemWatchers*
3684+
Use file system watcher (libuv fs_event) to watch the filesystem for
3685+
changes.
3686+
3687+
Using this will disable |BufEnter| and |BufWritePost| events in nvim-tree
3688+
which were used to update the whole tree.
3689+
3690+
With this feature, the tree will be updated only for the appropriate
3691+
folder change, resulting in better performance.
36843692

36853693
Fields: ~
3686-
{enable}? (`boolean`) Enable / disable the feature. Default:
3687-
`true`
3688-
• {debounce_delay}? (`integer`) Idle milliseconds between filesystem
3689-
change and action. Default: `50` (ms)
3690-
• {ignore_dirs}? (`string[]|fun(path: string): boolean`) List of vim
3691-
regex for absolute directory paths that will not be
3692-
watched or function returning whether a path should
3693-
be ignored. Strings must be backslash escaped e.g.
3694-
`"my-proj/\\.build$"`. See |string-match|. Function
3695-
is passed an absolute path. Useful when path is not
3696-
in `.gitignore` or git integration is disabled.
3697-
Default:
3698-
`{ "/.ccls-cache", "/build", "/node_modules", "/target", }`
3694+
{enable}? (`boolean`) (default: `true`)
3695+
• {debounce_delay}? (`integer`, default: `50`) Idle milliseconds
3696+
between filesystem change and action.
3697+
• {ignore_dirs}? (`string[]|fun(path: string): boolean`, default: `{ "/.ccls-cache", "/build", "/node_modules", "/target", }`)
3698+
List of vim regex for absolute directory paths that
3699+
will not be watched or function returning whether a
3700+
path should be ignored. Strings must be backslash
3701+
escaped e.g. `"my-proj/\\.build$"`. See
3702+
|string-match|. Function is passed an absolute
3703+
path. Useful when path is not in `.gitignore` or
3704+
git integration is disabled.
36993705

37003706
*nvim_tree.Config.Filters*
37013707

@@ -3787,8 +3793,10 @@ Lua module: nvim_tree *nvim-tree-module*
37873793
*nvim_tree.Config.LiveFilter*
37883794
Configurations for the live_filtering feature. The live filter allows you
37893795
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.
3796+
|vim.regex|).
3797+
3798+
This feature is bound to the `f` key by default. The filter can be cleared
3799+
with the `F` key by default.
37923800

37933801
Fields: ~
37943802
{prefix}? (`string`, default: `[FILTER]: `) Prefix of
@@ -3797,33 +3805,35 @@ Lua module: nvim_tree *nvim-tree-module*
37973805
folders or not.
37983806

37993807
*nvim_tree.Config.Log*
3808+
Log to a file `nvim-tree.log` in |stdpath|("log"), usually
3809+
`${XDG_STATE_HOME}/nvim`
38003810

38013811
Fields: ~
3802-
{enable}? (`boolean`) Enable logging to a file `nvim-tree.log` in
3803-
|stdpath| `"log"`, usually `${XDG_STATE_HOME}/nvim`
3804-
Default: `false`
3805-
{truncate}? (`boolean`) Remove existing log file at startup. Default:
3806-
`false`
3807-
{types}? (`nvim_tree.Config.Log.Types`) Specify which information
3808-
to log.
3812+
{enable}? (`boolean`) (default: `false`)
3813+
{truncate}? (`boolean`, default: `false`) Remove existing log file at
3814+
startup.
3815+
{types}? (`nvim_tree.Config.Log.Types`)
3816+
|nvim_tree.Config.Log.Types|
38093817

38103818
*nvim_tree.Config.Log.Types*
3819+
Specify which information to log.
38113820

38123821
Fields: ~
3813-
{all}? (`boolean`) Everything. Default: `false`
3814-
{profile}? (`boolean`) Timing of some operations. Default:
3815-
`false`
3816-
{config}? (`boolean`) Options and mappings, at startup. Default:
3817-
`false`
3818-
• {copy_paste}? (`boolean`) File copy and paste actions. Default:
3819-
`false`
3820-
{dev}? (`boolean`) Used for local development only. Not
3821-
useful for users. Default: `false`
3822-
{diagnostics}? (`boolean`) LSP and COC processing, verbose. Default:
3823-
`false`
3824-
{git}? (`boolean`) Git processing, verbose. Default: `false`
3825-
{watcher}? (`boolean`) nvim-tree.filesystem_watchers processing,
3826-
verbose. Default: `false`
3822+
{all}? (`boolean`, default: `false`) Everything.
3823+
{profile}? (`boolean`, default: `false`) Timing of some
3824+
operations.
3825+
{config}? (`boolean`, default: `false`) Options and mappings, at
3826+
startup.
3827+
• {copy_paste}? (`boolean`, default: `false`) File copy and paste
3828+
actions.
3829+
{dev}? (`boolean`, default: `false`) Used for local
3830+
development only. Not useful for users.
3831+
{diagnostics}? (`boolean`, default: `false`) LSP and COC processing,
3832+
verbose.
3833+
{git}? (`boolean`, default: `false`) Git processing, verbose.
3834+
{watcher}? (`boolean`, default: `false`)
3835+
|nvim_tree.Config.FilesystemWatchers| processing,
3836+
verbose.
38273837

38283838
*nvim_tree.Config.Modified*
38293839
Indicate which file have unsaved modification. To see modified status in

lua/nvim-tree/_meta/config.lua

Lines changed: 60 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -422,29 +422,75 @@ error("Cannot require a meta file")
422422
-- Filesystem Watchers
423423
--
424424

425+
--- Use file system watcher (libuv fs_event) to watch the filesystem for changes.
426+
---
427+
--- Using this will disable |BufEnter| and |BufWritePost| events in nvim-tree which were used to update the whole tree.
428+
---
429+
--- With this feature, the tree will be updated only for the appropriate folder change, resulting in better performance.
425430
---@class nvim_tree.Config.FilesystemWatchers
426-
---@field enable? boolean Enable / disable the feature. Default: `true`
427-
---@field debounce_delay? integer Idle milliseconds between filesystem change and action. Default: `50` (ms)
428-
---@field ignore_dirs? string[]|fun(path: string): boolean List of vim regex for absolute directory paths that will not be watched or function returning whether a path should be ignored. Strings must be backslash escaped e.g. `"my-proj/\\.build$"`. See |string-match|. Function is passed an absolute path. Useful when path is not in `.gitignore` or git integration is disabled. Default: `{ "/.ccls-cache", "/build", "/node_modules", "/target", }`
431+
---
432+
---(default: `true`)
433+
---@field enable? boolean
434+
---
435+
---Idle milliseconds between filesystem change and action.
436+
---(default: `50`)
437+
---@field debounce_delay? integer
438+
---
439+
---List of vim regex for absolute directory paths that will not be watched or function returning whether a path should be ignored. Strings must be backslash escaped e.g. `"my-proj/\\.build$"`. See |string-match|. Function is passed an absolute path. Useful when path is not in `.gitignore` or git integration is disabled.
440+
---(default: `{ "/.ccls-cache", "/build", "/node_modules", "/target", }`)
441+
---@field ignore_dirs? string[]|fun(path: string): boolean
429442

430443
--
431444
-- Log
432445
--
433446

447+
---Log to a file `nvim-tree.log` in |stdpath|("log"), usually `${XDG_STATE_HOME}/nvim`
434448
---@class nvim_tree.Config.Log
435-
---@field enable? boolean Enable logging to a file `nvim-tree.log` in |stdpath| `"log"`, usually `${XDG_STATE_HOME}/nvim` Default: `false`
436-
---@field truncate? boolean Remove existing log file at startup. Default: `false`
437-
---@field types? nvim_tree.Config.Log.Types Specify which information to log.
449+
---
450+
---(default: `false`)
451+
---@field enable? boolean
452+
---
453+
---Remove existing log file at startup.
454+
---(default: `false`)
455+
---@field truncate? boolean
456+
---
457+
---|nvim_tree.Config.Log.Types|
458+
---@field types? nvim_tree.Config.Log.Types
438459

460+
---Specify which information to log.
439461
---@class nvim_tree.Config.Log.Types
440-
---@field all? boolean Everything. Default: `false`
441-
---@field profile? boolean Timing of some operations. Default: `false`
442-
---@field config? boolean Options and mappings, at startup. Default: `false`
443-
---@field copy_paste? boolean File copy and paste actions. Default: `false`
444-
---@field dev? boolean Used for local development only. Not useful for users. Default: `false`
445-
---@field diagnostics? boolean LSP and COC processing, verbose. Default: `false`
446-
---@field git? boolean Git processing, verbose. Default: `false`
447-
---@field watcher? boolean nvim-tree.filesystem_watchers processing, verbose. Default: `false`
462+
---
463+
---Everything.
464+
---(default: `false`)
465+
---@field all? boolean
466+
---
467+
--- Timing of some operations.
468+
---(default: `false`)
469+
---@field profile? boolean
470+
---
471+
---Options and mappings, at startup.
472+
---(default: `false`)
473+
---@field config? boolean
474+
---
475+
---File copy and paste actions.
476+
---(default: `false`)
477+
---@field copy_paste? boolean
478+
---
479+
---Used for local development only. Not useful for users.
480+
---(default: `false`)
481+
---@field dev? boolean
482+
---
483+
---LSP and COC processing, verbose.
484+
---(default: `false`)
485+
---@field diagnostics? boolean
486+
---
487+
---Git processing, verbose.
488+
---(default: `false`)
489+
---@field git? boolean
490+
---
491+
---|nvim_tree.Config.FilesystemWatchers| processing, verbose.
492+
---(default: `false`)
493+
---@field watcher? boolean
448494

449495
--
450496
-- UI

0 commit comments

Comments
 (0)