return { 'goolord/alpha-nvim', event = 'VimEnter', opts = function() local dashboard = require('alpha.themes.dashboard') require("alpha.term") dashboard.section.terminal.command = vim.fn.stdpath("config") .. "/nvim-logo -t" dashboard.section.terminal.width = 70 dashboard.section.terminal.height = 10 dashboard.section.terminal.opts.redraw = true dashboard.section.terminal.opts.window_config.zindex = 1 dashboard.section.buttons.val = { dashboard.button('i', ' new file', ':ene startinsert'), dashboard.button('r', ' recent files', ':Telescope oldfiles'), dashboard.button('f', '󰥨 find file', ':Telescope file_browser'), dashboard.button('g', '󰱼 find text', ':Telescope live_grep_args'), dashboard.button('l', '󰒲 lazy', ':Lazy'), dashboard.button('m', '󱌣 mason', ':Mason'), dashboard.button('q', '󰭿 quit', ':qa'), } for _, button in ipairs(dashboard.section.buttons.val) do button.opts.hl = 'Normal' button.opts.hl_shortcut = 'Function' end dashboard.section.footer.opts.hl = "Special" dashboard.opts.layout = { dashboard.section.terminal, { type = "padding", val = 4 }, dashboard.section.buttons, dashboard.section.footer, } return dashboard end, config = function(_, dashboard) -- close lazy and re-open when the dashboard is ready if vim.o.filetype == 'lazy' then vim.cmd.close() vim.api.nvim_create_autocmd('User', { pattern = 'AlphaReady', callback = function() require('lazy').show() end, }) end require('alpha').setup(dashboard.opts) vim.api.nvim_create_autocmd('User', { pattern = 'LazyVimStarted', callback = function() local stats = require('lazy').stats() local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) dashboard.section.footer.val = '󱐋 ' .. stats.count .. ' plugins loaded in ' .. ms .. 'ms' pcall(vim.cmd.AlphaRedraw) end, }) end, }