aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2023-07-14 19:53:25 +0200
committersrdusr <trevorgray@srdusr.com>2023-07-14 19:53:25 +0200
commit47fd8530ddaeac3398c240794518ad5247fd5d28 (patch)
tree4320d1d0e7ebcfce72955fe07f87956b42240f31
parent4de87c9813be65b096db5962101e2d4f4f310dde (diff)
downloaddotfiles-47fd8530ddaeac3398c240794518ad5247fd5d28.tar.gz
dotfiles-47fd8530ddaeac3398c240794518ad5247fd5d28.zip
Install nvim in Windows (psh)
-rw-r--r--win-nvim.ps131
1 files changed, 31 insertions, 0 deletions
diff --git a/win-nvim.ps1 b/win-nvim.ps1
new file mode 100644
index 0000000..82a454b
--- /dev/null
+++ b/win-nvim.ps1
@@ -0,0 +1,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