Add chezmoi.vim

This commit is contained in:
Maximilian Friedersdorff 2025-10-01 09:12:55 +01:00
parent f5ed7c0343
commit 662418b0b9

View file

@ -3,35 +3,45 @@ local pick_chezmoi = function()
end
return {
"xvzc/chezmoi.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
keys = {
{
"<leader>sz",
pick_chezmoi,
desc = "Chezmoi",
},
{
-- highlighting for chezmoi files template files
"alker0/chezmoi.vim",
init = function()
vim.g["chezmoi#use_tmp_buffer"] = 1
vim.g["chezmoi#source_dir_path"] = os.getenv("HOME") .. "/.local/share/chezmoi"
end,
},
opts = {
edit = {
watch = false,
force = false,
{
"xvzc/chezmoi.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
keys = {
{
"<leader>sz",
pick_chezmoi,
desc = "Chezmoi",
},
},
notification = {
on_open = true,
on_apply = true,
on_watch = false,
},
telescope = {
select = { "<CR>" },
opts = {
edit = {
watch = false,
force = false,
},
notification = {
on_open = true,
on_apply = true,
on_watch = false,
},
telescope = {
select = { "<CR>" },
},
},
init = function()
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
pattern = { os.getenv("HOME") .. "/.local/share/chezmoi/*" },
callback = function()
vim.schedule(require("chezmoi.commands.__edit").watch)
end,
})
end,
},
init = function()
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
pattern = { os.getenv("HOME") .. "/.local/share/chezmoi/*" },
callback = function()
vim.schedule(require("chezmoi.commands.__edit").watch)
end,
})
end,
}