ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Remote​Subl

by randy3k ST3

Use rmate with Sublime Text, an improved fork of rsub.

Details

Installs

  • Total 3K
  • Win 1K
  • OS X 1K
  • Linux 632
Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7
Windows 0 5 2 5 6 3 7 4 2 4 3 6 7 3 6 4 1 4 7 7 5 1 4 8 7 5 4 7 3 4 4 7 6 4 3 4 4 4 7 8 12 15 5 4 1 4
OS X 2 4 11 10 7 7 7 10 2 5 6 9 6 8 11 9 3 5 5 4 6 4 4 8 11 11 12 6 11 2 5 7 10 7 10 6 5 4 4 8 10 12 5 6 5 7
Linux 0 2 1 5 6 4 4 3 0 0 3 1 3 4 3 1 1 2 3 4 5 1 2 1 1 6 6 2 2 1 2 2 5 1 4 3 3 1 2 1 2 7 4 4 3 2

Readme

Source
raw.​githubusercontent.​com

RemoteSubl

RemoteSubl starts as a fork of rsub to bring rmate feature of TextMate to Sublime Text. It transfers files to be edited from remote server using SSH port forward and transfers the files back when they are saved.

Comparing to rsub, the followings are enhanced:

  • support multiple files via rmate foo bar.
  • use the same view when opening the same file twice.
  • notify when connection lost.
  • resume previous connection when it was lost.
  • better status bar messages when saving file and when encountering errors.
  • bring up Sublime Text on different platforms.

Why a new fork? It seems that the author of rsub is not actively maintaining that package.

Installation

RemoteSubl can easily be installed using Package Control.

On the remote server, we need to install rmate (this one is the bash version). You don't have to install it if you have been using rmate with TextMate or other editors. It is just the same executable. If not, it (the bash version) can be installed by running this script (assume that you have the right permission),

curl -o /usr/local/bin/rmate https://raw.githubusercontent.com/aurora/rmate/master/rmate
sudo chmod +x /usr/local/bin/rmate

You can also rename the command to rsubl

mv /usr/local/bin/rmate /usr/local/bin/rsubl

If your remote system does not have bash (so what else does it have?), there are different versions of rmate to choose from:

Usage

Open an ssh connection to the remote server with remote port forwarded. It can be done by

ssh -R 52698:localhost:52698 user@example.com

After running the server, you can just open the file on the remote system by

(NOTE: you need to have opened Sublime on you local machine. If not you get this error connect_to localhost port 52698: failed.)

rmate test.txt

… or if you renamed it to rsubl then …

rsubl test.txt

If everything has been setup correctly, your should be able to see the opening file in Sublime Text.

SSH config

It could be tedious to type -R 52698:localhost:52698 everytime you ssh. To make your life easier, add the following to ~/.ssh/config,

Host example.com
    RemoteForward 52698 localhost:52698
    User user

From now on, you only have to do ssh example.com.