diff options
Diffstat (limited to 'tools/scripts/neovide-listen.ps1')
-rw-r--r-- | tools/scripts/neovide-listen.ps1 | 69 |
1 files changed, 38 insertions, 31 deletions
diff --git a/tools/scripts/neovide-listen.ps1 b/tools/scripts/neovide-listen.ps1 index 5ab006c..e84f3a2 100644 --- a/tools/scripts/neovide-listen.ps1 +++ b/tools/scripts/neovide-listen.ps1 @@ -1,31 +1,38 @@ -$env:NVIM_LISTEN_ADDRESS ??= "\\.\pipe\nvimsocket"
-
-$neovide_args = @()
-
-$listen_added = $false
-foreach ($arg in $args) {
- $neovide_args += $arg
- if ( $arg -eq '--') {
- $neovide_args += "--listen", $env:NVIM_LISTEN_ADDRESS
- $listen_added=$true
- }
-}
-
-if (-not $listen_added) {
- $neovide_args += "--", "--listen", $env:NVIM_LISTEN_ADDRESS
-}
-
-$neovide_bin = "neovide"
-$my_neovide_path = "$HOME/codes/neovide/target/release/neovide.exe"
-if (Get-Item $my_neovide_path -ErrorAction Ignore) {
- Write-Output "Found my neovide at $my_neovide_path."
- $neovide_bin = "$my_neovide_path"
-}
-
-if (Get-Command nvr -ErrorAction Ignore) {
- Write-Output "Detected nvr, set git editor env."
- $env:GIT_EDITOR = "nvr -cc split --remote-wait"
-}
-
-Write-Output "Command is $($neovide_args -join ' ')."
-Start-Process $neovide_bin -ArgumentList $neovide_args -Wait
+$env:NVIM_LISTEN_ADDRESS ??= "\\.\pipe\nvimsocket" + +$neovide_args = @() + +$MY_NEOVIM_PATH="$HOME/codes/neovim/build/bin/nvim.exe" +if (Get-Item $MY_NEOVIM_PATH -ErrorAction Ignore) { + Write-Output "Found my neovim at $MY_NEOVIM_PATH." + $env:VIMRUNTIME="$HOME/codes/neovim/runtime" + $neovide_args += "--neovim-bin", "$MY_NEOVIM_PATH" +} + +$listen_added = $false +foreach ($arg in $args) { + $neovide_args += $arg + if ( $arg -eq '--') { + $neovide_args += "--listen", $env:NVIM_LISTEN_ADDRESS + $listen_added=$true + } +} + +if (-not $listen_added) { + $neovide_args += "--", "--listen", $env:NVIM_LISTEN_ADDRESS +} + +$neovide_bin = "neovide" +$my_neovide_path = "$HOME/codes/neovide/target/release/neovide.exe" +if (Get-Item $my_neovide_path -ErrorAction Ignore) { + Write-Output "Found my neovide at $my_neovide_path." + $neovide_bin = "$my_neovide_path" +} + +if (Get-Command nvr -ErrorAction Ignore) { + Write-Output "Detected nvr, set git editor env." + $env:GIT_EDITOR = "nvr -cc split --remote-wait" +} + +Write-Output "Command is $($neovide_args -join ' ')." +Start-Process $neovide_bin -ArgumentList $neovide_args -Wait |