new dashboard
This commit is contained in:
parent
4a0f230deb
commit
4dafd94d6f
2 changed files with 26 additions and 61 deletions
|
@ -130,4 +130,30 @@ return {
|
||||||
event = "BufReadPost",
|
event = "BufReadPost",
|
||||||
config = true,
|
config = true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"folke/snacks.nvim",
|
||||||
|
priority = 1000,
|
||||||
|
lazy = false,
|
||||||
|
opts = {
|
||||||
|
bigfile = { enabled = true },
|
||||||
|
-- notifier = { enabled = true },
|
||||||
|
quickfile = { enabled = true },
|
||||||
|
words = { enabled = true },
|
||||||
|
dashboard = {
|
||||||
|
sections = {
|
||||||
|
{
|
||||||
|
section = "terminal",
|
||||||
|
cmd = "chafa ~/i/piksela_arto/docks_1041uuu_Toyoi_Yuuta.gif --format symbols --symbols vhalf --size 60x17 --stretch; sleep .1",
|
||||||
|
height = 17,
|
||||||
|
padding = 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pane = 2,
|
||||||
|
{ section = "keys", gap = 1, padding = 1 },
|
||||||
|
{ section = "startup" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,65 +1,4 @@
|
||||||
return {
|
return {
|
||||||
{ -- dashboard
|
|
||||||
-- https://github.com/goolord/alpha-nvim/discussions/16
|
|
||||||
"goolord/alpha-nvim",
|
|
||||||
event = "VimEnter",
|
|
||||||
opts = function()
|
|
||||||
local dashboard = require("alpha.themes.dashboard")
|
|
||||||
local logo = [[
|
|
||||||
███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗
|
|
||||||
████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║
|
|
||||||
██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║
|
|
||||||
██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║
|
|
||||||
██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║
|
|
||||||
╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
|
|
||||||
]]
|
|
||||||
|
|
||||||
dashboard.section.header.val = vim.split(logo, "\n")
|
|
||||||
dashboard.section.buttons.val = {
|
|
||||||
dashboard.button("f", " " .. " Find file", "<CMD>Telescope find_files <CR>"),
|
|
||||||
dashboard.button("n", " " .. " New file", "<CMD>ene <BAR> startinsert <CR>"),
|
|
||||||
dashboard.button("r", " " .. " Recent files", "<CMD>Telescope oldfiles <CR>"),
|
|
||||||
dashboard.button("g", " " .. " Find text", "<CMD>Telescope live_grep <CR>"),
|
|
||||||
dashboard.button("l", " " .. " Lazy", "<CMD>Lazy<CR>"),
|
|
||||||
dashboard.button("q", " " .. " Quit", "<CMD>qa<CR>"),
|
|
||||||
}
|
|
||||||
for _, button in ipairs(dashboard.section.buttons.val) do
|
|
||||||
button.opts.hl = "AlphaButtons"
|
|
||||||
button.opts.hl_shortcut = "AlphaShortcut"
|
|
||||||
end
|
|
||||||
dashboard.section.footer.opts.hl = "Type"
|
|
||||||
dashboard.section.header.opts.hl = "AlphaHeader"
|
|
||||||
dashboard.section.buttons.opts.hl = "AlphaButtons"
|
|
||||||
dashboard.opts.layout[1].val = 8
|
|
||||||
return dashboard
|
|
||||||
end,
|
|
||||||
config = function(_, dashboard)
|
|
||||||
vim.b.miniindentscope_disable = true
|
|
||||||
|
|
||||||
-- close Lazy and re-open when the dashboard is ready
|
|
||||||
if vim.o.filetype == "lazy" then
|
|
||||||
vim.cmd.close()
|
|
||||||
vim.api.nvim_create_autocmd("User", {
|
|
||||||
pattern = "AlphaReady",
|
|
||||||
callback = function()
|
|
||||||
require("lazy").show()
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
require("alpha").setup(dashboard.opts)
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("User", {
|
|
||||||
pattern = "LazyVimStarted",
|
|
||||||
callback = function()
|
|
||||||
local stats = require("lazy").stats()
|
|
||||||
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
|
||||||
dashboard.section.footer.val = "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms"
|
|
||||||
pcall(vim.cmd.AlphaRedraw)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{ -- notification popups
|
{ -- notification popups
|
||||||
"https://github.com/rcarriga/nvim-notify",
|
"https://github.com/rcarriga/nvim-notify",
|
||||||
keys = {
|
keys = {
|
||||||
|
|
Loading…
Reference in a new issue