I wanted to be able to edit a file in my computer but have it save on the remote server.
What does Rmate do?
Rmate is a script that you install on the remote server – the server you want to edit files from. It was originally created for Textmate.
Basically, what it does is when you run this script on a file, it sort of *pushes* that file from the remote server down to your computer where your text editor – Sublime Text or Textmate – is waiting to *catch* it. Well, that’s the for dummies (like me) explanation. Technically, we use an SSH tunnel or something.
What does Rsub do?
Rsub is a plugin that you install on Sublime Text 2. This is the thing allows ST2 to *catch* the file *pushed* down from the server and edit the file.
Installation and Setup
- Install rsub plugin for ST2.
- SSH to your remote machine:
- Download Rmate:
curl https://raw.github.com/aurora/rmate/master/rmate > rmate
- Move Rmate to bin:
sudo mv rmate /usr/local/binso don’t need to specify the path to rmate script
- Make it executable:
sudo chmod +x /usr/local/bin/rmate
How to use
- Run Sublime Text 2 in your computer.
- SSH to remote:
ssh -R 52698:localhost:52698 firstname.lastname@example.org
- Rmate the file you want to edit locally:
- The file should open in ST2 in your computer.