mirror of
https://github.com/Ascyii/nvim.git
synced 2026-01-01 04:04:24 -05:00
added a dashboard that is fully customizable
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
|
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
|
||||||
"aerial.nvim": { "branch": "master", "commit": "c7cbbad40c2065fccfd1f1863bb2c08180c0533d" },
|
"aerial.nvim": { "branch": "master", "commit": "c7cbbad40c2065fccfd1f1863bb2c08180c0533d" },
|
||||||
|
"alpha-nvim": { "branch": "main", "commit": "2b3cbcdd980cae1e022409289245053f62fb50f6" },
|
||||||
"barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" },
|
"barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" },
|
||||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" },
|
||||||
|
|||||||
41
lua/dashboard.lua
Normal file
41
lua/dashboard.lua
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
local alpha = require("alpha")
|
||||||
|
local dashboard = require("alpha.themes.dashboard")
|
||||||
|
|
||||||
|
dashboard.section.header.val = {
|
||||||
|
[[░█████╗░░██████╗░█████╗░██╗░░░██╗██╗██╗]],
|
||||||
|
[[██╔══██╗██╔════╝██╔══██╗╚██╗░██╔╝██║██║]],
|
||||||
|
[[███████║╚█████╗░██║░░╚═╝░╚████╔╝░██║██║]],
|
||||||
|
[[██╔══██║░╚═══██╗██║░░██╗░░╚██╔╝░░██║██║]],
|
||||||
|
[[██║░░██║██████╔╝╚█████╔╝░░░██║░░░██║██║]],
|
||||||
|
[[╚═╝░░╚═╝╚═════╝░░╚════╝░░░░╚═╝░░░╚═╝╚═╝]],
|
||||||
|
}
|
||||||
|
|
||||||
|
dashboard.section.buttons.val = {
|
||||||
|
dashboard.button("e", "New File", ":ene <BAR> startinsert <CR>"),
|
||||||
|
dashboard.button("r", "Recent Files", ":Telescope oldfiles<CR>"),
|
||||||
|
dashboard.button("c", "Config", ":e $MYVIMRC<CR>"),
|
||||||
|
dashboard.button("q", "Quit", ":qa<CR>"),
|
||||||
|
}
|
||||||
|
|
||||||
|
dashboard.section.footer.val = "Welcome to Neovim! Enjoy!"
|
||||||
|
|
||||||
|
dashboard.section.header.opts.hl = "include"
|
||||||
|
dashboard.section.buttons.opts.hl = "keyword"
|
||||||
|
dashboard.section.footer.opts.hl = "type"
|
||||||
|
|
||||||
|
local screen_height = vim.fn.winheight(0)
|
||||||
|
local content_height =
|
||||||
|
#dashboard.section.header.val +
|
||||||
|
#dashboard.section.buttons.val +
|
||||||
|
#dashboard.section.footer.val
|
||||||
|
|
||||||
|
dashboard.opts.layout = {
|
||||||
|
{ type = "padding", val = math.floor((screen_height - content_height) / 2) },
|
||||||
|
dashboard.section.header,
|
||||||
|
{ type = "padding", val = 2 },
|
||||||
|
dashboard.section.buttons,
|
||||||
|
{ type = "padding", val = 1 },
|
||||||
|
dashboard.section.footer,
|
||||||
|
}
|
||||||
|
|
||||||
|
alpha.setup(dashboard.opts)
|
||||||
@@ -60,4 +60,12 @@ return {
|
|||||||
vim.keymap.set("n", "<leader>bd", ":BufferDelete<CR>")
|
vim.keymap.set("n", "<leader>bd", ":BufferDelete<CR>")
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"goolord/alpha-nvim",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
config = function()
|
||||||
|
require("dashboard")
|
||||||
|
end
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user