ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Sublime​On​Save​Build

by alexnj ST2/ST3

Trigger a build the moment you save a file in Sublime Text 2. Works best with web projects that make use of Less, Compass and any other pre-processor or a makefile.

Details

  • 2013.06.25.18.10.47
  • github.​com
  • github.​com
  • 2 years ago
  • 45 minutes ago
  • 4 years ago

Installs

  • Total 31K
  • Win 16K
  • OS X 11K
  • Linux 4K
Jul 28 Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13
Windows 13 41 17 26 46 43 40 50 29 40 22 27 22 38 26 53 17 18 26 24 50 29 36 12 13 21 36 42 29 24 17 6 28 41 27 44 33 19 12 33 19 30 31 49 18 12
OS X 8 17 6 24 17 23 17 12 15 19 9 26 13 18 19 26 6 12 13 17 29 13 23 12 10 16 18 29 14 11 7 9 10 27 26 20 19 7 13 14 14 18 19 22 5 7
Linux 3 3 4 5 3 1 5 7 4 2 2 9 4 3 2 9 4 1 2 4 11 8 6 3 4 4 2 6 6 10 8 5 10 6 2 2 7 2 5 11 13 5 9 9 6 7

Readme

Source
raw.​githubusercontent.​com

SublimeOnSaveBuild Sublime Plugin

This is a simple plugin for Sublime Text 2 to trigger a build on each save.

Not all projects might need this plugin, especially if the build operation is lengthy. However, if you have a build that does things like pre-processing CSS via tools like LessCSS and stitching all JS files together, this might be very handy.

Installation

With the Package Control plugin: The easiest way to install SublimeOnSaveBuild is through Package Control, which can be found at this site: http://wbond.net/sublime_packages/package_control

Once you install Package Control, restart ST2 and bring up the Command Palette (Command+Shift+P on OS X, Control+Shift+P on Linux/Windows). Select “Package Control: Install Package”, wait while Package Control fetches the latest package list, then select SublimeOnSaveBuild when the list appears. The advantage of using this method is that Package Control will automatically keep SublimeOnSaveBuild up to date with the latest version.

Without Git: Download the latest source from GitHub and copy the SublimeOnSaveBuild folder to your Sublime Text 2 “Packages” directory.

With Git: Clone the repository in your Sublime Text 2 “Packages” directory:

git clone git://github.com/alexnj/SublimeOnSaveBuild.git

The “Packages” directory is located at:

  • OS X:

    ~/Library/Application Support/Sublime Text 2/Packages/
    
  • Linux:

    ~/.config/sublime-text-2/Packages/
    
  • Windows:

    %APPDATA%/Sublime Text 2/Packages/
    

Configuring

There are a number of configuration options available to customize the behavior of SublimeOnSaveBuild. For the latest information on what options are available, select the menu item Preferences->Package Settings->SublimeOnSaveBuild->Settings - Default.

Do NOT edit the default SublimeOnSaveBuild settings. Your changes will be lost when SublimeOnSaveBuild is updated. ALWAYS edit the user SublimeOnSaveBuild settings by selecting Preferences->Package Settings->SublimeOnSaveBuild->Settings - User.

  • build_on_save Set to 1 to trigger a build on save. By default, this is set to 1. I.e., SublimeOnSaveBuild attempts to build all projects. You can change this behavior and build only specific projects by configuring the user specific setting of build_on_save to 0 and project specific setting to 1.

  • filename_filter SublimeOnSaveBuild matches the name of the file being saved against this regular expression to determine if a build should be triggered. By default, the setting has a value of "\\.(css|js|sass|less|scss)$".

Usage

  1. Make sure you have a build operation set up in your Sublime Text 2 project and you are able to build using Control+B (Linux/Windows) or Command+B (OS X).
  2. Hit your favorite shortcut to Saveit should trigger a build.

Good luck!