radiant.nvim/lua/core/dashboard.lua

63 lines
1.8 KiB
Lua
Raw Normal View History

2024-01-16 20:34:00 +00:00
local alpha = require('alpha')
local dashboard = require('alpha.themes.dashboard')
local fn = vim.fn
local config = dashboard.config
local marginTopPercent = 0.3
local headerPadding = fn.max({2, fn.floor(fn.winheight(0) * marginTopPercent) })
local ascii = {
" ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ",
" ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ",
" ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ",
" ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ",
" ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ",
" ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ ",
" ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ",
" ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ",
" ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ ",
" ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ",
" ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ",
}
2024-01-16 20:34:00 +00:00
local header = {
type = "text",
val = ascii,
opts = {
position = "center",
hl = "AlphaHeader",
},
}
local buttons = {
type = "group",
val = {
dashboard.button("SPC f f", "Find File "),
dashboard.button("SPC f g", "Find Word "),
dashboard.button("SPC f e", "Edit File "),
2024-08-27 23:38:22 +01:00
dashboard.button("SPC l u", "Update Plugins "),
2024-01-16 20:34:00 +00:00
},
opts = {
spacing = 1,
},
}
local section = {
header = header,
buttons = buttons
}
local config = {
layout = {
{ type = 'padding', val = headerPadding },
section.header,
{ type = 'padding', val = 2 },
section.buttons,
},
}
dashboard.opts = config
alpha.setup(dashboard.opts)