aboutsummaryrefslogtreecommitdiff
path: root/win-nvim.ps1
blob: 82a454b1a284d3f8251c77166f8ec7af0756960d (plain)
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
# Install NeoVim with winget, if not already present on the system
if (!(Get-Command nvim -ErrorAction SilentlyContinue)) {
    winget install Neovim.Neovim
}

# Clone my dotfiles repo
$dotFilesRoot = Join-Path $HOME "dotfiles"

if (!(Test-Path $dotFilesRoot -PathType Container)) {
    git clone git@github.com:srdusr/dotfiles.git $dotFilesRoot
}

# Link NeoVim configuration
$localConfiguration = Join-Path $env:LOCALAPPDATA "nvim"
$dotfilesConfiguration = Join-Path $dotFilesRoot ".config" "nvim"

if (!(Test-Path $localConfiguration -PathType Container)) { 
    Start-Process -FilePath "cmd.exe" -ArgumentList "/c mklink /D $localConfiguration $dotfilesConfiguration" -Verb runas
}

# Clone Packer.nvim, if not already present on the system
$localPacker = Join-Path $env:LOCALAPPDATA "nvim-data" "site" "pack" "packer" "start" "packer.nvim"

if (!(Test-Path $localPacker -PathType Container)) { 
    git clone https://github.com/wbthomason/packer.nvim $localPacker
}

# To allow script execution, run the following command in PowerShell as an administrator:
# Set-ExecutionPolicy RemoteSigned
# Then run the script by using this command in the same existing directory:
# ./win-nvim.ps1