feat: add custom mini.starter sections
This commit is contained in:
parent
6dfaad2127
commit
c3ae8bbe1e
|
@ -1,7 +1,28 @@
|
|||
MiniDeps.now(
|
||||
function()
|
||||
require("mini.starter").setup({
|
||||
query_updaters = "abcdefghijklmnopqrstuvwxyz0123456789_.",
|
||||
})
|
||||
end
|
||||
)
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue