config/.config/nvim/lua/user/alpha.lua

47 lines
1.7 KiB
Lua

local s_ok, alpha = pcall(require, "alpha")
if not s_ok then
return
end
local dashboard = require"alpha.themes.dashboard"
local function button(sc, txt, key, key_opts)
local b = dashboard.button(sc, txt, key, key_opts)
b.opts.hl_shortcut = "Macro"
return b
end
local icons = require"user.icons"
dashboard.section.header.val = {
[[ , __ ___ __. _ __ ` , _ , _ ]],
[[ |' `. .' ` .' \ | / | |' `|' `.]],
[[ | | |----' | | ` / | | | |]],
[[ / | `.___, `._.' \/ / / ' /]],
}
dashboard.section.buttons.val = {
button("f", icons.documents.Files .. " Find file", ":Telescope find_files <CR>"),
button("e", icons.ui.NewFile .. " New file", ":ene <BAR> startinsert <CR>"),
button("p", icons.git.Repo .. " Find project", ":lua require('telescope').extensions.projects.projects()<CR>"),
button("r", icons.ui.History .. " Recent files", ":Telescope oldfiles <CR>"),
button("t", icons.ui.List .. " Find text", ":Telescope live_grep <CR>"),
button("c", icons.ui.Gear .. " Config", ":e ~/.config/nvim/init.lua <CR>"),
button("u", icons.ui.CloudDownload .. " Update", ":PackerSync<CR>"),
button("q", icons.ui.SignOut .. " Quit", ":qa<CR>"),
}
dashboard.section.footer.val = {
[[┬┌┐┌┬┌─┬ ┌─┐┌┬┐┌┐ ┬ ┌─┐┌┬┐┌─┐┌─┐┌┬┐]],
[[││││├┴┐│ ├┤ │ ├┴┐│ │ │ │ │ │ ││││]],
[[┴┘└┘┴ ┴┴─┘└─┘ ┴ └─┘┴─┘└─┘ ┴o└─┘└─┘┴ ┴]],
}
dashboard.section.header.opts.hl = "Include"
dashboard.section.buttons.opts.hl = "Macro"
dashboard.section.footer.opts.hl = "Type"
dashboard.opts.opts.noautocmd = true
alpha.setup(dashboard.opts)