mirror of
https://github.com/CompeyDev/my-nvim-setup.git
synced 2024-12-13 13:30:41 +00:00
make paddings in the layout can be overrided
users can adjust the padding between the top and the header, or the header and buttons.
This commit is contained in:
parent
66e2904b68
commit
d9cd55fc0f
1 changed files with 10 additions and 7 deletions
|
@ -34,6 +34,11 @@ local function button(sc, txt, keybind)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- dynamic header padding
|
||||||
|
local fn = vim.fn
|
||||||
|
local marginTopPercent = 0.3
|
||||||
|
local headerPadding = fn.max { 2, fn.floor(fn.winheight(0) * marginTopPercent) }
|
||||||
|
|
||||||
local options = {
|
local options = {
|
||||||
|
|
||||||
header = {
|
header = {
|
||||||
|
@ -71,20 +76,18 @@ local options = {
|
||||||
spacing = 1,
|
spacing = 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
headerPaddingTop = { type = "padding", val = headerPadding },
|
||||||
|
headerPaddingBottom = { type = "padding", val = 2 },
|
||||||
}
|
}
|
||||||
|
|
||||||
options = require("core.utils").load_override(options, "goolord/alpha-nvim")
|
options = require("core.utils").load_override(options, "goolord/alpha-nvim")
|
||||||
|
|
||||||
-- dynamic header padding
|
|
||||||
local fn = vim.fn
|
|
||||||
local marginTopPercent = 0.3
|
|
||||||
local headerPadding = fn.max { 2, fn.floor(fn.winheight(0) * marginTopPercent) }
|
|
||||||
|
|
||||||
alpha.setup {
|
alpha.setup {
|
||||||
layout = {
|
layout = {
|
||||||
{ type = "padding", val = headerPadding },
|
options.headerPaddingTop,
|
||||||
options.header,
|
options.header,
|
||||||
{ type = "padding", val = 2 },
|
options.headerPaddingBottom,
|
||||||
options.buttons,
|
options.buttons,
|
||||||
},
|
},
|
||||||
opts = {},
|
opts = {},
|
||||||
|
|
Loading…
Reference in a new issue