feat: change to lazyvim
This commit is contained in:
parent
defb419723
commit
3906d422e8
38 changed files with 892 additions and 1541 deletions
73
nvim/lua/plugins/dashboard.lua
Normal file
73
nvim/lua/plugins/dashboard.lua
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
return {
|
||||
{
|
||||
"goolord/alpha-nvim",
|
||||
event = "VimEnter",
|
||||
opts = function()
|
||||
local status_ok, alpha = pcall(require, "alpha")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
dashboard.section.header.val = {
|
||||
[[ _______ ___ _______. __ __ __ _______ ]],
|
||||
[[| \ / \ / || | | | | | | ____|]],
|
||||
[[| .--. | / ^ \ | (----`| |__| | | | | |__ ]],
|
||||
[[| | | | / /_\ \ \ \ | __ | | | | __| ]],
|
||||
[[| '--' | / _____ \ .----) | | | | | | | | |____ ]],
|
||||
[[|_______/ /__/ \__\ |_______/ |__| |__| |__| |_______|]],
|
||||
}
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("f", " Find file", ":lua require('telescope.builtin').find_files()<CR>"),
|
||||
dashboard.button(
|
||||
"b",
|
||||
" Open File Browser",
|
||||
":lua require('telescope').extensions.file_browser.file_browser{}<CR>"
|
||||
),
|
||||
dashboard.button("e", " New file", ":ene <BAR> startinsert <CR>"),
|
||||
dashboard.button("p", " Find project", ":lua require('telescope').extensions.project.project{}<CR>"),
|
||||
dashboard.button("r", " Recently used files", ":lua require('telescope.builtin').oldfiles() <CR>"),
|
||||
dashboard.button("t", " Zoxide", ":lua require('telescope').extensions.zoxide.list{}<CR>"),
|
||||
dashboard.button("c", " Configuration", ":e ~/.config/nvim/init.lua <CR>"),
|
||||
dashboard.button("q", " Quit Neovim", ":qa<CR>"),
|
||||
}
|
||||
|
||||
local function footer()
|
||||
return "dashie@dashie.org"
|
||||
end
|
||||
|
||||
dashboard.section.footer.val = footer()
|
||||
|
||||
dashboard.section.footer.opts.hl = "Type"
|
||||
dashboard.section.header.opts.hl = "Include"
|
||||
dashboard.section.buttons.opts.hl = "Keyword"
|
||||
|
||||
dashboard.opts.opts.noautocmd = true
|
||||
alpha.setup(dashboard.opts)
|
||||
end,
|
||||
config = function(_, dashboard)
|
||||
-- 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,
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue