Closed siduck closed 1 year ago
yeah i'll work something out for this. it will probably end up looking like { type = "padding", val = function () math.min(3, calcVerticalCenter()) end }
@siduck You can implement dynamic padding like that,
local alpha = require('alpha')
local dashboard = require('alpha.themes.dashboard')
local section = dashboard.section
local fn = vim.fn
local config = dashboard.config
local marginTopPercent = 0.3
local headerPadding = fn.max({2, fn.floor(fn.winheight(0) * marginTopPercent) })
config.layout = {
{ type = 'padding', val = headerPadding },
section.header,
{ type = 'padding', val = 2 },
section.buttons,
section.footer,
}
alpha.setup(config)
@adoyle-h thx for this! I'll try it and let you know
I have to manually adjust the top padding in order to make the dashboard look vertically centered, is there any way to make this dynamic? Many user my config (nvchad) so I'd want alpha to look the same for others too
my config :