From ff84e8900bad45c8d923c85e9b1f9a748e8d8553 Mon Sep 17 00:00:00 2001 From: Thomas Vandal Date: Sun, 29 Dec 2024 22:02:05 -0500 Subject: [PATCH] Use chezmoi for Config entry in snacks dashboard --- lua/lazyvim/plugins/extras/util/chezmoi.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lua/lazyvim/plugins/extras/util/chezmoi.lua b/lua/lazyvim/plugins/extras/util/chezmoi.lua index afaef6e4..8513f4c6 100644 --- a/lua/lazyvim/plugins/extras/util/chezmoi.lua +++ b/lua/lazyvim/plugins/extras/util/chezmoi.lua @@ -110,6 +110,27 @@ return { table.insert(opts.config.center, 5, projects) 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 {