5

As part of the upcoming TextMate 2 release, there will be a new feature called rmate, which will allow you to edit files from a remote machine (Linux/Unix/OSX) via SSH using your local copy of TextMate... Is there something similar for Windows? I know i could use CyberDuck, find the file i want to edit, download locally, work on it and then re-upload, but rmate looks like you just type rmate on the remote server, and text mate pops up with the file. (i have not tried since i am not a TextMate owner) Is there something similar for Windows?

3 Answers 3

3

Looks like @Julian Knight was correct in saying that Sublime Text could support this, but adding my findings on this. Check out Doug Stephen's post on using Sublime Text with RMate with details on how to set this up. I have set it up and it works exactly as i wanted it to! The advantage of this, over, say, SFTP or FTP, is if i SSH into a box, i am not root. If i need to edit a file in the etc folder, example /etc/apt/apt.conf, i would type

sudo rmate /etc/apt/apt.conf

enter my password, and i can edit locally on my machine. with SFTP, i cant do that since i am not root... anyway, happy days!

3
  • 1
    I wrote up a fairly detailed blog post how to get both remote and local bits set up: danieldemmel.me/blog/2012/09/02/…
    – dain
    Aug 15, 2013 at 22:05
  • Is there a solution if I don't have sudo on the remote server? Nov 16, 2018 at 9:37
  • it will work with or without sudo... but if you need to edit a file that requires sudo, you need sudo...
    – TiernanO
    Apr 17, 2019 at 11:04
2

Why not have a look at Sublime Text 2? This supports TextMate bundles and has plugins that support working over SSH/FTP/etc.

On Windows, I tend to use WinSCP and this works well with Sublime - I just double-click on a remote file in WinSCP and it opens locally with Sublime, when saving WinSCP monitors the temporary file and throws it back to the server as appropriate. But with the plugins, you don't have to work that way, you can open and save files direct to a remote server.

1
  • thanks for the link. i will try that out. handy, i did not know about WinSCP doing auto uploads... that might make life easier...
    – TiernanO
    Jun 27, 2012 at 10:48
-1

rmate probably won't do much more than provide a nice abstraction to the same basic process:

  1. download the file
  2. write a copy somewhere on your local machine
  3. edit it
  4. write it
  5. upload the file to the remote machine

But I might be wrong.

Many editors/IDE can actually edit code remotely but they all follow the process outlined above, AFAIK. The only tool that I've heard of that allows you to launch a local editor from a remote machine is bcvi. I don't know how it works, though, and it's Vim-specific, obviously. Maybe it's the inspiration behind rmate? Or not?

I think that you have overlooked a nice feature of modern (S)FTP clients: many of them offer the ability to "Edit with…" your chosen text editor. It's not exactly what you are after but it sure is handy.

Another option is to edit your files directly on the remote machine. Vim and Emacs work perfectly well through SSH. Expect a steap (but rewarding) learning curve. If you often need to edit configuration files Vim has its place in any sysadmin's toolbelt.

If what you actually want to do is work on deployed production code, there are better and safer ways: running your code on a local server, using some version control system…

5
  • So, rmate, from reading a bit about it, seems to be a client/server setup: when you are SSHed into a box, you type rmate <filename> the "client" (machine your SSHed into) connects to your "Server" (workstation) and sends the contents of the file. Modern SFTP clients will make this easier, but its an extra application you need to work on. If you are in a terminal, and you want to edit a file, you need to open Cyberduck, find the file, edit it, save it, etc... as apposed to typing <magic editor> <file name> and a editor window pops up...
    – TiernanO
    Apr 19, 2012 at 18:15
  • If I am in a terminal, SSHed on a remote machine and I need to edit a file I just do $ vi[m] file. If I'm working on a website hosted on that remote machine I use Git to work locally and push whatever branch was tested to death.
    – romainl
    Apr 19, 2012 at 19:23
  • i agree... using VIM, Nano, etc, on the remote machine is all well and good... and using git for pushing files remotely is all well and good also, but editing the apache config file remotely using VIM or Nano or Emacs or what ever, is a little more painful that using your local text editor, like Notepad++ or TextMate...
    – TiernanO
    Apr 19, 2012 at 19:31
  • Yeah. I hated it at first and spent years using nano to edit config files instead of using vi. But I learned Vim and now I just can't stand using any other editor. What about scp-ing the file to your local machine for editing or using the remote editing capability of your local editor? If you are going to end up in your GUI editor anyway, why don't you start from there?
    – romainl
    Apr 19, 2012 at 19:54
  • yea, VIM is grand and all that, and yea, i should probably spend more time learning that, but if you are copy pasting stuff from a web page, or tweaking code, i would really prefer to be using a local text editor... doesent matter what editor, in all fairness, but any editor, as apposed to the white text on black background with very little color formatting, etc... plus, if you are on a slower connection, editing on a termainl is SLOW... if you took the file locally for edit, and then just saved, it would be a lot less pain...
    – TiernanO
    Apr 20, 2012 at 9:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .