Skip to content

Instantly share code, notes, and snippets.

@Armanoide
Last active August 25, 2025 05:23
Show Gist options
  • Select an option

  • Save Armanoide/c0505dafe32b2470a14912a6384f3790 to your computer and use it in GitHub Desktop.

Select an option

Save Armanoide/c0505dafe32b2470a14912a6384f3790 to your computer and use it in GitHub Desktop.
How to edit Lazyvim's dashboard screen
  1. Create a folder in dashboard (ex: mkdir ~/.config/nvim/lua/dashboard)
  2. Create a lut file in dashboard (ex: touch ~/.config/nvim/lua/dashboard/init.lua)
  3. Copy the copy the content of init.lua, make sure the dashboard of snacks.nvim is set to false
  4. in Lazy.lua import first your dashboard
require("lazy").setup({
  spec = {
    { import = "dashboard" }, --  <--- import first your dashboard
    -- add LazyVim and import its plugins
    { "LazyVim/LazyVim",          import = "lazyvim.plugins" },
    -- import/override with your plugins
    { import = "plugins" },
  },
  default
  1. Remove the warning by setting vim.g.lazyvim_check_order = false in your options.lua

checkout my dotfile for more details

return {
{ "folke/snacks.nvim", opts = { dashboard = { enabled = false } } },
{
"goolord/alpha-nvim",
event = "VimEnter",
enabled = true,
init = false,
priority = 1000,
dependencies = { "nvim-tree/nvim-web-devicons", "folke/snacks.nvim" },
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,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment