Difference between nvim-chezmoi and xvzc/chezmoi.nvim? #24
|
Hello, |
Replies: 2 comments 2 replies
|
Hello! First of all, sorry for the delay in responding. As for the differences, the main one is that my plugin tries to detect and apply the original filetype from the target path to the source file being edited. This allows things like LSP, syntax highlighting, completions, and Tree-sitter parsers to work on the source file just as they do for the target file. For example, the filetype for ".bashrc" in my Neovim config is "sh". However, when added to chezmoi as a template, the source file is named "dot_bashrc.tmpl", and Neovim detects it as a template filetype. However, if you use nvim-chezmoi: This detection happens automatically whenever you open a source file from the command line ( I haven't tested how xvzc/chezmoi.nvim handles GPG encryption, but nvim-chezmoi can open GPG-encrypted files as long as you use the Finally, you can preview templates from within Neovim using Both plugins work in a similar way aside from that. The main allure of nvim-chezmoi is the filetype detection, which is the whole reason I created the plugin. Since I was using xvzc/chezmoi.nvim before, a lot of the features I liked from it ended up in my own plugin. Hope this was a decent enough explanation! Thanks for the interest! |
|
Apart from what the author already said, as someone who was using xvzc/chezmoi.nvim until now, there are many other differences I noticed in this plugin. First, xvzc's plugin does not have :ChezmoiApply as a user command, although I've created my own in my config using the pluvin's API. xvzc's pluvin also does not provide a way to execute chezmoi commands in an async manner, which this plugin does with the I found this plugin to be much more scriptable as I was going through the code. I was facing UI freeze issues with my own auto commands with xvzc's plugin, but this plugin would solve them with the async approach. There are some things I noticed I think could be fixed based on my reading of the code alone but I'll try and check first to confirm the problem actually persists in practice. All in all, solid work. |


Hello! First of all, sorry for the delay in responding.
As for the differences, the main one is that my plugin tries to detect and apply the original filetype from the target path to the source file being edited. This allows things like LSP, syntax highlighting, completions, and Tree-sitter parsers to work on the source file just as they do for the target file.
For example, the filetype for ".bashrc" in my Neovim config is "sh". However, when added to chezmoi as a template, the source file is named "dot_bashrc.tmpl", and Neovim detects it as a template filetype.
However, if you use nvim-chezmoi:
This detection happens automatically whenever you open a source file from the command line (
n…