diff options
| author | crupest <crupest@outlook.com> | 2024-10-23 23:32:32 +0800 | 
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2024-10-26 16:29:56 +0800 | 
| commit | f66dfcc24f181cd702258a8847ff85544f5da589 (patch) | |
| tree | 111ed370d618896a28e2fb01bf7d274ebd396a71 | |
| parent | 9b1f66d7c2700d16e08ed5c0e002e98fb44801d0 (diff) | |
| download | crupest-f66dfcc24f181cd702258a8847ff85544f5da589.tar.gz crupest-f66dfcc24f181cd702258a8847ff85544f5da589.tar.bz2 crupest-f66dfcc24f181cd702258a8847ff85544f5da589.zip | |
feat(nvim): add neovide-listen.ps1 for Windows.
| -rw-r--r-- | tools/scripts/neovide-listen.ps1 | 31 | 
1 files changed, 31 insertions, 0 deletions
| diff --git a/tools/scripts/neovide-listen.ps1 b/tools/scripts/neovide-listen.ps1 new file mode 100644 index 0000000..5ab006c --- /dev/null +++ b/tools/scripts/neovide-listen.ps1 @@ -0,0 +1,31 @@ +$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
 | 
