Skip to content

Instantly share code, notes, and snippets.

@ptantiku
Created July 4, 2026 08:00
Show Gist options
  • Select an option

  • Save ptantiku/c7d27f97acd7e9c12deb3fd7c3ab3436 to your computer and use it in GitHub Desktop.

Select an option

Save ptantiku/c7d27f97acd7e9c12deb3fd7c3ab3436 to your computer and use it in GitHub Desktop.
Install VIM in Windows using winget command, and set the user environment's path variable
# Install Vim via winget (non-interactive)
winget install --id vim.vim -e --accept-source-agreements --accept-package-agreements
# Add Vim to USER PATH if not already present
$vimPath = "$env:LOCALAPPDATA\Programs\Vim"
$userPath = [Environment]::GetEnvironmentVariable("PATH", "User")
if ($userPath -notlike "*$vimPath*") {
[Environment]::SetEnvironmentVariable("PATH", "$userPath;$vimPath", "User")
Write-Host "Added $vimPath to user PATH. Open a new shell to use it."
} else {
Write-Host "$vimPath already in user PATH."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment