本文介绍了如何通过 SSH 使用 Sublime的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我通过 SSH 连接到我的工作服务器时,我尝试使用 Sublime Text 2 作为编辑器,但我很困惑.我发现了这个 http://urbangiraffe.com/2011/08/13/remote-editing-with-sublime-text-2/(在许多其他帖子中)看起来可能会有所帮助,但我并没有完全遵循它,特别是我应该放置什么值在第 5 行的远程变量中.我将/Users/path/to/local/copy"设置为我的本地根目录,但我不知道这是否正确,或者是否还有更多工作要做.有什么想法吗?我在 OSX10.8 上

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

推荐答案

有以下三种方式:

  • 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/

使用注释中提到的 osxfusesshfs 将远程安装为本地文件系统.这可能有点困难,具体取决于 OSX 版本和您对 UNIX 文件系统的技能.

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.

将诸如 rmate 之类的东西组合在一起,它使用某种本地守护程序通过远程隧道进行文件编辑(非常困难、繁琐,但与 sudo 兼容)http://blog.macromates.com/2011/mate-and-rmate/

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/

另外,理论上,您可以在远程服务器上安装 X11 并通过 VNC 或 X11 转发在那里运行 Sublime,但这样做没有意义.

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.

这篇关于如何通过 SSH 使用 Sublime的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 12:08