Dashboard Customizations
AstroNvim comes with snacks.dashboard by default for providing a dashboard/home screen. This page provides a few common customization options.
Customize Dashboard Header
Section titled “Customize Dashboard Header”If you want to customize your header on the dashboard you can do this easily by overriding the snacks.nvim
options in your plugins:
return { "folke/snacks.nvim", opts = { dashboard = { preset = { header = table.concat({ "My Custom", "Dashboard Header", }, "\n"), }, }, },}
Customize Buttons
Section titled “Customize Buttons”In order to customize buttons presented on the dashboard, you can modify snacks.nvim
options:
return { "folke/snacks.nvim", opts = { dashboard = { preset = { keys = { { key = "h", action = function() vim.notify("Hello World!") end, desc = "Say Hi", }, }, }, }, },}
Open Dashboard Automatically When No More Buffers
Section titled “Open Dashboard Automatically When No More Buffers”If you want to make the dashboard/home screen open automatically when you close the last buffer in your session you can add the following to your AstroCore mappings configuration:
return { "AstroNvim/astrocore", ---@type AstroCoreOpts opts = { mappings = { n = { ["<Leader>c"] = { function() local bufs = vim.fn.getbufinfo({ buflisted = true }) require("astrocore.buffer").close(0) if not bufs[2] then require("snacks").dashboard() end end, desc = "Close buffer", }, }, }, },}