dashboard-nvim icon indicating copy to clipboard operation
dashboard-nvim copied to clipboard

Can't generate my own footer with require("lazy").stats()

Open cactusnix opened this issue 2 years ago • 3 comments

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,

cactusnix avatar Jul 31 '23 13:07 cactusnix

which theme the latest commit integeration lazy.

glepnir avatar Aug 01 '23 06:08 glepnir

which theme the latest commit integeration lazy.

doom theme

cactusnix avatar Aug 01 '23 10:08 cactusnix

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,

ilias777 avatar Jul 12 '24 18:07 ilias777