From 9df3cc52e900cf88ab935a34646bd80718e64a96 Mon Sep 17 00:00:00 2001 From: rootiest Date: Sat, 14 Sep 2024 22:07:04 -0400 Subject: [PATCH] refactor: update dashboard header design to ASCII art logo --- lua/data/dash.lua | 35 ++++++++++++++++++++------------- lua/data/func.lua | 2 +- lua/plugins/dashboard/alpha.lua | 4 ++-- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/lua/data/dash.lua b/lua/data/dash.lua index ca32ae2..e034aae 100644 --- a/lua/data/dash.lua +++ b/lua/data/dash.lua @@ -11,16 +11,24 @@ local M = {} M.alpha = { opts = function() local dashboard = require("alpha.themes.dashboard") - local logo = [[ -██████╗ ██████╗ ██████╗ ████████╗██╗███████╗███████╗████████╗ ███╗ ██╗██╗ ██╗██╗███╗ ███╗ -██╔══██╗██╔═══██╗██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝╚══██╔══╝ ████╗ ██║██║ ██║██║████╗ ████║ -██████╔╝██║ ██║██║ ██║ ██║ ██║█████╗ ███████╗ ██║ ██╔██╗ ██║██║ ██║██║██╔████╔██║ -██╔══██╗██║ ██║██║ ██║ ██║ ██║██╔══╝ ╚════██║ ██║  ██║╚██╗██║╚██╗ ██╔╝██║██║╚██╔╝██║ -██║ ██║╚██████╔╝╚██████╔╝ ██║ ██║███████╗███████║ ██║ ██║ ╚████║ ╚████╔╝ ██║██║ ╚═╝ ██║ -╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═╝ ╚═╝ ╚═══╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ -]] - - dashboard.section.header.val = vim.split(logo, "\n") + local header = { + [[ ███ ███ ]], + [[ ████ ████ ]], + [[  ████ █████ ]], + [[ █ ████ █████ ]], + [[ ██ ████ █████ ]], + [[ ███ ████ █████ ]], + [[ ████ ████ ████ ]], + [[ █████ ████████ ]], + [[ █████ ███████ ]], + [[ █████ ██████ ]], + [[ █████ █████ ]], + [[ ████ ████ ]], + [[ ███ ███ ]], + [[ ]], + [[ N E O V I M ]], + } + dashboard.section.header.val = header -- stylua: ignore start dashboard.section.buttons.val = { ---@diagnostic disable: param-type-mismatch @@ -30,7 +38,7 @@ M.alpha = { dashboard.button("g", " " .. " Grep text", LazyVim.pick("live_grep")), dashboard.button("z", " " .. " LazyGit", "lua require('config.rootiest').toggle_lazygit_float() "), dashboard.button("c", " " .. " Config", LazyVim.pick.config_files()), - dashboard.button("s", " " .. " Restore Session", [[ lua require("persistence").load() ]]), + dashboard.button("s", "󰶮 " .. " Restore Session", [[ lua require("persistence").load() ]]), dashboard.button("S", " " .. " Remote Session", [[ lua require("config.rootiest").load_remote() ]]), dashboard.button("l", "󰒲 " .. " Lazy", " Lazy "), dashboard.button("q", " " .. " Quit", " qa "), @@ -40,8 +48,7 @@ M.alpha = { button.opts.hl = "AlphaButtons" button.opts.hl_shortcut = "AlphaShortcut" end - dashboard.section.header.opts.hl = "AlphaHeader" - dashboard.section.buttons.opts.hl = "AlphaButtons" + dashboard.section.header.opts.hl = "Conditional" dashboard.section.footer.opts.hl = "AlphaFooter" dashboard.opts.layout[1].val = 10 return dashboard @@ -89,7 +96,7 @@ M.dashboard_nvim = { { -- Restore Session action = 'lua require("persistence").load()', desc = " Restore Session", - icon = " ", + icon = "󰶮 ", key = "s", }, { -- Remote Session diff --git a/lua/data/func.lua b/lua/data/func.lua index 1578c59..26c9989 100644 --- a/lua/data/func.lua +++ b/lua/data/func.lua @@ -519,7 +519,7 @@ end ---@return nil function M.frecency_picker() -- Trigger the picker - require("telescope").extensions.frecency.frecency() + require("telescope").extensions.frecency.frecency({ workspace = "CWD" }) -- Remove `A` character that is added by the picker vim.api.nvim_feedkeys( vim.api.nvim_replace_termcodes("", true, true, true), diff --git a/lua/plugins/dashboard/alpha.lua b/lua/plugins/dashboard/alpha.lua index 7d2498d..3c08f4b 100644 --- a/lua/plugins/dashboard/alpha.lua +++ b/lua/plugins/dashboard/alpha.lua @@ -35,13 +35,13 @@ return { -- Alpha if pcall(require, "auto-cursorline") then require("auto-cursorline").disable({ buffer = true }) end - dashboard.section.footer.val = "⚡ Neovim loaded " + dashboard.section.footer.val = "󰇥 Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms - .. "ms" + .. "ms 󱐌" pcall(vim.cmd.AlphaRedraw) end, })