mirror of
https://github.com/marianozunino/nvim.git
synced 2025-06-28 18:43:50 -03:00
chore: move chezmoi autocmd to the plugin file
This commit is contained in:
parent
b265dacc53
commit
72f903d231
3 changed files with 14 additions and 14 deletions
|
@ -23,6 +23,7 @@ return {
|
|||
on_apply = true, -- vim.notify on apply.
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
|
||||
pattern = { os.getenv("HOME") .. "/.local/share/chezmoi/*" },
|
||||
callback = function()
|
||||
|
@ -30,6 +31,12 @@ return {
|
|||
vim.schedule(require("chezmoi.commands.__edit").watch)
|
||||
end,
|
||||
})
|
||||
|
||||
-- Auto-apply chezmoi changes
|
||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
pattern = { os.getenv("HOME") .. "/.local/share/chezmoi/*" },
|
||||
command = [[silent! !chezmoi apply --source-path "%"]],
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue