feat: add custom mini.starter sections

This commit is contained in:
Matej Janezic 2025-10-11 21:26:21 +02:00
parent 6dfaad2127
commit c3ae8bbe1e
Signed by: janezicmatej
GPG Key ID: 4298E230ED37B2C0
1 changed files with 28 additions and 7 deletions

View File

@ -1,7 +1,28 @@
MiniDeps.now(
function()
local function default_header()
local hour = tonumber(vim.fn.strftime("%H"))
local part_id = math.floor((hour + 4) / 8) + 1
local day_part = ({ "evening", "morning", "afternoon", "evening" })[part_id]
local username = vim.loop.os_get_passwd()["username"] or "USERNAME"
return ("good %s, %s"):format(day_part, username)
end
MiniDeps.now(function()
require("mini.starter").setup({
query_updaters = "abcdefghijklmnopqrstuvwxyz0123456789_.",
evaluate_single = true,
header = default_header,
footer = "",
items = {
--stylua: ignore start
-- builtins
{ name = "edit new buffer", action = "enew", section = "builtin actions" },
{ name = "quit neovim", action = "qall", section = "builtin actions" },
-- dependencies
{ name = "update dependencies", action = "DepsUpdate", section = "dependencies" },
{ name = "snap dependencies", action = "DepsSnapSave", section = "dependencies" },
{ name = "load dependencies", action = "DepsSnapLoad", section = "dependencies" },
--stylua: ignore end
},
})
end
)
end)