xvzc / chezmoi.nvim

Chezmoi plugin for neovim
MIT License
73 stars 3 forks source link

Question about `--watch` #13

Closed jpwallace22 closed 2 months ago

jpwallace22 commented 2 months ago

I'm not 100% sure about the use of the --watch flag either in the config:

{
  edit = {
    watch = false, -- Not sure what this does if `true`
    force = false,
  },
  notification = {
    on_open = true,
    on_apply = true,
    on_watch = false,
  },
  telescope = {
    select = { "<CR>" },
  },
}

Or when utilizing chezmoi.commands as seen here:

require("chezmoi.commands").edit({
    targets = { "~/.zshrc" },
    args = { "--watch" } -- Not sure what this is supposed to do in this context either
})

To my knowledge, the --watch flag isn't a native chezmoi feature and I'm slightly confused about what it does in this plugin. I might be missing something obvious so any info would help. Thanks a bunch!

xvzc commented 2 months ago

When you start editing files via chezmoi.nvim's edit command, it allows you to automatically apply the changes on save.

jpwallace22 commented 2 months ago

When you start editing files via chezmoi.nvim's edit command, it allows you to automatically apply the changes on save.

ahhh, yup. I guess I could have just ran chezmoi edit --help. I didn't realize there was a --watch, I was only aware of --apply. Thank you.