HACKER Q&A
📣 eeegnu

What do you use for editing when you SSH into a remote terminal?


Lately I've been editing files on my local system through an IDE, and through Putty I just paste the code into the proper file through VIM (vim somefile -> gg -> dG -> shift-insert). If it's particularly complex i'll pull from git, but that often makes testing little things very hard, and makes me use vim for the majority of the edits. What's a better way of doing this?


  👤 Gibbon1 Accepted Answer ✓
I'm not going to mention the IDE I use because no one else uses it but it supports SFTP. So I can use that to edit files remotely. 99% of my use was editing and running python on a embedded linux board. If your preferred editor supports SFTP or similar that's a good option.

👤 jlund-molfese
If you're on Linux, SSHFS is a decent option when you also need to transfer larger files.

I like not dealing with latency while typing, so I'll usually edit locally and occasionally run the code on the remote server


👤 dbergamin
VSCode remote plugin is pretty great if you're doing heavy editing. Probably wouldn't hook it up to a production machine though, it leaves a bit of cruft around. You could also look to enhance your vim experience, a few plugins and most importantly, some practice, can turn it into an efficient text editor.

It is hard to say, as the requirement you have doesn't sound very standard so we might need to know a bit more to help.


👤 GrumpyYoungMan
Use rsync to copy the files over. It only transfers changed files and can use file compression to reduce bandwidth so it's highly efficient.

👤 bartvk
I’d test little things with a unit test. One step up, I'd make a local test environment. Beyond that, I’d create a "deploy" target in my makefile, which does an efficient installation to your target (you don't specify what you're building, but that target may be a test server, a mobile device, an embedded board I dunno).

👤 FandangoRanger
emacs + tramp