diff --git a/lua/plugins.lua b/lua/plugins.lua index 148590d..89428f8 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -53,7 +53,7 @@ local plugins = { -- }, -- config = function(_, opts) -- require("nvim-autopairs").setup(opts) - -- end, +-- end, -- }, -- }}} -- }}} @@ -69,7 +69,9 @@ local plugins = { --start screen { - 'goolord/alpha-nvim', + 'nvimdev/dashboard-nvim', + event = 'VimEnter', + dependencies = { {'nvim-tree/nvim-web-devicons'}} }, -- }}} diff --git a/lua/ui/startscreen.lua b/lua/ui/startscreen.lua index a9be514..7c01343 100644 --- a/lua/ui/startscreen.lua +++ b/lua/ui/startscreen.lua @@ -1,177 +1,36 @@ -local alpha = require("alpha") - -local col = function(strlist, opts) - -- strlist is a TABLE of TABLES, representing columns of text - -- opts is a text display option - - -- column spacing - local padding = 12 - -- fill lines up to the maximim length with 'fillchar' - local fillchar = ' ' - -- columns padding char (for testing) - local padchar = ' ' - - -- define maximum string length in a table - local maxlen = function(str) - local max = 0 - for i in pairs(str) do - if #str[i] > max then - max = #str[i] - end - end - return max - end - - -- add as much right-padding to align the text block - local pad = function(str, max) - local strlist = {} - for i in pairs(str) do - if #str[i] < max then - local newstr = str[i] .. string.rep(fillchar, max-#str[i]) - table.insert(strlist, newstr) - else - table.insert(strlist, str[i]) - end - end - return strlist - end - - -- this is a table for text strings - local values = {} - -- process all the lines - for i=1,maxlen(strlist) do - local str = '' - -- process all the columns but last, because we dont wand extra padding - -- after last column - for column=1,#strlist-1 do - local maxstr = maxlen(strlist[column]) - local padded = pad(strlist[column], maxstr) - if strlist[column][i] == nil then - str = str .. string.rep(fillchar, maxstr) .. string.rep(padchar, padding) - else - str = str .. padded[i] .. string.rep(padchar, padding) - end - end - - -- lets process the last column, no extra padding - do - local maxstr = maxlen(strlist[#strlist]) - local padded = pad(strlist[#strlist], maxstr) - if strlist[#strlist][i] == nil then - str = str .. string.rep(fillchar, maxlen(strlist[#strlist])) - else - str = str .. padded[i] - end - end - - -- insert result into output table - table.insert(values, { type = "text", val = str, opts = opts }) - end - - return values -end - -local window_managment = { - - "ALT-ENT new tab terminal", - "ALT-NUM move to tab n", - "ALT-v horizontal split", - "ALT-v vertical split", -} - -local text_managment = { - "CTRL-t new file", - "CTRL-w :q", - "CTRL-n open file manager" +local dash = require('dashboard') +local custom_header = { + ' .█▄╥ _▄K¥▄ ', + ' █ `▀▄_ ▄▄ ╓▄▀" ▀▌ ', + ' █ "▀▄, ▓ ▀▀▄ ▄▀- █ ', + ' ▐▌ ▀▄▌▀▀▀▀`""▀▀█ ▀▄ _▄▀ ▓ ', + ' ▓ "▓╥ "▓_.▓▀ ╫ ', + ' )▌ ▀█ ╫ ', + ' ▐∩ █ ', + ' ▐∩ ▐▌ ', + ' ▐µ █▌ ', + ' ▓ ╨▓▓█▄▄╥_ ,▄▄█████▄ █ ', + ' ▐▄ `"▀▀██▄ ▐███▌╓_ .▓" ', + ' "▓▄ _▄▄███▀` ▄▄▄▄┐ "▀▀█████▄ .▄K▀▀▀▀█ ', + '▐▌▀▀▀▀ª ▀▀` "▀▄, _ _╥▄▀ ', + ' ▓▄ _╥µ __ ,▄▄ ]µ ` ╫▌@╨ ▀▌ ', + ' "▀▄` ▓K" *▌▄▄▀" "▀▀▓▀ ▀▄ ', + ' █. ▐▌ j▌ _ █ ', + ' █ , ▀▄ ▐▌ ▄▓"▀▀▀▀" ', + ' ▐█K▀▀"▀¥██▌▄▄_ ╨▓_ _█ ,▄▄K▀▀ ', + ' ▐▌ "▀W "▀" "█µ ', + ' ▐█ "▓_ ', + ' _▓▀ ▀▄ ', + ' j█____ _ ▀▄ ', + ' ``"▓" ▓⌐ ', + ' █ ▐▌ ', + ' ▀ ▀ ', } -local applications = { - "ALT+ESC htop", - "ALT+t termusic", - "ALT+r ranger", - "ALT+m matrix", - +dash.setup{ + config = { + theme = 'doom', + header = custom_header, + } } - - - - -local head = { - type = "text", - val = { -[[ .█▄╥ _▄K¥▄ ]], -[[ █ '▀▄_ ▄▄ ╓▄▀" ▀▌ ]], -[[ █ "▀▄, ▓ ▀▀▄ ▄▀- █ ]], -[[ ▐▌ ▀▄▌▀▀▀▀'""▀▀█ ▀▄ _▄▀ ▓ ]], -[[ ▓ "▓╥ "▓_.▓▀ ╫ ]], -[[ )▌ ▀█ ╫ ]], -[[ ▐∩ █ ]], -[[ ▐∩ ▐▌ ]], -[[ ▐µ █▌ ]], -[[ ▓ ╨▓▓█▄▄╥_ ,▄▄█████▄ █ ]], -[[ ▐▄ `"▀▀██▄ ▐███▌╓_ .▓" ]], -[[ "▓▄ _▄▄███▀' ▄▄▄▄┐ "▀▀█████▄ .▄K▀▀▀▀█ ]], -[[▐▌▀▀▀▀ª ▀▀' "▀▄, _ _╥▄▀ ]], -[[ ▓▄ _╥µ __ ,▄▄ ]µ ` ╫▌@╨ ▀▌ ]], -[[ "▀▄` ▓K" *▌▄▄▀" "▀▀▓▀ ▀▄ ]], -[[ █. ▐▌ j▌ _ █ ]], -[[ █ , ▀▄ ▐▌ ▄▓"▀▀▀▀" ]], -[[ ▐█K▀▀"▀¥██▌▄▄_ ╨▓_ _█ ,▄▄K▀▀ ]], -[[ ▐▌ "▀W "▀" "█µ ]], -[[ ▐█ "▓_ ]], -[[ _▓▀ ▀▄ ]], -[[ j█____ _ ▀▄ ]], -[[ ''"▓" ▓⌐ ]], -[[ █ ▐▌ ]], -[[ ▀ ▀ ]], - -}, -opts = { -position = "center", -hl = "Type", -}, -} - -local foot = { -type = "text", -val = "footer", -opts = { -position = "center", -hl = "Number", -}, -} - -local block1 = { -type = "group", -val = col({window_managment, text_managment}, { position = "center", hl = {{ "Title", 0, 7 }, {"Comment", 7, 37}, {"Title", 37, 44}, {"Comment", 44, -1}}}), -opts = { -spacing = 0 -}, -} - -local block2 = { -type = "group", -val = col({applications}, { position = "center", hl = {{"Comment", 7, -1}, { "Title", 0, 7 }} }), -opts = { -spacing = 0 -}, -} - - -local opts = { -layout = { -{ type = "padding", val = 2 }, -head, -{ type = "padding", val = 2 }, -block1, -{ type = "padding", val = 2 }, -block2, -}, -opts = { -noautocmd = true, -margin = 5, -}, -} -alpha.setup(opts) -