2023-03-05 17:34:12 +07:00
|
|
|
local data_exists, custom_dasboard = pcall(require, "core.config")
|
2023-01-25 16:53:42 +07:00
|
|
|
if data_exists then
|
2023-03-05 17:34:12 +07:00
|
|
|
local model = custom_dasboard.model
|
|
|
|
if model ~= nil then
|
|
|
|
if model == 1 then
|
2023-02-15 20:00:17 +07:00
|
|
|
require("user.startify")
|
2023-03-05 17:34:12 +07:00
|
|
|
else
|
|
|
|
require("user.dashboard")
|
2023-01-25 16:53:42 +07:00
|
|
|
end
|
2023-03-05 17:34:12 +07:00
|
|
|
else
|
|
|
|
require("user.startify")
|
2023-01-25 16:53:42 +07:00
|
|
|
end
|
2023-02-15 20:00:17 +07:00
|
|
|
else
|
|
|
|
require("user.startify")
|
2023-01-24 20:58:38 +07:00
|
|
|
end
|
2023-03-08 13:52:16 +07:00
|
|
|
|
|
|
|
-- 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,
|
|
|
|
})
|