From 4dafd94d6fd7fd94dcc696ad95169031389d2816 Mon Sep 17 00:00:00 2001 From: zymon Date: Sun, 8 Dec 2024 18:20:26 +0100 Subject: [PATCH] new dashboard --- lua/znvim/plugins/init.lua | 26 ++++++++++++++++ lua/znvim/plugins/ui.lua | 61 -------------------------------------- 2 files changed, 26 insertions(+), 61 deletions(-) diff --git a/lua/znvim/plugins/init.lua b/lua/znvim/plugins/init.lua index 2e6a2de..c8a4509 100644 --- a/lua/znvim/plugins/init.lua +++ b/lua/znvim/plugins/init.lua @@ -130,4 +130,30 @@ return { event = "BufReadPost", config = true, }, + { + "folke/snacks.nvim", + priority = 1000, + lazy = false, + opts = { + bigfile = { enabled = true }, + -- notifier = { enabled = true }, + quickfile = { enabled = true }, + words = { enabled = true }, + dashboard = { + sections = { + { + section = "terminal", + cmd = "chafa ~/i/piksela_arto/docks_1041uuu_Toyoi_Yuuta.gif --format symbols --symbols vhalf --size 60x17 --stretch; sleep .1", + height = 17, + padding = 1, + }, + { + pane = 2, + { section = "keys", gap = 1, padding = 1 }, + { section = "startup" }, + }, + }, + }, + }, + }, } diff --git a/lua/znvim/plugins/ui.lua b/lua/znvim/plugins/ui.lua index dcafd0d..6f2b3df 100644 --- a/lua/znvim/plugins/ui.lua +++ b/lua/znvim/plugins/ui.lua @@ -1,65 +1,4 @@ return { - { -- dashboard - -- https://github.com/goolord/alpha-nvim/discussions/16 - "goolord/alpha-nvim", - event = "VimEnter", - opts = function() - local dashboard = require("alpha.themes.dashboard") - local logo = [[ -███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ -████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ -██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ -██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ -██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ -╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ - ]] - - dashboard.section.header.val = vim.split(logo, "\n") - dashboard.section.buttons.val = { - dashboard.button("f", " " .. " Find file", "Telescope find_files "), - dashboard.button("n", " " .. " New file", "ene startinsert "), - dashboard.button("r", "󱞭 " .. " Recent files", "Telescope oldfiles "), - dashboard.button("g", " " .. " Find text", "Telescope live_grep "), - dashboard.button("l", " " .. " Lazy", "Lazy"), - dashboard.button("q", " " .. " Quit", "qa"), - } - for _, button in ipairs(dashboard.section.buttons.val) do - button.opts.hl = "AlphaButtons" - button.opts.hl_shortcut = "AlphaShortcut" - end - dashboard.section.footer.opts.hl = "Type" - dashboard.section.header.opts.hl = "AlphaHeader" - dashboard.section.buttons.opts.hl = "AlphaButtons" - dashboard.opts.layout[1].val = 8 - return dashboard - end, - config = function(_, dashboard) - vim.b.miniindentscope_disable = true - - -- close Lazy and re-open when the dashboard is ready - if vim.o.filetype == "lazy" then - vim.cmd.close() - vim.api.nvim_create_autocmd("User", { - pattern = "AlphaReady", - callback = function() - require("lazy").show() - end, - }) - end - - require("alpha").setup(dashboard.opts) - - vim.api.nvim_create_autocmd("User", { - pattern = "LazyVimStarted", - callback = function() - local stats = require("lazy").stats() - local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) - dashboard.section.footer.val = "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms" - pcall(vim.cmd.AlphaRedraw) - end, - }) - end, - }, { -- notification popups "https://github.com/rcarriga/nvim-notify", keys = {