Hacker News new | ask | show | jobs
by TrickedOut 3608 days ago
It would be nice to have an editor which can work locally and edit remotely using keyless SSH (e.g., using PEM files) which is a common use case for cloud setups like EC2. Near impossible getting this to work on Sublime or almost anything else. I'm surprised there isnt more developer request for such tools.
6 comments

Do you know you can mount a remote filesystem using sshfs? It changed my life a few years back. Super easy to use and no need to have the functionality built into the editor, which in my opinion, isn't where this functionality belongs anyway.
I agree.

One thing that Windows does really well, in an all-Windows environment anyway, is network file access.

Need to open a remote file? Open \\servername\share\path\to\file.txt. No need to 'mount' a filesystem, or map a drive or anything, it just works. No need to supply credentials since Windows already knows who you are signed in as. It's really quite nice. Of course, this all relies on the Windows monoculture - it doesn't support sshfs, nfs, etc, only CIFS/SMB.

This is all done at the Windows API level, so it works across all applications with very few exceptions (like cmd.exe). It doesn't rely on an application using specific libraries (e.g., Gvfs, KIO) or having some kind of addon to enable that functionality.

Honestly, this is the number one thing I miss since switching to Mac/Linux. I can still access network resources from the Mac and Linux, but it's not as convenient or transparent as Windows.

I've never had a good experience with sshfs on Windows. Different settings are either too slow or don't kill the cache when I change something. My current workflow is to clone the project both on my machine and my development server, then sync the changes with the SFTP plugin.
Yeah, I use sshfs a lot too with Sublime. The biggest drawback I find is that its built-in search and search/replace is basically useless on a large remote project. This is one area where the editor being able to run commands on the remote host would be a huge advantage.
That is a very limited solution. I started using VIM exactly because I should log in to a remote server AND use the libraries in that server and have some intelligent auto-completion and code checking going on in my editor.

Mounting a remote filesystem does nothing of that.

Emacs can do this using the built-in tramp-mode.

https://www.emacswiki.org/emacs/TrampMode

The best part of TRAMP is how many modes that know nothing of tramp work over ssh.

At work, the git plugin I use with emacs (magit).. works over ssh. Dired (file browsing), works. shell-mode? works! It's fan-fucking-tastic.

And it can edit files as root with tramp. And oh so much more!
Vim can open files remotely by ssh, copying the file to the remote server on each write. To edit the file example.com:foo.txt, do:

   :e ssh://example.com/foo.txt
It should use your default ssh config/setup/etc.
Nuclide (FB's atom based IDE) does this fairly well: https://nuclide.io/docs/features/remote/
I believe remote editing is Nuclide's raison d'etre.
rsub (derived from rmate) makes editing with ST3 over ssh pretty easy.

https://github.com/henrikpersson/rsub

If you can afford to install emacs+x11, that could work pretty well over ssh.