dashboard-nvim
dashboard-nvim copied to clipboard
Can't generate my own footer with require("lazy").stats()
When I call require("lazy").stats() to get startup time, but it always show 0. I think it might be due to startup time is generated till UIEnter. So I don't know how to make my own footer that shows startup time of lazy.nvim. Here is my code:
config = function(_, opts)
local stats = require("lazy").stats()
local footer = {
"",
"",
"",
" "
.. stats.startuptime
.. " / "
.. stats.loaded
.. " / "
.. stats.count,
}
require("dashboard").setup(
vim.tbl_deep_extend("force", opts, { config = { footer = footer } })
)
end,
which theme the latest commit integeration lazy.
which theme the latest commit integeration lazy.
doom theme
I use this configuration and it works with lazy.nvim stats:
footer = function()
local stats = require('lazy').stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
return { '⚡ Neovim loaded ' .. stats.loaded .. '/' .. stats.count .. ' plugins in ' .. ms .. 'ms' }
end,