Solution for using Sublime Text to edit files on a local server I created with vagrant?

Doug Smith picture Doug Smith · Jun 20, 2013 · Viewed 10.2k times · Source

I have a headless Ubuntu server created with vagrant and normally use vagrant ssh to access and then mess around with the files.

I need to edit the files, and I'm not terribly keen on learning vim/emacs, so I'm wondering if I can use my editor of choice (Sublime Text 2) to edit the remote files.

How would you recommend I go about this? I've heard many solutions, FTP, rsync, vim/emacs, etc. but I'm not sure for my particular situation (Sublime and vagrant) what I would be best off doing.

Answer

Matt Cooper picture Matt Cooper · Jun 20, 2013

By default Vagrant will set up a share with your host machine automatically... /vagrant on the server will be mapped to the folder containing your Vagrantfile this allows you to edit anything in this folder and the changes will be made instantly on the ubuntu server as well.

You can also set up other shared/synced folders... check out the documentation.

The other options you have are creating a samba share (or AFP on OSX) or something similar and then mounting the share in your host machine and using sublime as per usual.