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
  • 38 minutes ago
  • 4 years ago

Installs

  • Total 33K
  • Win 17K
  • OS X 12K
  • Linux 4K
Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25 Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4 Aug 3 Aug 2 Aug 1 Jul 31 Jul 30 Jul 29 Jul 28 Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21
Windows 11 31 45 36 25 19 20 39 39 38 29 26 18 18 31 25 24 31 29 11 16 22 31 24 25 39 12 19 37 29 37 38 42 19 15 31 40 40 36 41 17 26 46 43 40 50
OS X 10 16 22 21 10 6 14 20 21 23 28 23 13 7 15 14 19 16 11 2 9 13 20 22 19 17 10 8 19 10 20 18 22 7 6 21 15 18 17 17 6 24 17 23 17 12
Linux 2 7 7 5 6 2 4 3 7 2 8 6 3 2 9 10 6 5 3 1 2 7 9 5 4 4 2 5 5 11 9 5 9 9 2 6 10 4 10 3 4 5 3 1 5 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!