Skip to content

Commit

Permalink
Update setup.ps1
Browse files Browse the repository at this point in the history
vim
  • Loading branch information
starchyunderscore authored Oct 15, 2023
1 parent e8bc9f2 commit 1307fcb
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion current/setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,26 @@ public class PInvoke {
$TEdit = Read-Host "`nInput the number of an option from the list above, or leave blank to exit"
switch ($TEdit) {
1 { # vim
Write-Output "Sorry, not yet"
$Install = $Host.UI.PromptForChoice("Install vim?", "", @("&Cancel", "&Install"), 0)
if ($Install -eq 1) {
CREATE_BIN
Write-Output "`nFetching latest version information"
$getLatest = Invoke-webRequest -UseBasicParsing "https://api.github.com/repos/vim/vim-win32-installer/releases/latest" | ConvertFrom-Json
$latest = $getLatest.tag_name.Substring(1)
if (test-path "$HOME\bin\vim.ps1") {
Write-Output "`nRemoving old version"
rm -r "$HOME\bin\vim"
}
Write-Output "`nDownloading latest version"
Start-BitsTransfer -source "https://github.com/vim/vim-win32-installer/releases/download/v$latest/gvim_$latest`_x64.zip" -destination ".\vim.zip"
Write-Output "`nInstalling"
Expand-Archive .\vim.zip | out-null
mv .\vim\vim\vim*\ ~\bin\vim | out-null
Write-Output "$HOME\bin\vim\vim.exe" > "$HOME\bin\vim.ps1"
Write-Output "`nCleaning up"
rm -r .\vim
Write-Output "`nDone"
}
}
2 { # neovim
Write-Output "Sorry, not yet"
Expand Down

0 comments on commit 1307fcb

Please sign in to comment.