nvimdev / dashboard-nvim

vim dashboard
MIT License
2.4k stars 192 forks source link

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

Open cactusnix opened 1 year ago

cactusnix commented 1 year ago

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,
glepnir commented 1 year ago

which theme the latest commit integeration lazy.

cactusnix commented 1 year ago

which theme the latest commit integeration lazy.

doom theme

ilias777 commented 4 months ago

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,