add dynamic header padding for dashboard | disable statusline in it
This commit is contained in:
parent
08a16b9201
commit
8571787d70
@ -1,4 +1,19 @@
|
|||||||
-- local autocmd = vim.api.nvim_create_autocmd
|
local autocmd = vim.api.nvim_create_autocmd
|
||||||
|
|
||||||
|
-- Disable statusline in dashboard
|
||||||
|
autocmd("FileType", {
|
||||||
|
pattern = "alpha",
|
||||||
|
callback = function()
|
||||||
|
vim.opt.laststatus = 0
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
autocmd("BufUnload", {
|
||||||
|
buffer = 0,
|
||||||
|
callback = function()
|
||||||
|
vim.opt.laststatus = 3
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
-- Uncomment this if you want to open nvim with a dir
|
-- Uncomment this if you want to open nvim with a dir
|
||||||
-- autocmd("BufEnter", {
|
-- autocmd("BufEnter", {
|
||||||
|
@ -74,9 +74,14 @@ options.buttons = {
|
|||||||
|
|
||||||
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 = 9 },
|
{ type = "padding", val = headerPadding },
|
||||||
options.header,
|
options.header,
|
||||||
{ type = "padding", val = 2 },
|
{ type = "padding", val = 2 },
|
||||||
options.buttons,
|
options.buttons,
|
||||||
|
Loading…
Reference in New Issue
Block a user