Add chezmoi config
This commit is contained in:
parent
2b3b891962
commit
3f3d6a23d5
1 changed files with 37 additions and 0 deletions
37
home/dot_config/nvim/lua/custom/plugins/chezmoi.lua
Normal file
37
home/dot_config/nvim/lua/custom/plugins/chezmoi.lua
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
local pick_chezmoi = function()
|
||||||
|
require("telescope").extensions.chezmoi.find_files()
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
"xvzc/chezmoi.nvim",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>sz",
|
||||||
|
pick_chezmoi,
|
||||||
|
desc = "Chezmoi",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
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,
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue