rm autocmd for autohiding statusline in alpha

This commit is contained in:
siduck 2023-01-06 10:59:22 +05:30
parent 9680078c6a
commit 178d62bce4
1 changed files with 0 additions and 28 deletions

View File

@ -92,31 +92,3 @@ alpha.setup {
}, },
opts = {}, opts = {},
} }
-- Disable statusline in dashboard
vim.api.nvim_create_autocmd("FileType", {
pattern = "alpha",
callback = function()
-- store initial statusline value to be used later
if not vim.g.nvchad_vim_laststatus then
vim.g.nvchad_vim_laststatus = vim.opt.laststatus._value
end
-- Remove statusline since we have just loaded into an "alpha" filetype (i.e. dashboard)
vim.opt.laststatus = 0
vim.api.nvim_create_autocmd({ "TabEnter", "BufLeave" }, {
callback = function()
local current_type = vim.bo.filetype
if current_type == "alpha" or #current_type == 0 then
-- Switched to alpha or unknown filetype
vim.opt.laststatus = 0
else
-- Switched to any other filetype
vim.opt.laststatus = vim.g.nvchad_vim_laststatus
end
end
})
end,
})