feat: initial commit

This commit is contained in:
2025-12-12 13:36:05 +09:00
commit 3c7ab13048
5 changed files with 34 additions and 0 deletions

7
README.md Normal file
View File

@@ -0,0 +1,7 @@
# Nvim Remote PoC
## Usage
1. Modify `config.sh`
2. Run `remote.sh` in the remote PC
3. Run `local.sh` in the local PC
4. Run `access.sh` in the local PC to launch neovim

5
access.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
. ./config.sh
exec nvim --server $LOCAL_SOCK --remote-ui

8
config.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
LOCAL_PORT=12344
LOCAL_SOCK=/tmp/local_server1.sock
REMOTE_SSH=allen@localhost
REMOTE_PORT=12345
REMOTE_SOCK=/tmp/server1.sock

7
local.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
. ./config.sh
ssh -L $LOCAL_PORT:localhost:$REMOTE_PORT $REMOTE_SSH -N &
socat UNIX-LISTEN:$LOCAL_SOCK,fork,reuseaddr,unlink-early TCP-CONNECT:localhost:$LOCAL_PORT

7
remote.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
. ./config.sh
nvim --headless --listen $REMOTE_SOCK &
socat TCP-LISTEN:$REMOTE_PORT,fork,reuseaddr UNIX-CONNECT:$REMOTE_SOCK