-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
remote ssh plugin (like vscode remote-ssh) #21635
Comments
Relates to https://github.com/chipsenkbeil/distant.nvim |
More related ideas:
|
Is it really necessary to include this in the core (if that's the plan)? |
afaik, this should be possible as a shell script + plugin (which is the current proposal described above). doesn't need to be in core, but until a plugin magically appears, this issue just tracks the general idea. And if a plugin does magically appear, then it might make sense to integrate it as a builtin plugin later. |
One major difference with vscode-remote vs a remote nvim UI is that with vscode-remote, all the keyboard input (and thus the actual buffer changes) are done by local client, with the input and server-driven updates being synchronized asynchronously in the background. This becomes very important when you have a high latency connection--vscode-remote stays feeling "snappy" when typing with characters being displayed to the screen instantly, but a remote nvim will start to be laggy with displaying input (or even just a normal nvim run in an ssh session). Not saying we should try to make it work like vscode-remote, but just wanted to point out the high latency remote connection use case as food for thought. |
What you can do in VS code is also to manage multiple remote sessions. Maybe there could be a command to reattach the TUI client to another server during a running session. Then, it could be implemented via a plugin only in a running session. |
@justinmk curious if there would be a way to embed the distant library into neovim itself. It's a rust library, so if we exported it in a C-friendly way, it could be consumed. If so, you could have neovim provide tramp natively and support doing this via ssh and distant's own protocol. And anything else added eventually like Google Drive, Dropbox, etc. for file editing. Would take a lot of the work out of needing to handle all of the protocol stuff and support something higher level where you can edit files, read files, run programs, etc. on the remote machine. Also supports remote shells and whatnot. All of these features are in the distant.nvim plugin, but would love to have them be native. |
This comment was marked as duplicate.
This comment was marked as duplicate.
Here's my 2 cents. I would love to see remote development as a feature (perhaps in a plugin, but I do want it!), but I think following the footsteps of VSCode is the wrong approach. VSCode approach downsides
Better approach
Prior workhttps://github.com/ipod825/vim-netranger - implements a file manager that also can use |
The obvious glaring downside to the "local everything" approach is if you actually need to develop in the remote server's environment. What if I have a work laptop with bare minimum essentials (a terminal emulator, maybe a neovim install, and a VPN), and I can't have the full development environment toolchain? Pick your poison: gcc with lots of of library dependencies, node with tons of npm modules, whatever. It might not even be the same OS. Windows->Linux, Linux->macOS, etc. With vscode-remote, I can have a development experience that "feels" local whilst actually running in a completely different environment that is equipped appropriately. In this way, vscode-remote and remote nvim UI's approaches are superior to some sort of file synchronization method to pull files locally for editing. |
Mounting remote files locally such as sshfs under poor network is not friendly for local git, and git operations become terribly slow. |
I thought the thread is about the opposite. Doesn't Neovim already support remote server's environment with
Sure, that's true. I'm personally a lot more interested in working locally on remote files, but working locally with a remote environment is a cool usecase.
I have proposed using Rclone, which has functionality of letting you resolve conflicts. I guess that could be used to always prefer the local I think that's more of a UI issue, though. I'd imagine you'd be able to make a local checkout if you have remote access to the machine that has the repository, no? In that case, it would be much better to just avoid this remote dance altogether and |
As @jdrouhard mentioned above, remote TUI over ssh/tcp does not provide a local vim file buffer. Every time the cursor is moved (not even an edit action), the terminal needs to be refreshed through ssh, which will cause obvious lag when the network is not good. Mounting remote files locally do provide a local vim file buffer, but full filesystem-level access over network are unnecessary, and the experience isn't good. Such as local git or local LSP server, need to analyze the complete context of the project, when over network , the input is huge and the output is small. |
I have played around with Neovim's I agree particularly with @jdrouhard's take [1]. What we have in neovim natively is:
People have mentioned VScode remote-ssh and Emacs TRAMP. Another tool which works well remotely out of the box is JupyterLab because it was always built with a client-server model. The buffers are cached in the client's browser and everything is executed in the server. |
I don't think this is a good idea. SSH is ubiquitous. Distant is very new and not currently supported. The beauty of VCode remote is how seemless it is and it "just works" most of the time. The security implications of SSH are also very well understood while distant would be something entirely new that users would have to understand. I would be for this if otherwise I worry it would be too niche. |
Distant also supports acting as an ssh client, so you get both feature sets. So yes you can! 馃槃
Fair enough. Distant uses a very modern encryption and authentication standard on par with ssh, but it definitely isn't battle tested or audited, although the crypto libraries have been audited. But advanced functionality like running a file watcher for remote changes, translating language server file references such that it can work on the remote machine, remote filesystem searching, and persistent connections (like eternal terminal) are implemented using distant. Regardless, using it as a client library would give you a high level abstraction for file io and process execution, rather than needing to work with ssh and the sftp subsystem. As distant implements support for other remote platforms, neovim would also get it for free. So I'm not necessarily sold on limiting to ssh. We've seen the wonders that Lua had over vim script! 馃槃 |
I created a plugin for this use case: remote-nvim.nvim. If you use devpod, you can also develop inside devcontainers using this plugin. I deployed the first release of the plugin yesterday (v0.0.1) 馃帀. Feel free to reach out to me if you have any questions about the plugin. You can drop your queries about the plugin over in the release discussion. I have only tested this with MacOS and Linux. Support for Windows is planned but timelines are not decided yet. |
This comment was marked as resolved.
This comment was marked as resolved.
No magic. It installs Neovim on the remote server in a custom folder and then starts a headless server over on remote and then launches a client locally. Everything done by the plugin is managed inside that folder. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Where did that requirement come from?
This is too complicated and outside the scope of this issue. The goal of this issue is not full emacs TRAMP. The goal is just what I described in the main description: auto-download nvim on the remote and connecting to that from a local nvim, with a single command. Create a separate issue for more complex approach such as emacs TRAMP. |
Sorry for being considered off-topic. I think it's worth pointing out that the subject of this issue says "like vscode remote-ssh", which does all editing locally and has the notion of local and remote execution contexts. That's why I thought it was related! |
I personally strongly agree that neovim should have a remote mode as powerful as vscode. This is definitely a killer feature. |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
Locking this since comments are now repeating things already addressed above. |
This is mostly just for tracking. Obviously everyone wants this, but it looks like work... 馃槒
Problem
vscode has "remote" tools (broadly referred to as
vscode-remote
, in particularvscode remote-ssh
)... that allow the user to
~/.ssh/config
~/.ssh
credentialsIdeaaaaaa
https://github.com/neovim/neovim/releases and installs the correct Nvim on the current machine
~/.ssh/config
nvim
version is not found on the remote)The text was updated successfully, but these errors were encountered: