How might I recreate this multi-colored header? #327
Unanswered
mike-lloyd03
asked this question in
Q&A
Replies: 2 comments 3 replies
-
Can you please share your current dashboard config? I can't figure out how to change the colors. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is what I have configured for {
"goolord/alpha-nvim",
event = "VimEnter",
enabled = true,
init = false,
opts = function()
local dashboard = require("alpha.themes.dashboard")
vim.api.nvim_set_hl(0, "DashboardLogo1", { fg = "#41a7fc" }) -- fg: Blue
vim.api.nvim_set_hl(0, "DashboardLogo2", { fg = "#8bcd5b", bg = "#41a7fc" }) -- fg: Green bg: Blue
vim.api.nvim_set_hl(0, "DashboardLogo3", { fg = "#8bcd5b" }) -- fg: Green
vim.api.nvim_set_hl(0, "DashboardLogoText", { fg = "#93a4c3", bold = true })
dashboard.section.header.val = {
--0123456789
[[ █ █ ]],
[[ ██ ██ ]],
[[ █████ ]],
[[ ██ ███ ]],
[[ █ █ ]],
[[]],
[[N E O V I M]],
}
dashboard.section.header.opts.hl = {
{ { "DashboardLogo1", 5, 6 }, { "DashboardLogo3", 6, 20 } },
{
{ "DashboardLogo1", 5, 6 },
{ "DashboardLogo2", 6, 10 },
{ "DashboardLogo3", 10, 24 },
},
{ { "DashboardLogo1", 5, 10 }, { "DashboardLogo3", 10, 26 } },
{ { "DashboardLogo1", 5, 10 }, { "DashboardLogo3", 10, 24 } },
{ { "DashboardLogo1", 5, 10 }, { "DashboardLogo3", 10, 22 } },
{},
{ { "DashboardLogoText", 0, 26 } },
}
dashboard.section.buttons.val = {
dashboard.button("n", " " .. " New file", "<cmd> ene <BAR> startinsert <cr>"),
dashboard.button(
"c",
" " .. " Open config",
"<cmd> cd ~/.config/nvim | e ~/.config/nvim/init.lua <cr>"
),
dashboard.button("s", " " .. " Restore session", "<cmd> SessionRestore <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.buttons.opts.hl = "AlphaButtons"
dashboard.section.footer.opts.hl = "AlphaFooter"
dashboard.opts.layout[1].val = 4
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,
}, But obviously, this approach won't work for |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm switching from
alpha.nvim
and this is my current dashboard with alpha:How might I recreate the multiple colors I have here with
dashboard
?This is what I have now:
Beta Was this translation helpful? Give feedback.
All reactions