Files
nvim/after/plugin/tree.lua
2026-06-03 21:58:43 +03:00

32 lines
595 B
Lua

local tree = require("nvim-tree")
local utils = require("utils")
local api = require("nvim-tree.api")
local function on_attach(bufnr)
api.map.on_attach.default(bufnr)
end
---@type nvim_tree.config
local options = {
view = {
side = "right",
},
update_focused_file = {
enable = true,
exclude = function(args)
for _, dir in ipairs({ "node_modules", "vendor", ".git" }) do
if args.file:find(dir, 1, true) then
return true
end
end
return false
end,
},
on_attach = on_attach,
}
tree.setup(options)
utils.nmap("<leader>e", api.tree.toggle, "nvim-tree: toggle")