1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

remove alpha-nvim, use dashboard-nvim

This commit is contained in:
jdhao 2022-08-07 00:01:23 +08:00
parent 3de31f7d0a
commit 8291b15599
3 changed files with 66 additions and 33 deletions

View File

@ -1,32 +0,0 @@
local alpha = require("alpha")
local dashboard = require("alpha.themes.dashboard")
-- Set header
dashboard.section.header.val = {
" ",
" ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ",
" ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ",
" ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ",
" ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ",
" ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
" ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
" ",
}
-- Set menu
dashboard.section.buttons.val = {
dashboard.button( "Leader f f", " > Find file", ":Leaderf file --popup<CR>"),
dashboard.button( "Leader f r", " > Recent files" , ":Leaderf mru --popup<CR>"),
dashboard.button( "Leader f g", " > Project grep" , ":Leaderf rg --popup<CR>"),
dashboard.button( "u", " > Update plugins" , ":PackerSync<CR>"),
dashboard.button( "e", " > New file" , ":enew <CR>"),
dashboard.button( "q", " > Quit NVIM", ":qa<CR>"),
}
local fortune = require("alpha.fortune")
dashboard.section.footer.val = fortune()
alpha.setup(dashboard.opts)
-- Send config to alpha
alpha.setup(dashboard.opts)

View File

@ -0,0 +1,65 @@
local dashboard = require("dashboard")
dashboard.custom_header = {
" ",
" ",
" ",
" ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗",
" ████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║",
" ██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║",
" ██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║",
" ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║",
" ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝",
" ",
" ",
" ",
" ",
}
dashboard.custom_center = {
{
icon = "",
desc = "Find File ",
action = "Leaderf file --popup",
shortcut = "<Leader> f f",
},
{
icon = "",
desc = "Recently opened files ",
action = "Leaderf mru --popup",
shortcut = "<Leader> f r",
},
{
icon = "",
desc = "Project grep ",
action = "Leaderf rg --popup",
shortcut = "<Leader> f g",
},
{
icon = "",
desc = "Open Nvim config ",
action = "tabnew $MYVIMRC | tcd %:p:h",
shortcut = "<Leader> e v",
},
{
icon = "",
desc = "New file ",
action = "enew",
shortcut = "e ",
},
{
icon = "",
desc = "Quit Nvim ",
-- desc = "Quit Nvim ",
action = "qa",
shortcut = "q "
}
}
vim.cmd([[
augroup dashboard_enter
au!
autocmd FileType dashboard nnoremap q :qa<CR>
autocmd FileType dashboard nnoremap e :enew<CR>
augroup END
]])

View File

@ -139,7 +139,7 @@ packer.startup({
use({ "akinsho/bufferline.nvim", event = "VimEnter", config = [[require('config.bufferline')]] })
-- fancy start screen
-- use { 'goolord/alpha-nvim', event = 'VimEnter', config = [[require('config.alpha-nvim')]] }
use { 'glepnir/dashboard-nvim', config = [[require('config.dashboard-nvim')]] }
use({
"lukas-reineke/indent-blankline.nvim",