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

  • 0.1.4
  • github.​com
  • github.​com
  • 4 months ago
  • 40 minutes ago
  • 9 months ago

Installs

  • Total 2K
  • Win 575
  • OS X 921
  • Linux 365
May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11
Windows 0 4 2 6 3 3 2 0 5 4 3 3 7 0 1 8 4 7 1 2 0 3 3 2 4 4 1 3 3 3 5 3 0 0 1 4 3 5 4 0 0 0 1 3 5 4
OS X 1 4 2 7 6 9 1 3 4 3 2 5 6 1 2 5 3 5 3 1 1 5 7 7 5 2 6 1 2 6 6 3 0 2 2 1 8 6 3 3 6 2 0 12 4 5
Linux 0 4 3 3 0 0 0 0 2 2 3 2 2 1 0 1 1 3 3 2 1 1 2 10 2 3 1 1 1 1 2 1 2 3 0 2 2 3 3 2 2 0 0 3 1 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

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.