neotree performance opti

This commit is contained in:
Mathias Schneider
2026-04-09 21:09:14 +02:00
parent f009dd3b68
commit 5e26805b38
+49 -20
View File
@@ -1,22 +1,51 @@
return { return {
"nvim-neo-tree/neo-tree.nvim", "nvim-neo-tree/neo-tree.nvim",
branch = "v3.x", branch = "v3.x",
dependencies = { dependencies = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim", "MunifTanjim/nui.nvim",
"nvim-tree/nvim-web-devicons", "nvim-tree/nvim-web-devicons",
}, },
config = function() config = function()
require("neo-tree").setup({ require("neo-tree").setup({
filesystem = { -- Performance optimizations for large repositories
use_libuv_file_watcher = true, -- Enable OS-level file watching for automatic git status updates git_status_async = true,
filtered_items = { git_status_async_options = {
visible = true, batch_size = 1000, -- Process git status in batches
hide_dotfiles = false, batch_delay = 10, -- 10ms delay between batches
hide_hidden = false, max_lines = 10000, -- Limit git status lines processed
}, },
}, filesystem = {
}) use_libuv_file_watcher = true, -- Enable OS-level file watching for automatic git status updates
vim.keymap.set('n', '<C-n>', ':Neotree filesystem reveal left<CR>', {}) async_directory_scan = "always", -- Always scan directories asynchronously for better performance
end, scan_mode = "shallow", -- Don't scan deeply into directories (faster)
filtered_items = {
visible = true,
hide_dotfiles = false,
hide_hidden = false,
-- Hide common heavy directories to improve performance
hide_by_name = {
"node_modules",
".git",
".venv",
"venv",
"__pycache__",
".pytest_cache",
".mypy_cache",
".ruff_cache",
".hypothesis",
"target",
"dist",
"build",
},
hide_by_pattern = {
"*.pyc",
"*.pyo",
"*.egg-info",
},
},
},
})
vim.keymap.set("n", "<C-n>", ":Neotree filesystem reveal left<CR>", {})
end,
} }