From 7908f337e3c69c5aad053bd4267a93f1dae265e8 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Thu, 13 Jun 2024 01:23:24 +0200 Subject: [PATCH] feat(nvim/alpha): update dashboard to match lazyvim mostly --- pkgs/nvim/config/ui/alpha.nix | 241 +++++++++++++++------------------- 1 file changed, 106 insertions(+), 135 deletions(-) diff --git a/pkgs/nvim/config/ui/alpha.nix b/pkgs/nvim/config/ui/alpha.nix index 69658ae..a024e55 100644 --- a/pkgs/nvim/config/ui/alpha.nix +++ b/pkgs/nvim/config/ui/alpha.nix @@ -8,183 +8,154 @@ type = "padding"; inherit val; }; + shortcutOpts = { + position = "center"; + cursor = 3; + width = 50; + align_shortcut = "right"; + }; in [ - (padding 4) + (padding 8) { opts = { - hl = "AlphaHeader"; + hl = "Structure"; position = "center"; }; type = "text"; val = [ - " ██▀███ ▓█████ ▓█████▄▓██ ██▓ █████▒ " - " ▓██ ▒ ██▒▓█ ▀ ▒██▀ ██▌▒██ ██▒▓██ ▒ " - " ▓██ ░▄█ ▒▒███ ░██ █▌ ▒██ ██░▒████ ░ " - " ▒██▀▀█▄ ▒▓█ ▄ ░▓█▄ ▌ ░ ▐██▓░░▓█▒ ░ " - " ░██▓ ▒██▒░▒████▒░▒████▓ ░ ██▒▓░░▒█░ " - " ░ ▒▓ ░▒▓░░░ ▒░ ░ ▒▒▓ ▒ ██▒▒▒ ▒ ░ " - " ░▒ ░ ▒░ ░ ░ ░ ░ ▒ ▒ ▓██ ░▒░ ░ " - " ░░ ░ ░ ░ ░ ░ ▒ ▒ ░░ ░ ░ " - " ░ ░ ░ ░ ░ ░ " - " " - " git@github.com:redyf " + "███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗" + "████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║" + "██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║" + "██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║" + "██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║" + "╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝" ]; } - (padding 2) + (padding 3) { type = "button"; val = " Find File"; on_press.raw = "require('telescope.builtin').find_files"; - opts = { - # hl = "comment"; - keymap = [ - "n" - "f" - ":Telescope find_files " - { - noremap = true; - silent = true; - nowait = true; - } - ]; - shortcut = "f"; - - position = "center"; - cursor = 3; - width = 38; - align_shortcut = "right"; - hl_shortcut = "Keyword"; - }; + opts = + shortcutOpts + // { + keymap = [ + "n" + "f" + ":Telescope find_files " + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "f"; + }; } (padding 1) { type = "button"; val = " New File"; on_press.__raw = "function() vim.cmd[[ene]] end"; - opts = { - # hl = "comment"; - keymap = [ - "n" - "n" - ":ene startinsert " - { - noremap = true; - silent = true; - nowait = true; - } - ]; - shortcut = "n"; - - position = "center"; - cursor = 3; - width = 38; - align_shortcut = "right"; - hl_shortcut = "Keyword"; - }; + opts = + shortcutOpts + // { + keymap = [ + "n" + "n" + ":ene startinsert " + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "n"; + }; } (padding 1) { type = "button"; val = "󰈚 Recent Files"; on_press.raw = "require('telescope.builtin').oldfiles"; - opts = { - # hl = "comment"; - keymap = [ - "n" - "r" - ":Telescope oldfiles " - { - noremap = true; - silent = true; - nowait = true; - } - ]; - shortcut = "r"; - - position = "center"; - cursor = 3; - width = 38; - align_shortcut = "right"; - hl_shortcut = "Keyword"; - }; + opts = + shortcutOpts + // { + keymap = [ + "n" + "r" + ":Telescope oldfiles " + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "r"; + }; } (padding 1) { type = "button"; val = "󰈭 Find Word"; on_press.raw = "require('telescope.builtin').live_grep"; - opts = { - # hl = "comment"; - keymap = [ - "n" - "g" - ":Telescope live_grep " - { - noremap = true; - silent = true; - nowait = true; - } - ]; - shortcut = "g"; - - position = "center"; - cursor = 3; - width = 38; - align_shortcut = "right"; - hl_shortcut = "Keyword"; - }; + opts = + shortcutOpts + // { + keymap = [ + "n" + "g" + ":Telescope live_grep " + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "g"; + }; } (padding 1) { type = "button"; val = " Restore Session"; on_press.raw = "require('persistence').load()"; - opts = { - # hl = "comment"; - keymap = [ - "n" - "s" - ":lua require('persistence').load()" - { - noremap = true; - silent = true; - nowait = true; - } - ]; - shortcut = "s"; - - position = "center"; - cursor = 3; - width = 38; - align_shortcut = "right"; - hl_shortcut = "Keyword"; - }; + opts = + shortcutOpts + // { + keymap = [ + "n" + "s" + ":lua require('persistence').load()" + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "s"; + }; } (padding 1) { type = "button"; - val = " Quit Neovim"; + val = " Quit"; on_press.__raw = "function() vim.cmd[[qa]] end"; - opts = { - # hl = "comment"; - keymap = [ - "n" - "q" - ":qa" - { - noremap = true; - silent = true; - nowait = true; - } - ]; - shortcut = "q"; - - position = "center"; - cursor = 3; - width = 38; - align_shortcut = "right"; - hl_shortcut = "Keyword"; - }; + opts = + shortcutOpts + // { + keymap = [ + "n" + "q" + ":qa" + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "q"; + }; } ]; };