You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wonder if there would be a way to give a command to the server to load a file from the remote machine to a buffer in neovim on the local machine. I imagine semantics something like this:
# this is a remote server
pball@snowball🌐:~
❯ distant server nvim-open path/to/myfile
And a buffer for path/to/myfile opens in the local Neovim. This would be in some sense the inverse of distant spawn. SublimeText has a version of this but it has the "hang while a synchronous copy happens"/sshfs issue. Following up #129.
The text was updated successfully, but these errors were encountered:
Today there is not. The architecture works like this, where UDS is Unix Domain Socket (Mac/Linux/Unix), or a named pipe for Windows.
The protocol doesn't have any mechanism to send arbitrary data back from the server to the client that isn't associated with a running process, file IO, active search, or a couple of other APIs we provide.
The closest thing I could think of that could be done would be to start a remote process from distant.nvim where the remote process listens for commands you send it on the server and relays them back to neovim. Here's an example using netcat (BSD version):
Use distant.nvim to spawn a netcat instance on some port that only listens locally: nc -kluw 0 localhost 8888
When on your server, send a message to it to be echoed over stdout: echo nvim-open path/to/myfile | nc -uw 0 localhost 8888
Receive the output from within distant.nvim and parse it to understand what you want to do
Do whatever that is. In this case, use distant.nvim's API to open the file.
Interesting! I'm a little stuck because somehow what I was doing in #129 to get connected has stopped working. I'll try this as soon as I get connections going again.
I wonder if there would be a way to give a command to the server to load a file from the remote machine to a buffer in neovim on the local machine. I imagine semantics something like this:
And a buffer for
path/to/myfile
opens in the local Neovim. This would be in some sense the inverse of distant spawn. SublimeText has a version of this but it has the "hang while a synchronous copy happens"/sshfs issue. Following up #129.The text was updated successfully, but these errors were encountered: