This repository has been archived by the owner on Mar 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathBoot-EverVim.ps1
46 lines (37 loc) · 1.85 KB
/
Boot-EverVim.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
echo "Welcome to EverVim, a powerful & modern vim distribution"
echo "Booting EverVim ..."
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
echo "Setup script needs administrator priviliges to create symlinks"
exit
}
Push-Location ~
if (!(Test-Path "~\.EverVim")) {
echo "Cloning into ~\.EverVim ..."
git clone https://github.com/LER0ever/EverVim ~\.EverVim
}
echo "Processing files and directories ..."
mkdir -Path ~\.EverVim\autoload -Force
mkdir -Path ~\.EverVim\bundle -Force
cmd /c rmdir %LOCALAPPDATA%\nvim\
cmd /c rmdir %USERPROFILE%\vimfiles\
cmd /c rmdir %USERPROFILE%\.vim\
if (Test-Path "~\.EverVim\init.vim" -PathType Leaf){
Remove-Item -Path ~\.EverVim\init.vim -Force -Recurse
Remove-Item -Path ~\.EverVim\ginit.vim -Force -Recurse
}
echo "Soft-Linking Vim/NeoVim Config ..."
cmd /c mklink /D %USERPROFILE%\vimfiles\ %USERPROFILE%\.EverVim\
cmd /c mklink /D %USERPROFILE%\.vim\ %USERPROFILE%\.EverVim\
cmd /c mklink /D %LOCALAPPDATA%\nvim\ %USERPROFILE%\.EverVim\
cmd /c mklink %USERPROFILE%\.EverVim\init.vim %USERPROFILE%\.EverVim\vimrc
cmd /c mklink %USERPROFILE%\.EverVim\ginit.vim %USERPROFILE%\.EverVim\core\gui.vim
if (!(Test-Path "~\.EverVim.vimrc")) {
echo "Copied EverVim configuration sample to ~\.EverVim.vimrc"
Copy-Item -Path ~\.EverVim\.EverVim.vimrc.sample -Destination ~\.EverVim.vimrc -Force
}
echo "Downloading Vim-Plug ..."
$uri = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
(New-Object Net.WebClient).DownloadFile($uri, $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("~\.EverVim\autoload\plug.vim"))
Pop-Location
echo "All done with the setup. "
echo "Now please open up your vim and Type :PlugInstall in your vim to complete the plugin installation"