2023-01-08 15:37:55 +01:00
-- start screen
return {
-- disable alpha
{ " goolord/alpha-nvim " , enabled = false } ,
2023-10-14 13:21:30 +02:00
{ " nvimdev/dashboard-nvim " , enabled = false } ,
2023-01-08 15:37:55 +01:00
-- enable mini.starter
{
" echasnovski/mini.starter " ,
version = false , -- wait till new 0.7.0 release to put it back on semver
event = " VimEnter " ,
opts = function ( )
local logo = table.concat ( {
2023-05-28 00:41:58 -07:00
" ██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z " ,
" ██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z " ,
" ██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z " ,
" ██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z " ,
" ███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║ " ,
" ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ " ,
2023-01-08 15:37:55 +01:00
} , " \n " )
local pad = string.rep ( " " , 22 )
local new_section = function ( name , action , section )
return { name = name , action = action , section = pad .. section }
end
local starter = require ( " mini.starter " )
--stylua: ignore
local config = {
evaluate_single = true ,
header = logo ,
items = {
2023-10-15 09:16:52 +02:00
new_section ( " Find file " , " Telescope find_files " , " Telescope " ) ,
new_section ( " Recent files " , " Telescope oldfiles " , " Telescope " ) ,
new_section ( " Grep text " , " Telescope live_grep " , " Telescope " ) ,
new_section ( " Config " , " lua require('lazyvim.util').telescope.config_files()() " , " Config " ) ,
new_section ( " Extras " , " LazyExtras " , " Config " ) ,
new_section ( " Lazy " , " Lazy " , " Config " ) ,
new_section ( " New file " , " ene | startinsert " , " Built-in " ) ,
new_section ( " Quit " , " qa " , " Built-in " ) ,
new_section ( " Session restore " , [[lua require("persistence").load()]] , " Session " ) ,
2023-01-08 15:37:55 +01:00
} ,
content_hooks = {
starter.gen_hook . adding_bullet ( pad .. " ░ " , false ) ,
starter.gen_hook . aligning ( " center " , " center " ) ,
} ,
}
return config
end ,
config = function ( _ , config )
-- close Lazy and re-open when starter is ready
if vim.o . filetype == " lazy " then
vim.cmd . close ( )
vim.api . nvim_create_autocmd ( " User " , {
pattern = " MiniStarterOpened " ,
callback = function ( )
require ( " lazy " ) . show ( )
end ,
} )
end
local starter = require ( " mini.starter " )
starter.setup ( config )
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 )
local pad_footer = string.rep ( " " , 8 )
starter.config . footer = pad_footer .. " ⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. " ms "
2024-05-18 11:07:33 +03:00
-- INFO: Use `VimResized` to avoid the `buf_id in refresh() is not an identifier of valid Starter buffer`,
-- since `starter.refresh` executes on every `VimResized` see https://github.com/echasnovski/mini.starter/blob/f0c491032dcda485ee740716217cd4d5c25b6014/lua/mini/starter.lua#L352-L353
vim.cmd ( [[do VimResized]] )
2023-01-08 15:37:55 +01:00
end ,
} )
end ,
} ,
}