Open 1995parham opened 11 months ago
any updates on this?
take a look at later.
I have added this in my ./lua/plugins/dashboard.lua which seems to do the trick:
-- somewhere in my config function ...
vim.defer_fn(
function ()
vim.api.nvim_create_autocmd(
'BufDelete',
{
group = vim.api.nvim_create_augroup('open-dashboard-after-last-buffer-close', { clear = true }),
callback = function (event)
for buf = 1, vim.fn.bufnr('$') do
if buf ~= event.buf and vim.fn.buflisted(buf) == 1 then
if vim.api.nvim_buf_get_name(buf) ~= '' and vim.bo[buf].filetype ~= 'dashboard' then
return
end
end
end
vim.cmd('Dashboard')
end,
}
)
end,
0
)
Edit: put in vim.defer_fn()
to fix an issue with lualine not showing
I want to have a way to open dashboard again when I closed my last window/buffer. I cannot find a way for it, so if there is a way for doing it, it would be great if we can have it in project readme/wiki.