From 47fd8530ddaeac3398c240794518ad5247fd5d28 Mon Sep 17 00:00:00 2001 From: srdusr Date: Fri, 14 Jul 2023 19:53:25 +0200 Subject: Install nvim in Windows (psh) --- win-nvim.ps1 | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 win-nvim.ps1 (limited to 'win-nvim.ps1') 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 -- cgit v1.2.3