From 5a96ea38d74505c7ca409bae9fa1a43a689d0627 Mon Sep 17 00:00:00 2001 From: Michael Peters Date: Mon, 3 Oct 2022 09:39:31 -0700 Subject: [PATCH] add dashboard via alpha --- lua/configs/alpha.lua | 24 ++++++++++++++++++++++++ lua/plugins.lua | 7 +++++++ 2 files changed, 31 insertions(+) create mode 100644 lua/configs/alpha.lua diff --git a/lua/configs/alpha.lua b/lua/configs/alpha.lua new file mode 100644 index 0000000..ea7390c --- /dev/null +++ b/lua/configs/alpha.lua @@ -0,0 +1,24 @@ +local M = {} + +function M.config() + local status_ok, alpha = pcall(require, "alpha") + if not status_ok then + return + end + + local dashboard = require'alpha.themes.dashboard' + + dashboard.section.header.val = { "NeoVim", } + dashboard.section.buttons.val = { + dashboard.button("f", "Find File", ":Telescope find_files"), + dashboard.button("w", "Find Word", ":Telescope live_grep"), + dashboard.button("o", "Recent Files", ":Telescope oldfiles"), + dashboard.button("e", "Open Tree", ":NvimTreeToggle"), + dashboard.button("q", "Quit", ":qa"), + } + + alpha.setup(dashboard.config) +end + +return M + diff --git a/lua/plugins.lua b/lua/plugins.lua index c95a15b..498840e 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -148,6 +148,13 @@ packer.startup { -- Quality of Life -- + -- Dashboard + use { + 'goolord/alpha-nvim', + requires = { 'kyazdani42/nvim-web-devicons' }, + config = function() require'configs.alpha'.config() end + } + -- Autopairs use { 'windwp/nvim-autopairs', config = function() require'configs.autopairs'.config() end }