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
相关问题
- JavaScript File Transfer SSH
- Why does this bash script work at console but fail
- How to run code in Sublime text 2 python
- SSH Fingerprint not authorized on Heroku after git
- (Scp - Permission Denied (Public Key) [closed]
相关文章
- Check if directory exists on remote machine with s
- Git Clone Fails: Server Certificate Verification F
- Test if File/Dir exists over SSH/Sudo in Python/Ba
- Can't access AWS CodeCommit with SSH
- Sanity check SSH public key? [closed]
- Spark EC2 SSH connection error SSH return code 255
- Use RSA with Eclipse Remote Systems Explorer?
- trouble getting sublime to execute with linux term
You can try something that I've been working on called 'xeno'. It will allow you to open up files/folders in Sublime Text (or any local editor really) over an SSH connection and automatically synchronize changes to the remote machine. It should work on almost all POSIX systems (I myself use it from OS X to connect to Linux machines and edit files in Sublime Text). It's free and open source. I'd love some feedback.
For more information: it's basically a Git/SSH mashup written in Python that allows you to edit files and folders on a remote machine in a local editor. You don't have to configure kernel modules, you don't need to have a persistent connection, it's all automatic, and it won't interfere with existing source control because it uses an out-of-worktree Git repository. Also, because it's built on Git, it's extremely fast and supports automatic merging of files that might be changing on both ends, unlike SSHFS/SFTP which will just clobber any files with older timestamps.
Another mac solution similar to osxfuse is to just use Transmit FTP client from Panic Software, which allows you to mount a remote folder as a local disk. It supports SFTP, which is very secure.
This is the easiest way to locally edit files which live on remote host where you have previously setup ssh to remote IP
Done !!!
Now on local host just start editing files ... when you list dir locally it may not list anything until you cd into subdir or list a specific file ... lazy loading ... this does not impact editing files
so above is actually editing remote file at
For OSX or Windows see this tut from the kind folk over on Digital Ocean
I'm on Windows and have used 4 methods: SFTP, WinSCP, Unison and Sublime Text on Linux with X11 forwarding over SSH to Windows (yes you can do this without messy configs and using a free tool).
The fourth way is the best if you can install software on your Linux machine.
The fourth way:
MobaXterm
subl
Note: When invoking subl if it complains for a certain library - ensure you install them to successfully invoke sublimetext from mobaxterm.
If you can't install software on your Linux box, the best is Unison. Why?
SFTP
Setup: Install the SFTP Sublime Text package. This package requires a license.
In the sftp-config, I usually set:
This, in addition to an SSH terminal to the machine gives me a fairly seamless remote editing experience.
WinSCP
From then on, WinSCP will keep your changes synchronized.
Work in the local folder using SublimeText. Just make sure that Sublime Text is set to guess the line endings from the file that is being edited.
Unison
I have found that if source tree is massive (around a few hundred MB with a deep hierarchy), then the WinSCP method described above might be a bit slow. You can get much better performance using Unison. The down side is that Unison is not automatic (you need to trigger it with a keypress) and requires a server component to be running on your linux machine. The up side is that the transfers are incredibly fast, it is very reliable and ignoring files, folders and extensions are incredibly easy to setup.
You can use rsub, which is inspired on TextMate's
rmate
. From the description:Here's a good tutorial on how to set it up properly.
As a follow up to @ubik's answer, here are the three simple (one-time) steps to get the 'subl' command working on your remote server:
rsub
package in Sublime Text using the Sublime Package Manager[Local] Execute the following Bash command (this will set up an SSH tunnel, which is rsub's secret sauce):
[Server] Execute the following Bash command on your remote server (this will install the 'subl' shell command):
And voila! You're now using Sublime Text over SSH.
You can open an example file in Sublime Text from the server with something like
subl ~/test.txt