Sublime Forum

Sublime FTP + SASS Compile Setup?

#1

Hi there, I am on the hunt to find a text editor that will allow me to work on my live websites (via FTP/SFTP) and also automatically compile SASS within the editor.
With Sublime I have tried to get FTP/SFTP working with files/directories listed in sidebar and for them to load quickly.

So far I have been unable to come up with a solution… I have tried the wbond SFTP plugin (no sidebar but currently attempting to download my sites folder and work locally but taking forever), FTPSync plugin (didn’t work), ExpanDrive (too slow to load files/directories).

I also want to auto-compile SASS/SCSS (yet to test a plugin for this).

I really can’t find a text editor that will do this out of the box which is so surprising seeing as how I’m sure there are lots of people like me who wish to edit their live sites and have SASS modifications updated on the fly.

Can anyone share/recommend their setup that achieves this or recommend a text editor that will achieve this with ease? I am willing to pay anything!

0 Likes

#2

The problem is that most workflows have moved away from the cowboy technique of editing files right from a server.

Ideally, you would have your files locally, and when you save them (or the change), they are both compiled and uploaded to the server.

The easiest way would be to keep a local version of your sass, and then make a Gulp.js task to compile and upload everytime it changes. You can use gulp-sass and gulp-ftp to make this all automatic.

So - I know you don’t want to hear this, but it’s not really the job of your editor, it’s more part of your build system (which you can trigger from the editor if you want with the Gulp package).

0 Likes

#3

Okay thanks. It’s becoming more obvious that editing files on the server is a bit of a rash workflow.

Are you able to share workflow from a developer perspective? How do you go about building new/modifying existing sites (keeping in mind scss compilation) in terms of the tools you use?

0 Likes

#4

Use Git, Commit your code to it. Then make a script (Like Python Fabric) which SSH’s into your server and does a git pull. That’s a very simple way to do it.
You can use NodeJS + Gulp to compile your SASS to update everytime you save it.

0 Likes

#5

I am using unison for some time (cis.upenn.edu/~bcpierce/unison/) , it’s quite easy to setup and free (it requires one binary to be on server and on client but this is simple step). Unison can automatically do two-way sync (monitoring given path) but I am using hand-crafted plugin to trigger it after each save on changed file. Some configuration is needed to tell Unison that some paths should not be synced (like .git) but until you are not so stupid like me to work on Windows then installation is very simple (on Windows you have to do some binding to putty via plink)

The plugin “Sass Build” seems to work well, I had to install ruby and sass to run it but running command it’s simple and can be automated via:

sublime.active_window().run_command(‘build’, {“build_system”: “Packages/SASS Build/SASS.sublime-build”, “variant”: “”})

If you want I could publish code for unison with some instructions how to setup it (my setup is Windows with ST3 + Linux with dev server). You could add running the compile command via this snippet just before doing sync.

For any files automatic changes for Rails I use guard plugins:
github.com/hawx/guard-sass

0 Likes