Here is an extremely useful trick that allows you to directly upload a file to remote FTP server upon saving in Sublime Text. We all know working off a live website is not a good idea. That being said, if necessary, this is how you can map a local directory to remove server via FTP/SFTP directly within Sublime Text. This would save you countless time and repetitive clicks to upload files to remove server manually. A rule of thumb is, if you find yourself repetitively doing a certain action, chances are, there are existing ways to optimize this workflow by automating the task.
Let’s get started to Enable Remove FTP Mapping from Sublime Text
First you need to install this plugin called SFTP, by going to Control + Shift + P > Package Install > SFTP
Once the plugin is installed, you find all the available options by going to Control + Shift + P > SFTP
Assuming you have a working directory that were mirroring what the remote server is, you can right-click on the directory root and go to SFTP/FTP > Map to Remote …
You will see there is a new sftp-config.json file created at the root directory. This file is only going to be used by SFTP, in here it will store all the remote FTP server credentials. You need to make sure enter the correct host, user and password (if there are any*) credential. One important key settings you need to pay attention to is “upload_on_save“, default set to false, update to true will allow SFTP to automatically upload the file you’ve just saved to remote server.
Below is an example how it looks like when you set upload_on_save to true.
That’s it, Sublime SFTP is free to use, but with continue usage it will prompt for license purchase from time to time. The free version offers full version capabilities as paid, but if you find this tool useful should consider supporting to the developer who created this awesome tool.