I want to use chezmoi (or any other dotfile manager). I followed the instructions and added my nvim config on Windows with chezmoi.exe add ~\AppData\Local\nvim. The resulting git repository has that very path in it. When I check it out on a *nix machine and apply it with chezmoi apply, it creates a directory just like that in my home folder. However, it is expected to be .config/nvim.
I thought, chezmoi etc are designed exactly for the purpose of managing dotfiles across diverse machines. How am I supposed to manage that scenario?
I struggled with this myself. The official answer is not useful for something like neovim, where you have dozens of configuration files. So I ended up simply making a junction from ~/AppData/Local/Nvim to ~/.config/nvim.
To do this automatically, make a file with the name run_after__symlink-neovim-config_windows.ps1 to ~/.local/share/chezmoi:
If ($PSVersionTable.PSVersion.Major -Le 5 -Or $isWindows) {
If (-Not (Test-Path $env:LOCALAPPDATA\nvim)) {
New-Item -Path $env:LOCALAPPDATA\nvim -ItemType Junction -Value $env:USERPROFILE\.config/nvim
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With