Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ require("nvim-tree").setup({
dotfiles = true,
},
})

-- OR use the following variable and nvim-tree will call setup lazily
vim.g.NvimTreeConfig = {
on_attach = my_on_attach
}
```

### Help
Expand Down
6 changes: 5 additions & 1 deletion lua/nvim-tree/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ local Api = {
---@return fun(...): any
local function wrap(fn)
return function(...)
if vim.g.NvimTreeSetup == 1 then
if vim.g.NvimTreeSetup == 1 or vim.g.NvimTreeConfig then
if vim.g.NvimTreeSetup ~= 1 then
require("nvim-tree").setup(vim.g.NvimTreeConfig)
end

return fn(...)
else
notify.error("nvim-tree setup not called")
Expand Down
Loading