Use chezmoi for Config entry in snacks dashboard

This commit is contained in:
Thomas Vandal 2024-12-29 22:02:05 -05:00
parent 692bd4a00e
commit ff84e8900b

View file

@ -110,6 +110,27 @@ return {
table.insert(opts.config.center, 5, projects) table.insert(opts.config.center, 5, projects)
end, end,
}, },
{
"folke/snacks.nvim",
optional = true,
opts = function(_, opts)
local chezmoi_entry = {
icon = "",
key = "c",
desc = "Config",
action = pick_chezmoi,
}
local config_index
for i = #opts.dashboard.preset.keys, 1, -1 do
if opts.dashboard.preset.keys[i].key == "c" then
table.remove(opts.dashboard.preset.keys, i)
config_index = i
break
end
end
table.insert(opts.dashboard.preset.keys, config_index, chezmoi_entry)
end,
},
-- Filetype icons -- Filetype icons
{ {