feat: Switch to alpha.nvim

This commit is contained in:
punkfairie 2024-11-30 11:08:42 -08:00
parent bb0181bd7a
commit 45793e10ff
Signed by: punkfairie
GPG key ID: A509E8F77FB9D696
6 changed files with 67 additions and 62 deletions

View file

@ -33,9 +33,12 @@ with final.pkgs.lib; let
lz-n lz-n
snacks-nvim snacks-nvim
# Util
plenary-nvim
# UI # UI
mini-icons mini-icons
dashboard-nvim alpha-nvim
bufferline-nvim bufferline-nvim
]; ];

View file

@ -0,0 +1,53 @@
return {
'alpha-nvim',
before = function()
require('lz.n').trigger_load('plenary.nvim')
require('lz.n').trigger_load('mini.icons')
end,
after = function()
local theta = require('alpha.themes.theta')
local header = [[
]]
theta.header.val = vim.split(header, '\n')
local button = require('alpha.themes.dashboard').button
theta.buttons.val = {
{
type = 'text',
val = 'Shortcuts',
opts = { hl = 'SpecialComment', position = 'center' },
},
{ type = 'padding', val = 1 },
button(
'f',
'󰈞 Find file',
'<CMD>lua require("telescope").builtin.fd()<CR>'
),
button(
'g',
' Live grep',
'<CMD>lua require("telescope").builtin.live_grep()<CR>'
),
button(
's',
' Restore session',
'<CMD>lua require("persistence").load()<CR>'
),
button('q', ' Quit', '<CMD>qa<CR>'),
}
require('alpha').setup(theta.config)
end,
}

View file

@ -1,60 +0,0 @@
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('<CMD>qa<CR>')
end,
},
},
mru = {
enable = true,
limit = 5,
icon = icons.mru .. ' ',
label = 'Files',
},
project = {
enable = true,
limit = 5,
icon = icons.project .. ' ',
label = 'Projects',
},
},
})
end,
}

View file

@ -1,7 +1,7 @@
local req = require('lib.marleyvim').localRequire('plugins.ui') local req = require('lib.marleyvim').localRequire('plugins.ui')
return { return {
req('alpha-nvim'),
req('bufferline-nvim'), req('bufferline-nvim'),
req('dashboard-nvim'),
req('mini-icons'), req('mini-icons'),
} }

View file

@ -0,0 +1,5 @@
local req = require('lib.marleyvim').localRequire('plugins.util')
return {
req('plenary'),
}

View file

@ -0,0 +1,4 @@
return {
'plenary.nvim',
lazy = true,
}