Sublimetext3 Build on The Server Over Ssh

How to use Sublime over SSH

There are three ways:

  • Use SFTP plugin (commercial) http://wbond.net/sublime_packages/sftp - I personally recommend this, as after settings public SSH keys with passphrase it is safe, easy and worth every penny http://opensourcehacker.com/2012/10/24/ssh-key-and-passwordless-login-basics-for-developers/

  • Mount the remote as local file system using osxfuse and sshfs as mentioned in the comments. This might be little difficult, depending on OSX version and your skills with UNIX file systems.

  • Hack together something like rmate which does file editing over remote tunneling using some kind of a local daemon (very difficult, cumbersome, but sudo compatible) http://blog.macromates.com/2011/mate-and-rmate/

Also, in theory, you can install X11 on the remote server and run Sublime there over VNC or X11 forwarding, but this would be very slow.

How to open remote files in sublime text 3

On server

Install rsub:

wget -O /usr/local/bin/rsub \https://raw.github.com/aurora/rmate/master/rmate
chmod a+x /usr/local/bin/rsub

On local

  1. Install rsub Sublime3 package:

On Sublime Text 3, open Package Manager (Ctrl-Shift-P on Linux/Win, Cmd-Shift-P on Mac, Install Package), and search for rsub and install it


  1. Open command line and connect to remote server:

ssh -R 52698:localhost:52698 server_user@server_address


  1. after connect to server run this command on server:

rsub path_to_file/file.txt


  1. File opening auto in Sublime 3

As of today (2018/09/05) you should use :
https://github.com/randy3k/RemoteSubl
because you can find it in packagecontrol.io while "rsub" is not present.

Sublime Text 3 and Rails: manage an app on a remote server

Is it possible to sync the folder automatically once files are created or deleted, either locally or remotely, instead of clicking everytime on Sync Local -> Remote or viceversa?

Yes, but only for the files changed locally. Check upload_on_save.

Is it possible to launch rails or rake commands from the Sublime console to the remote server and after that sync the local folder contents automatically?

You cannot run such commands using a FTP client. You will need SSH access to the server for that.

A work around would be to set up a listener on your server that will trigger rails commands when files are changed.



Related Topics



Leave a reply



Submit