79627220

Date: 2025-05-18 07:09:41
Score: 3
Natty:
Report link

Thanks @jo-totland for the solution. I modified the condition to use automatically provided environment variable CHEZMOI_OS (source). Because the original answer uses uninitialized $isWindows variable.

If ($env:CHEZMOI_OS -eq "windows") {
    If (-Not (Test-Path $env:LOCALAPPDATA\nvim)) {
        New-Item -Path $env:LOCALAPPDATA\nvim -ItemType Junction -Value $env:USERPROFILE\.config\nvim
    }
}

Just for the reference, there's an open issue about this on GitHub: https://github.com/twpayne/chezmoi/issues/2273

I wanted to post it as a comment under the original answer, but don't have enough reputation :\

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • RegEx Blacklisted phrase (1.5): don't have enough reputation
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @jo-totland
  • Low reputation (1):
Posted by: John Smith