---@module "data.dash" --- This module contains the data for the dashboard plugins. -- ╭─────────────────────────────────────────────────────────╮ -- │ DASH DATA │ -- ╰─────────────────────────────────────────────────────────╯ local M = {} --- Function to setup the Alpha dashboard options ---@return table The alpha dashboard options M.alpha = { opts = function() local dashboard = require("alpha.themes.dashboard") 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 dashboard.button("f", " " .. " Find file", LazyVim.pick("find_files")), dashboard.button("n", " " .. " New file", [[ ene startinsert ]]), dashboard.button("r", " " .. " Recent files", LazyVim.pick("oldfiles")), 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", " " .. " Remote Session", [[ lua require("config.rootiest").load_remote() ]]), dashboard.button("l", "󰒲 " .. " Lazy", " Lazy "), dashboard.button("q", " " .. " Quit", " qa "), } -- stylua: ignore end for _, button in ipairs(dashboard.section.buttons.val) do button.opts.hl = "AlphaButtons" button.opts.hl_shortcut = "AlphaShortcut" end dashboard.section.header.opts.hl = "Conditional" dashboard.section.footer.opts.hl = "AlphaFooter" local padding = vim.fn.max({ 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) }) if vim.fn.winheight(0) < 40 then padding = 1 elseif vim.fn.winheight(0) < 30 then padding = 0 end dashboard.opts.layout[1].val = padding return dashboard end, } M.dashboard_nvim = { choices = { { -- Find File action = 'lua LazyVim.pick("find_files")()', desc = " Find File", icon = " ", key = "f", }, { -- New File action = "ene | startinsert", desc = " New File", icon = " ", key = "n", }, { -- Open Recent Files action = 'lua LazyVim.pick("oldfiles")()', desc = " Recent Files", icon = " ", key = "r", }, { -- Find Text action = 'lua LazyVim.pick("live_grep")()', desc = " Find Text", icon = " ", key = "g", }, { -- LazyGit action = "LazyGit", desc = " LazyGit", icon = " ", key = "z", }, { -- Config action = "lua LazyVim.pick.config_files()()", desc = " Config", icon = " ", key = "c", }, { -- Restore Session action = 'lua require("persistence").load()', desc = " Restore Session", icon = "󰶮 ", key = "s", }, { -- Remote Session action = 'lua require("config.rootiest").load_remote()', desc = " Remote Session", icon = " ", key = "s", }, { -- Lazy action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l", }, { -- Quit action = function() vim.api.nvim_input("qa") end, desc = " Quit", icon = " ", key = "q", }, }, } return M