neovim: Close tree if only buffer

This commit is contained in:
Donovan Glover 2023-06-06 07:18:59 -04:00
parent 3878a636d9
commit c588b3a0d8
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -60,6 +60,15 @@
type = "lua";
config = ''
require("nvim-tree").setup()
vim.api.nvim_create_autocmd("BufEnter", {
nested = true,
callback = function()
if #vim.api.nvim_list_wins() == 1 and require("nvim-tree.utils").is_nvim_tree_buf() then
vim.cmd "quit"
end
end
})
'';
}
{