2023-05-16 09:22:33 +01:00
|
|
|
return {
|
|
|
|
"goolord/alpha-nvim",
|
|
|
|
event = "VimEnter",
|
|
|
|
opts = function()
|
|
|
|
local dashboard = require "alpha.themes.dashboard"
|
|
|
|
local logo = [[
|
|
|
|
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
|
|
|
|
██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z
|
|
|
|
██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z
|
|
|
|
██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z
|
|
|
|
███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║
|
|
|
|
╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
|
|
|
|
]]
|
|
|
|
|
2023-05-24 08:11:24 +01:00
|
|
|
dashboard.section.header.val = vim.split(logo, "\n")
|
|
|
|
-- dashboard.section.header.val = {
|
|
|
|
-- [[ __ ]],
|
|
|
|
-- [[ ___ ___ ___ __ __ /\_\ ___ ___ ]],
|
|
|
|
-- [[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]],
|
|
|
|
-- [[/\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]],
|
|
|
|
-- [[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]],
|
|
|
|
-- [[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]],
|
|
|
|
-- }
|
2023-05-16 09:22:33 +01:00
|
|
|
dashboard.section.buttons.val = {
|
2023-05-20 10:15:14 +01:00
|
|
|
dashboard.button("t", " " .. " Terminal", "<cmd>ToggleTerm direction=tab <CR>"),
|
|
|
|
dashboard.button("f", " " .. " Find file", "<cmd>Telescope find_files <CR>"),
|
|
|
|
dashboard.button("r", " " .. " Recent files", "<cmd>Telescope oldfiles <CR>"),
|
|
|
|
dashboard.button("n", " " .. " Neo-tree", "<cmd>Neotree float <CR>"),
|
2023-05-16 13:18:32 +01:00
|
|
|
dashboard.button("g", " " .. " Git status", "<cmd>Neogit <CR>"),
|
2023-05-20 10:15:14 +01:00
|
|
|
dashboard.button("c", " " .. " Config", "<cmd>e $MYVIMRC <CR>"),
|
2023-05-16 13:18:32 +01:00
|
|
|
dashboard.button("l", " " .. " Lazy", "<cmd>Lazy<CR>"),
|
2023-05-20 10:15:14 +01:00
|
|
|
dashboard.button("h", " " .. " Help", "<cmd>Telescope help_tags <CR>"),
|
|
|
|
dashboard.button("q", " " .. " Quit", "<cmd>qa<CR>"),
|
2023-05-16 09:22:33 +01:00
|
|
|
}
|
|
|
|
for _, button in ipairs(dashboard.section.buttons.val) do
|
|
|
|
button.opts.hl = "AlphaButtons"
|
|
|
|
button.opts.hl_shortcut = "AlphaShortcut"
|
|
|
|
end
|
|
|
|
dashboard.section.header.opts.hl = "AlphaHeader"
|
|
|
|
dashboard.section.buttons.opts.hl = "AlphaButtons"
|
|
|
|
dashboard.section.footer.opts.hl = "AlphaFooter"
|
|
|
|
dashboard.opts.layout[1].val = 8
|
|
|
|
return dashboard
|
|
|
|
end,
|
|
|
|
config = function(_, dashboard)
|
|
|
|
-- close Lazy and re-open when the dashboard is ready
|
|
|
|
if vim.o.filetype == "lazy" then
|
|
|
|
vim.cmd.close()
|
|
|
|
vim.api.nvim_create_autocmd("User", {
|
|
|
|
pattern = "AlphaReady",
|
|
|
|
callback = function() require("lazy").show() end,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
|
|
|
require("alpha").setup(dashboard.opts)
|
|
|
|
|
|
|
|
vim.api.nvim_create_autocmd("User", {
|
|
|
|
pattern = "LazyVimStarted",
|
|
|
|
callback = function()
|
|
|
|
local stats = require("lazy").stats()
|
|
|
|
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
|
|
|
dashboard.section.footer.val = "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms"
|
|
|
|
pcall(vim.cmd.AlphaRedraw)
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
end,
|
|
|
|
}
|