forked from fastvim/fastvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.ps1
71 lines (58 loc) · 2.03 KB
/
install.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
function Show-Progress {
param (
[int]$PercentComplete
)
Write-Progress -Activity "Installation in progress..." -PercentComplete $PercentComplete
}
function Error {
param (
[string]$Message
)
Write-Host "❌ $Message" -ForegroundColor Red
exit 1
}
Write-Host "🚀 Installing Fastvim..."
# Check for Git installation
if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
Error "Git is not installed. Please install Git and try again."
}
# Define Neovim configuration path
$NvimConfigPath = "$env:LOCALAPPDATA\nvim"
Write-Host "📁 Checking directories..."
if (Test-Path -Path $NvimConfigPath) {
Write-Host "🗑️ Removing old Neovim installation..."
Remove-Item -Recurse -Force $NvimConfigPath -ErrorAction Stop
} else {
Write-Host "Directory $NvimConfigPath does not exist. Skipping removal."
}
# Clone Fastvim repository
Write-Host "⬇️ Downloading Fastvim..."
git clone https://github.com/BrunoCiccarino/fastvim $NvimConfigPath -ErrorAction Stop
# Install dependencies
$Progress = 0
Show-Progress -PercentComplete $Progress
Write-Host "⬇️ Installing system dependencies..."
Start-Job -ScriptBlock {
winget install --id Microsoft.VisualStudioCode -e --source winget
winget install --id Git.Git -e --source winget
} | Wait-Job
$Progress += 25
Show-Progress -PercentComplete $Progress
Write-Host "⬇️ Installing Golang..."
Start-Job -ScriptBlock {
winget install --id golang.Go -e --source winget
} | Wait-Job
$Progress += 25
Show-Progress -PercentComplete $Progress
Write-Host "⬇️ Installing Node.js and npm..."
Start-Job -ScriptBlock {
winget install --id OpenJS.Nodejs -e --source winget
} | Wait-Job
$Progress += 25
Show-Progress -PercentComplete $Progress
Write-Host "⬇️ Installing live-server globally..."
npm install -g live-server
$Progress += 25
Show-Progress -PercentComplete $Progress
Write-Host "✅ Fastvim and dependencies installed successfully!" -ForegroundColor Green
Write-Host "➡️ Open Neovim to complete the setup." -ForegroundColor Green