diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index 0e0f77d..5b30fc7 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -35,6 +35,7 @@ with final.pkgs.lib; let # UI mini-icons + dashboard-nvim bufferline-nvim ]; diff --git a/nvim/lua/icons.lua b/nvim/lua/icons.lua index 5c614c9..6376e54 100644 --- a/nvim/lua/icons.lua +++ b/nvim/lua/icons.lua @@ -5,4 +5,9 @@ return { Hint = ' ', Info = ' ', }, + dashboard = { + quit = '', + mru = '', + project = '', + }, } diff --git a/nvim/lua/plugins/ui/dashboard-nvim.lua b/nvim/lua/plugins/ui/dashboard-nvim.lua new file mode 100644 index 0000000..62508d4 --- /dev/null +++ b/nvim/lua/plugins/ui/dashboard-nvim.lua @@ -0,0 +1,60 @@ +return { + 'dashboard-nvim', + event = 'VimEnter', + before = function() + require('lz.n').trigger_load('mini.icons') + end, + after = function() + local icons = require('icons').dashboard + + local title = [[ + ███╗ ███╗ █████╗ ██████╗ ██╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ + ████╗ ████║██╔══██╗██╔══██╗██║ ██╔════╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ + ██╔████╔██║███████║██████╔╝██║ █████╗ ╚████╔╝ ██║ ██║██║██╔████╔██║ + ██║╚██╔╝██║██╔══██║██╔══██╗██║ ██╔══╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ + ██║ ╚═╝ ██║██║ ██║██║ ██║███████╗███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║ + ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ + ]] + + title = string.rep('\n', 8) .. title .. '\n\n' + + require('dashboard').setup({ + theme = 'hyper', + shortcut_type = 'number', + change_to_vcs_root = true, + hide = { + -- This is taken care of by Lualine. + statusline = false, + tabline = true, + }, + + config = { + header = vim.split(title, '\n'), + + shortcut = { + { + icon = icons.quit .. ' ', + desc = 'Quit', + key = 'q', + action = function() + vim.api.nvim_input('qa') + end, + }, + }, + + mru = { + enable = true, + limit = 5, + icon = icons.mru .. ' ', + label = 'Files', + }, + project = { + enable = true, + limit = 5, + icon = icons.project .. ' ', + label = 'Projects', + }, + }, + }) + end, +} diff --git a/nvim/lua/plugins/ui/init.lua b/nvim/lua/plugins/ui/init.lua index 6104e65..3427523 100644 --- a/nvim/lua/plugins/ui/init.lua +++ b/nvim/lua/plugins/ui/init.lua @@ -2,5 +2,6 @@ local req = require('lib.marleyvim').localRequire('plugins.ui') return { req('bufferline-nvim'), + req('dashboard-nvim'), req('mini-icons'), }