aboutsummaryrefslogtreecommitdiff
path: root/.scripts/win-nvim.ps1
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2023-10-22 22:50:02 +0200
committersrdusr <trevorgray@srdusr.com>2023-10-22 22:50:02 +0200
commita4f18086ba7ce108ebb041b9b0c52bf522413000 (patch)
tree8d63a98b329f4af486f38db47d0b6049c6e441d8 /.scripts/win-nvim.ps1
parentbf45ef759815ad7ac3f6423114a96f4d56d1a2a2 (diff)
parent68a2612c8b737f6770a4d23848fe6409ddce7888 (diff)
downloaddotfiles-a4f18086ba7ce108ebb041b9b0c52bf522413000.tar.gz
dotfiles-a4f18086ba7ce108ebb041b9b0c52bf522413000.zip
Add '.scripts/' from commit 'a4ba0376ba73b1bb295d8bb459a4bf2b063ddca9'
git-subtree-dir: .scripts git-subtree-mainline: 03c0cf66468d5e04c0e3559f9f89b5eec28feb9e git-subtree-split: a4ba0376ba73b1bb295d8bb459a4bf2b063ddca9
Diffstat (limited to '.scripts/win-nvim.ps1')
-rw-r--r--.scripts/win-nvim.ps139
1 files changed, 39 insertions, 0 deletions
diff --git a/.scripts/win-nvim.ps1 b/.scripts/win-nvim.ps1
new file mode 100644
index 0000000..ca67755
--- /dev/null
+++ b/.scripts/win-nvim.ps1
@@ -0,0 +1,39 @@
+# 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 https://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
+#curl -o winget-cli.appxbundle https://aka.ms/winget-cli-appxbundle
+#powershell Add-AppxPackage -Path "winget-cli.appxbundle"
+#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'))
+#use `-y` or consider: choco feature enable -n allowGlobalConfirmation
+#choco install git
+#- Refresh the environment
+#Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
+#refreshenv