@@ -844,6 +844,9 @@ Windows WSL and PowerShell
844844- Executable file detection is disabled as this is non-performant and can
845845 freeze Nvim
846846- Some filesystem watcher error related to permissions will not be reported
847+ - Filesystem watchers can experience severe performance issues. It is strongly
848+ recommended to tightly control watcher usage via
849+ | nvim_tree.config.filesystem_watchers | {whitelist_dirs}
847850
848851Powershell
849852- Observed Nvim hanging after a runaway (infinite) number of events on a
@@ -1692,25 +1695,36 @@ Config: filesystem_watchers *nvim-tree-config-filesystem-watchers*
16921695 With this feature, the tree will be partially updated on specific
16931696 directory changes, resulting in better performance.
16941697
1695- Watchers may be disabled for absolute directory paths via {ignore_dirs}.
1696- • A list of | regular-expression | to match a path, backslash escaped e.g.
1697- `" my-proj/\\ .build$" ` OR
1698- • A function that is passed an absolute path and returns `true` to disable
1699- This may be useful when a path is not in `.gitignore` or git integration
1700- is disabled.
1698+ Blacklist watching absolute directory paths via {ignore_dirs} and
1699+ optionally whitelist via {whitelist_dirs}:
1700+ • A table of | regular-expression | that will be passed to `vim .fn.match `
1701+ • Backslashes must be escaped e.g. `" my-proj/\\ .build$" `
1702+ • Literal backslashes must be double escaped to avoid | /magic | e.g.
1703+ `" C:\\\\ src\\\\ my-proj" `
1704+ • OR a `fun(path: string): boolean` that is passed an absolute path:
1705+ • {ignore_dirs}: return `true` to disable
1706+ • {whitelist_dirs}: return `true` to enable
1707+
1708+ {whitelist_dirs} is STRONGLY recommended for windows:
1709+ | nvim-tree-os-specific | .
17011710
17021711 After {max_events} consecutive filesystem events on a single directory
17031712 with an interval < {debounce_delay}:
17041713 • The filesystem watcher will be disabled for that directory.
17051714 • A warning notification will be shown.
17061715 • Consider adding this directory to {ignore_dirs}
17071716
1717+ By default, {max_events} is only enabled for windows.
1718+
17081719 Fields: ~
17091720 • {enable} ? (`boolean ` ) (default: `true` )
17101721 • {debounce_delay}? (`integer` , default: `50 ` ) Idle milliseconds
17111722 between filesystem change and tree update.
17121723 • {ignore_dirs}? (`string[]|(fun(path: string): boolean)`, default: `{ "/.ccls-cache", "/build", "/node_modules", "/target", "/.zig-cache"}`)
17131724 Disable for specific directories.
1725+ • {whitelist_dirs}? (`string[]|(fun(path: string): boolean)`, default:
1726+ `{}` ) Optionally enable only for specific
1727+ directories.
17141728 • {max_events}? (`integer` , default: `0 ` or `1000 ` on windows)
17151729 Disable for a single directory after {max_events}
17161730 consecutive events with an interval <
@@ -2199,6 +2213,7 @@ Following is the default configuration, see |nvim_tree.config| for details. >lua
21992213 "/target",
22002214 "/.zig-cache",
22012215 },
2216+ whitelist_dirs = {},
22022217 },
22032218 actions = {
22042219 use_system_clipboard = true,
0 commit comments