Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Sublime over SSH

I'm trying to use Sublime Text 2 as an editor when I SSH in to my work server, and I'm stumped. I found this http://urbangiraffe.com/2011/08/13/remote-editing-with-sublime-text-2/ (among many other posts) that looks like it might help, but I don't follow it exactly, particularly with what values I should put in for the remote variable in line 5. I set "/Users/path/to/local/copy" to my local root directory, but I don't know if that's right or if there's more to do. Any thoughts? I'm on OSX10.8

like image 215
thumbtackthief Avatar asked Apr 11 '13 20:04

thumbtackthief


People also ask

Can you ssh with Sublime Text?

Start working with your local Sublime From now on you can simply connect to your servers via SSH and open files by executing the command subl file. txt . After that, your local sublime will open and you will feel at home. Of course, you can also save your files.

How do I use Sublime Text on a server?

Editing files on the server with SublimeOn the File menu, click SFTP/FTP, and then click Setup Server. Sublime Text opens the configuration file for the connection. Confirm that the “type” value is “sftp”. For the “host” value, replace example.com with your own domain name.


1 Answers

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 there would be no point doing this.

like image 136
Mikko Ohtamaa Avatar answered Sep 18 '22 16:09

Mikko Ohtamaa