Run shell script when saving file in Sublime Text 3

I'm just wondering if it is possible to run the shell script automatically when I press CTRL + S in Sublime Text 3 on Linux. This can be useful for generating CSS when modifying SASS, for example.

Thanks.

+7
linux shell sublimetext3
source share
1 answer

Check out SublimeOnSaveBuild . All you have to do is create a build system like SASS Build , LESS-build , Nodejs , etc. or your own build system so that it works without interference when you press Ctrl B. Then enter the data into the SublimeOnSaveBuild configuration file (which allows you to filter by file extension, so you only start it when saving .sass files, for example) and you are all set up - the assembly will run every time you save the file with the specified extension.

To configure a configuration file, first go to Preferences → Package Settings → SublimeOnSaveBuild → Settings - Default and copy all the contents. Close the file and paste the contents in Preferences → Package Settings → SublimeOnSaveBuild → Settings - User , setting up anything. Save the file and everything should continue automatically. Setting "build_on_save": 0 will disable the plugin.

+9
source share

All Articles