diff options
| author | Crony Akatsuki <crony@cronyakatsuki.xyz> | 2026-01-01 13:55:19 +0100 |
|---|---|---|
| committer | Crony Akatsuki <crony@cronyakatsuki.xyz> | 2026-01-01 13:55:19 +0100 |
| commit | 494ddcf9850a9e425c6c15396a5b322001d3f83c (patch) | |
| tree | 2bad558af86f20de3d836a3db57bb31ce60252c3 /lua/plugins/mini/starter.lua | |
| parent | 8d49f9b18dddcd2d4fa966227db70fb2c710e383 (diff) | |
| download | nvim-494ddcf9850a9e425c6c15396a5b322001d3f83c.zip nvim-494ddcf9850a9e425c6c15396a5b322001d3f83c.tar.gz | |
feat(mini): modularize the config a bit.
Diffstat (limited to 'lua/plugins/mini/starter.lua')
| -rw-r--r-- | lua/plugins/mini/starter.lua | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/lua/plugins/mini/starter.lua b/lua/plugins/mini/starter.lua new file mode 100644 index 0000000..782eddf --- /dev/null +++ b/lua/plugins/mini/starter.lua @@ -0,0 +1,38 @@ +-- minimal session manager +require("mini.sessions").setup() + +vim.keymap.set("n", "<Leader>sc", function() MiniSessions.write() end, { desc = "Create new session/project" }) +vim.keymap.set("n", "<Leader>ss", function() MiniSessions.select("read") end, { desc = "Select session/project" }) + +-- nice file/directory visit tracker +require("mini.visits").setup() + +-- setup some basic label keybindings +local map_vis = function(keys, call, desc) + local rhs = '<Cmd>lua MiniVisits.' .. call .. '<CR>' + vim.keymap.set('n', '<Leader>' .. keys, rhs, { desc = desc }) +end + +map_vis('vv', 'add_label()', 'Add label') +map_vis('vV', 'remove_label()', 'Remove label') +map_vis('vc', 'add_label("core")', 'Add to core') +map_vis('vC', 'remove_label("core")', 'Remove from core') +vim.keymap.set("n", "<Leader>fv", ":Pick visit_paths<CR>", { desc = "Search visited files" }) +vim.keymap.set("n", "<Leader>fc", ":Pick visit_paths filter='core'<CR>", + { desc = "Search visited files with tag 'core'" }) + +-- simple startup startup screen +local starter = require('mini.starter') +starter.setup({ + evaluate_single = true, + items = { + starter.sections.builtin_actions(), + starter.sections.sessions(5, true), + starter.sections.recent_files(5, true), + starter.sections.recent_files(5, false), + }, + content_hooks = { + starter.gen_hook.adding_bullet(), + starter.gen_hook.aligning("center", "center") + }, +}) |
