Alpha
info
You can enable the extra with the :LazyExtras
command.
Plugins marked as optional will only be configured if they are installed.
Below you can find a list of included plugins and their default settings.
caution
You don't need to copy the default settings to your config. They are only shown here for reference.
snacks.nvimâ
- Options
- Full Spec
opts = { dashboard = { enabled = false } }
{ "folke/snacks.nvim", opts = { dashboard = { enabled = false } } }
alpha-nvimâ
Dashboard. This runs when neovim starts, and is what displays the "LAZYVIM" banner.
- Options
- Full Spec
opts = function()
local dashboard = require("alpha.themes.dashboard")
local logo = [[
âââ ââââââ âââââââââââ ââââââ ââââââââââ ââââ Z
âââ ââââââââââââââââââââ âââââââ âââââââââââ âââââ Z
âââ ââââââââ âââââ âââââââ âââ âââââââââââââââââ z
âââ ââââââââ âââââ âââââ ââââ ââââââââââââââââââ z
âââââââââââ âââââââââââ âââ âââââââ ââââââ âââ âââ
âââââââââââ âââââââââââ âââ âââââ ââââââ âââ
]]
dashboard.section.header.val = vim.split(logo, "\n")
-- stylua: ignore
dashboard.section.buttons.val = {
dashboard.button("f", "ï " .. " Find file", "<cmd> lua LazyVim.pick()() <cr>"),
dashboard.button("n", "ï
" .. " New file", [[<cmd> ene <BAR> startinsert <cr>]]),
dashboard.button("r", "ï
" .. " Recent files", [[<cmd> lua LazyVim.pick("oldfiles")() <cr>]]),
dashboard.button("g", "ïą " .. " Find text", [[<cmd> lua LazyVim.pick("live_grep")() <cr>]]),
dashboard.button("c", "ïŁ " .. " Config", "<cmd> lua LazyVim.pick.config_files()() <cr>"),
dashboard.button("s", "î " .. " Restore Session", [[<cmd> lua require("persistence").load() <cr>]]),
dashboard.button("x", "îȘ " .. " Lazy Extras", "<cmd> LazyExtras <cr>"),
dashboard.button("l", "ó°Č " .. " Lazy", "<cmd> Lazy <cr>"),
dashboard.button("q", "ïŠ " .. " Quit", "<cmd> qa <cr>"),
}
for _, button in ipairs(dashboard.section.buttons.val) do
button.opts.hl = "AlphaButtons"
button.opts.hl_shortcut = "AlphaShortcut"
end
dashboard.section.header.opts.hl = "AlphaHeader"
dashboard.section.buttons.opts.hl = "AlphaButtons"
dashboard.section.footer.opts.hl = "AlphaFooter"
dashboard.opts.layout[1].val = 8
return dashboard
end
{
"goolord/alpha-nvim",
event = "VimEnter",
enabled = true,
init = false,
opts = function()
local dashboard = require("alpha.themes.dashboard")
local logo = [[
âââ ââââââ âââââââââââ ââââââ ââââââââââ ââââ Z
âââ ââââââââââââââââââââ âââââââ âââââââââââ âââââ Z
âââ ââââââââ âââââ âââââââ âââ âââââââââââââââââ z
âââ ââââââââ âââââ âââââ ââââ ââââââââââââââââââ z
âââââââââââ âââââââââââ âââ âââââââ ââââââ âââ âââ
âââââââââââ âââââââââââ âââ âââââ ââââââ âââ
]]
dashboard.section.header.val = vim.split(logo, "\n")
-- stylua: ignore
dashboard.section.buttons.val = {
dashboard.button("f", "ï " .. " Find file", "<cmd> lua LazyVim.pick()() <cr>"),
dashboard.button("n", "ï
" .. " New file", [[<cmd> ene <BAR> startinsert <cr>]]),
dashboard.button("r", "ï
" .. " Recent files", [[<cmd> lua LazyVim.pick("oldfiles")() <cr>]]),
dashboard.button("g", "ïą " .. " Find text", [[<cmd> lua LazyVim.pick("live_grep")() <cr>]]),
dashboard.button("c", "ïŁ " .. " Config", "<cmd> lua LazyVim.pick.config_files()() <cr>"),
dashboard.button("s", "î " .. " Restore Session", [[<cmd> lua require("persistence").load() <cr>]]),
dashboard.button("x", "îȘ " .. " Lazy Extras", "<cmd> LazyExtras <cr>"),
dashboard.button("l", "ó°Č " .. " Lazy", "<cmd> Lazy <cr>"),
dashboard.button("q", "ïŠ " .. " Quit", "<cmd> qa <cr>"),
}
for _, button in ipairs(dashboard.section.buttons.val) do
button.opts.hl = "AlphaButtons"
button.opts.hl_shortcut = "AlphaShortcut"
end
dashboard.section.header.opts.hl = "AlphaHeader"
dashboard.section.buttons.opts.hl = "AlphaButtons"
dashboard.section.footer.opts.hl = "AlphaFooter"
dashboard.opts.layout[1].val = 8
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", {
once = true,
pattern = "AlphaReady",
callback = function()
require("lazy").show()
end,
})
end
require("alpha").setup(dashboard.opts)
vim.api.nvim_create_autocmd("User", {
once = true,
pattern = "LazyVimStarted",
callback = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
dashboard.section.footer.val = "⥠Neovim loaded "
.. stats.loaded
.. "/"
.. stats.count
.. " plugins in "
.. ms
.. "ms"
pcall(vim.cmd.AlphaRedraw)
end,
})
end,
}