File tree 3 files changed +16
-0
lines changed
3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -308,6 +308,7 @@ Subsequent calls to setup will replace the previous configuration.
308
308
filesystem_watchers = {
309
309
enable = true,
310
310
debounce_delay = 50,
311
+ ignore_dirs = {},
311
312
},
312
313
git = {
313
314
enable = true,
@@ -604,6 +605,12 @@ performance.
604
605
Idle milliseconds between filesystem change and action.
605
606
Type: `number ` , Default: `50 ` (ms)
606
607
608
+ *nvim-tree.filesystem_watchers.ignore_dirs*
609
+ List of vim regex for absolute directory paths that will not be watched.
610
+ Backslashes must be escaped e.g. `" my-project/\\ .build$" ` . See | string-match | .
611
+ Useful when path is not in `.gitignore` or git integration is disabled.
612
+ Type: {string} , Default: `{}`
613
+
607
614
*nvim-tree.on_attach*
608
615
Function ran when creating the nvim-tree buffer.
609
616
This can be used to attach keybindings to the tree buffer.
Original file line number Diff line number Diff line change @@ -589,6 +589,7 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
589
589
filesystem_watchers = {
590
590
enable = true ,
591
591
debounce_delay = 50 ,
592
+ ignore_dirs = {},
592
593
},
593
594
git = {
594
595
enable = true ,
Original file line number Diff line number Diff line change @@ -36,6 +36,13 @@ local function is_folder_ignored(path)
36
36
return true
37
37
end
38
38
end
39
+
40
+ for _ , ignore_dir in ipairs (M .ignore_dirs ) do
41
+ if vim .fn .match (path , ignore_dir ) ~= - 1 then
42
+ return true
43
+ end
44
+ end
45
+
39
46
return false
40
47
end
41
48
78
85
function M .setup (opts )
79
86
M .enabled = opts .filesystem_watchers .enable
80
87
M .debounce_delay = opts .filesystem_watchers .debounce_delay
88
+ M .ignore_dirs = opts .filesystem_watchers .ignore_dirs
81
89
M .uid = 0
82
90
end
83
91
You can’t perform that action at this time.
0 commit comments