alker0 / chezmoi.vim

Highlight dotfiles you manage with chezmoi.
Other
119 stars 3 forks source link

Add Windows support #60

Closed andysbolton closed 1 year ago

andysbolton commented 1 year ago

Thanks so much for the plugin! It's solved a problem I've wanted to be solved since I started using chezmoi.

I noticed that the Vim autocmd doesn't get registered when running on Windows. Furthermore, the autocmd used for Unix won't work since chezmoi doesn't make a hardlink to a file in temporary folder on Windows.

I was wondering if I could get your thoughts on registering the autocmd for any .tmpl files in the source_dir_path on Windows.

alker0 commented 1 year ago

Thank you for your catching the bug. As a problem in Windows is often overlooked, this reporting is very valuable.

This autocmd line is supposed to work for both ~/.local/share/chezmoi and g:chezmoi#source_dir_path. However since the previous commit, it doesn't because using \V mode in autocmd pattern preserves slashes(/) from working as a path delimiter in Windows (I don't know why). I opened an issue for this bug and pushed a new commit. Please update it and check if it works.

Your reporting helped me to notice this problem and find a solution. Thank you so much.

andysbolton commented 1 year ago

Thanks @alker0, the fix in your commit works great! I will go ahead and close this PR.