chezmoi.lua 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. return {
  2. {
  3. "alker0/chezmoi.vim",
  4. lazy = false,
  5. init = function()
  6. -- This option is required.
  7. vim.g["chezmoi#use_tmp_buffer"] = true
  8. -- add other options here if needed.
  9. end,
  10. },
  11. {
  12. "xvzc/chezmoi.nvim",
  13. dependencies = { "nvim-lua/plenary.nvim" },
  14. config = function()
  15. require("chezmoi").setup({
  16. -- your configurations
  17. edit = {
  18. watch = true, -- Set true to automatically apply on save.
  19. force = true, -- Set true to force apply. Works only when watch = true.
  20. },
  21. notification = {
  22. on_open = true, -- vim.notify when start editing chezmoi-managed file.
  23. on_apply = true, -- vim.notify on apply.
  24. },
  25. })
  26. vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
  27. pattern = { os.getenv("HOME") .. "/.local/share/chezmoi/*" },
  28. callback = function()
  29. -- invoke with vim.schedule() for better startup time
  30. vim.schedule(require("chezmoi.commands.__edit").watch)
  31. end,
  32. })
  33. end,
  34. },
  35. }