autocmd.lua (248B)
1 -- various functions 2 3 -- close nvim-tree if it's last buffer 4 vim.api.nvim_create_autocmd("BufEnter", { 5 pattern = "*", 6 callback = function() 7 if #vim.api.nvim_list_bufs() == 1 and vim.bo.filetype == "NvimTree" then 8 vim.cmd("quit") 9 end 10 end, 11 })