Skip to content

Commit 4044be5

Browse files
committed
feat(starter): add plugin actions & more tweaks
1 parent 3b54578 commit 4044be5

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

lua/custom/plugins/mini/starter.lua

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,21 @@ local top3 = function()
33

44
local command = 'git shortlog -ns --since "1 year" | head -n 3'
55
local handle = io.popen(command)
6-
local shortlog = handle:read '*a' or 'not a git directory'
6+
7+
---@cast handle -nil
8+
local shortlog = handle:read '*a'
79
handle:close()
810

911
return table.concat({ label, shortlog }, '\n')
1012
end
1113

14+
local plugin_actions = {
15+
{ name = 'Kickstart', action = 'e ~/.config/nvim/init.lua', section = 'Plugin actions' },
16+
{ name = 'Lazy', action = 'Lazy', section = 'Plugin actions' },
17+
{ name = 'Mason', action = 'Mason', section = 'Plugin actions' },
18+
{ name = 'Health', action = 'checkhealth', section = 'Plugin actions' },
19+
}
20+
1221
local starter = require 'mini.starter'
1322

1423
vim.keymap.set('n', '_', starter.open)
@@ -18,14 +27,15 @@ return {
1827
evaluate_single = true,
1928
header = top3,
2029
items = {
21-
starter.sections.recent_files(8, true),
22-
starter.sections.recent_files(8, false),
30+
starter.sections.recent_files(5, true),
31+
starter.sections.recent_files(5, false),
2332
starter.sections.telescope(),
33+
plugin_actions,
2434
starter.sections.builtin_actions(),
2535
},
2636
content_hooks = {
2737
starter.gen_hook.adding_bullet(),
28-
starter.gen_hook.indexing('all', { 'Builtin actions', 'Telescope' }),
38+
starter.gen_hook.indexing('all', { 'Builtin actions', 'Plugin actions', 'Telescope' }),
2939
starter.gen_hook.aligning('center', 'center'),
3040
},
3141
query_updaters = 'abcdefghijklmnopqrstuvwxyz0123456789',

0 commit comments

Comments
 (0)