-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.ps1
53 lines (39 loc) · 1.53 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
# blvim install script for Windows.
Write-Host @"
. .
|_ |. ,.._ _
[_)| \/ |[ | )
blapco's Vim bundle.
- https://blapco.xyz
- https://git.blapco.xyz/blvim
"@
echo "Installing blvim..."
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
echo "Please, run PowerShell as Administrator so the script can create symlinks."
exit
}
pushd ~
if (!(Test-Path "~\.blvim)) {
echo "Cloning blvim into ~\.blvim"
git clone https://git.blapco.xyz/blvim ~\.blvim
}
mkdir -Path ~\.blvim\autoload -Force
mkdir -Path ~\.blvim\bundle -Force
cmd /c rmdir %LOCALAPPDATA%\nvim\
cmd /c rmdir %USERPROFILE%\vimfiles\
cmd /c rmdir %USERPROFILE%\.vim\
if (Test-Path "~\.blvim\init.vim" -PathType Leaf) {
Remove-Item -Path ~\.blvim\init.vim -Force -Recurse
Remove-Item -Path ~\.blvim\ginit.vim -Force -Recurse
}
cmd /c mklink /D %USERPROFILE%\vimfiles\ %USERPROFILE%\.blvim\
cmd /c mklink /D %USERPROFILE%\.vim\ %USERPROFILE%\.blvim\
cmd /c mklink /D %LOCALAPPDATA%\nvim\ %USERPROFILE%\.blvim\
cmd /c mklink %USERPROFILE%\.blvim\init.vim %USERPROFILE%\.blvim\vimrc
cmd /c mklink %USERPROFILE%\.blvim\ginit.vim %USERPROFILE%\.blvim\core\gui.vim
echo "Installing Vim-Plug."
$uri = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
(New-Object Net.WebClient).DownloadFile($uri, $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("~\.blvim\autoload\plug.vim"))
Pop-Location
vim + 'PlugInstall --sync' +qa
echo "Finished!"