-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnvim_installation.ps1
52 lines (40 loc) · 1.77 KB
/
nvim_installation.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
function Install-Chocolatey {
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
}
function Install-Neovim {
choco install neovim -y
}
function Install-Fonts {
$url = "https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/JetBrainsMono.zip"
$tempDir = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), "JetBrainsMono")
$zipFile = [System.IO.Path]::Combine($tempDir, "JetBrainsMono.zip")
New-Item -ItemType Directory -Path $tempDir -ErrorAction SilentlyContinue
Invoke-WebRequest -Uri $url -OutFile $zipFile
Expand-Archive -Path $zipFile -DestinationPath $tempDir
$fontFiles = Get-ChildItem -Path $tempDir -Recurse -Include "*.ttf", "*.otf"
foreach ($fontFile in $fontFiles) {
$fontName = [System.IO.Path]::GetFileNameWithoutExtension($fontFile.FullName)
$fontDestination = [System.IO.Path]::Combine([System.Environment]::GetFolderPath("Fonts"), "$fontName.ttf")
Copy-Item -Path $fontFile.FullName -Destination $fontDestination -Force
}
Remove-Item -Path $tempDir -Recurse -Force
}
function Install-GCC {
# Check if Chocolatey is installed
if (!(Get-Command choco -ErrorAction SilentlyContinue)) {
Write-Host "Chocolatey is not installed. Please install Chocolatey first."
exit
}
# Install GCC using Chocolatey
Write-Host "Installing GCC..."
choco install mingw -y
}
function Install-Nvchad {
cd ~\AppData\Local\
git clone https://github.com/NvChad/NvChad .\nvim --depth 1
}
Install-GCC
Install-Fonts
Install-Chocolatey
Install-Neovim
Install-Nvchad