plugins: alpha: Move alpha related cmd to alpha config
this special handling of statusline should only be done if alpha plugin is used
This commit is contained in:
parent
fe9a7b1651
commit
a23d955656
2 changed files with 16 additions and 15 deletions
|
@ -27,21 +27,6 @@ autocmd("VimEnter", {
|
|||
end,
|
||||
})
|
||||
|
||||
-- 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,
|
||||
})
|
||||
|
||||
-- store listed buffers in tab local var
|
||||
vim.t.bufs = vim.api.nvim_list_bufs()
|
||||
|
||||
|
|
|
@ -92,3 +92,19 @@ alpha.setup {
|
|||
},
|
||||
opts = {},
|
||||
}
|
||||
|
||||
-- Disable statusline in dashboard
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "alpha",
|
||||
callback = function()
|
||||
-- store current statusline value and use that
|
||||
local old_laststatus = vim.opt.laststatus
|
||||
vim.api.nvim_create_autocmd("BufUnload", {
|
||||
buffer = 0,
|
||||
callback = function()
|
||||
vim.opt.laststatus = old_laststatus
|
||||
end,
|
||||
})
|
||||
vim.opt.laststatus = 0
|
||||
end,
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue