From 06c133adc8fa64117338ee753f7d94e0c56d22e2 Mon Sep 17 00:00:00 2001 From: rajvatsal Date: Sun, 24 Dec 2023 20:53:33 +0530 Subject: [PATCH] Add ascii art to start screen in alpha-nvim config --- lua/custom/plugins/alpha.lua | 52 ++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/lua/custom/plugins/alpha.lua b/lua/custom/plugins/alpha.lua index 60c19d43..90b411b8 100644 --- a/lua/custom/plugins/alpha.lua +++ b/lua/custom/plugins/alpha.lua @@ -1,7 +1,49 @@ return { - 'goolord/alpha-nvim', - dependencies = 'nvim-tree/nvim-web-devicons', - config = function() - require 'alpha'.setup(require 'alpha.themes.dashboard'.config) - end + 'goolord/alpha-nvim', + dependencies = 'nvim-tree/nvim-web-devicons', + config = function() + -- require 'alpha'.setup(require 'alpha.themes.dashboard'.config) + local alpha = require("alpha") + local dashboard = require("alpha.themes.dashboard") + + dashboard.section.header.val = { + " ", + " ", + " ", + " ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ", + " ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ", + " ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ", + " ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ", + " ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ", + " ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ ", + " ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ", + " ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ", + " ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ ", + " ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ", + " ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ", + } + + -- Set menu + dashboard.section.buttons.val = { + dashboard.button("e", " New file", ":ene startinsert "), + dashboard.button("r", " Recently used files", ":Telescope oldfiles"), + dashboard.button("f", " Find file", ":Telescope find_files"), + dashboard.button("t", " Find text", ":Telescope live_grep "), + dashboard.button("q", " Quit NVIM", ":qa"), + } + + -- Set footer + local handle = assert(io.popen('fortune -s')) + local fortune = handle:read("*all") + handle:close() + dashboard.section.footer.val = fortune + dashboard.section.header.opts.hl = "Title" + dashboard.section.buttons.opts.hl = "Debug" + dashboard.section.footer.opts.hl = "Conceal" + dashboard.config.opts.noautocmd = true + + -- vim.cmd[[autocmd User AlphaReady echo 'ready']] + + alpha.setup(dashboard.opts) + end }