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


by NicoSantangelo ST2/ST3

Run Gulp tasks and snippets from Sublime Text



  • Total 7K
  • Win 3K
  • OS X 3K
  • Linux 1K
May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8
Windows 6 23 15 17 16 16 5 11 21 20 13 13 17 7 7 15 17 9 15 16 8 14 15 15 15 12 16 10 4 17 16 21 19 15 11 9 14 18 20 18 20 9 9 18 21 21
OS X 0 11 19 19 20 21 5 12 12 14 18 7 16 9 8 13 14 16 17 19 8 14 13 19 22 18 18 7 16 8 11 18 23 13 7 11 15 17 17 12 13 7 6 21 24 5
Linux 1 5 1 4 8 7 1 6 4 8 6 4 5 0 4 12 6 4 6 4 6 2 4 5 5 4 2 2 8 10 6 1 8 5 1 4 7 4 4 5 3 0 2 4 4 6



Sublime Gulp

A Gulp task runner with snippets for Sublime Text.

This package is a merge between Gulp Snippets from @filipelinhares and Gulp from NicoSantangelo (this last one, port of the awesome sublime-grunt).


Run Tasks

To run a task, first choose Gulp from the command pallete, the package will search for a gulpfile.js in an open folder and create a cache (.sublime-gulp.cache) with it (the first run might be a little slow).

The package will display all the tasks in a list, selecting one will run it (if you want, you can run specific tasks with a keyboard shortcut).

To show the task output the package uses a panel or a new tab (depends on your settings), you can add a key binding to open the panel (check the gulp_show_panel command).

Keep in mind that, the package creates the first cache using node, so for it to work you might need to add your node_modules path to NODE_PATH, for example (for Unix):

export NODE_PATH=/usr/local/lib/node_modules


The plugin wont work unless you have gulp defined on your gulpfile.

So if you can't find why Sublime Gulp isn't working be sure to at least have var gulp = require('gulp'); defined. More info (thanks @smeijer for the help)


If you want to use a gulpfile.coffee you need to do two things:

  1. Add module.exports = gulp to your gulpfile.coffee so node can use it
  2. Create a gulpfile.js if it doesn't exist and add this to it:
var gulp = require('./gulpfile.coffee');

That's it!. Thanks to @guillaume86 for the help in the issue #5

Mac OS X

It's possible that your path isn't being reported by your shell so if you're having troubles running the package, give SublimeFixMacPath a try.

Run Tasks (silent)

Works the same way as the normal Gulp command, but Gulp (silent) will not write the results on the output panel or tab.

Kill tasks

To kill running tasks like watch you can pick the command Gulp: Kill running tasks.


If you're running Windows, the package will use taskkill so every child process is correctly terminated. If the executable isn't on your system, you'll need to add it for this command to work correctly.

Show Panel

Shows the closed output panel (just the panel, it won't re-open the tab if you're using the show_results_in_new_tab setting).

List plugins

Running Gulp: List plugins from the command palette will display the gulp plugins on a searcheable list. Picking one will open it on your default browser.

Delete cache

Running Gulp: Delete cache will delete the .sublime-gulp.cache file for you, forcing a re-parsing of the gulpfile.js.



var gulp = require('gulp-name');



gulps - Docs


gulpt - Docs

gulp.task('name',['tasks'], function() {
    // content

gulpd - Docs


gulpw - Docs

gulp.watch('file', ['tasks']);

gulpwcb - Docs

gulp.watch('file', function(event) {
  console.log(' File '+event.path+' was '+event.type+', running tasks...');


The file SublimeGulp.sublime-settings is used for configuration, you can change your user settings in Preferences -> Package Settings -> Gulp -> Settings - User.

The defaults are:

    "exec_args": {},
    "gulpfile_paths": [],
    "results_in_new_tab": false,
    "results_autoclose_timeout_in_milliseconds": 0,
    "show_silent_errors": true,
    "log_erros": true,
    "syntax": "Packages/Gulp/syntax/GulpResults.tmLanguage",
    "nonblocking": true,
    "flags": {}


You may override your PATH environment variable as follows (from sublime-grunt):

    "exec_args": {
        "path": "/bin:/usr/bin:/usr/local/bin"


If set to true, a new tab will be used instead of a panel to output the results.


Additional paths to search the gulpfile in, by default only the root of each project folder is used. Example: ["src", "nested/folder"]


Defines the delay used to autoclose the panel or tab that holds the gulp results. If false (or 0) it will remain open, so if what you want if to keep it close check the silent command.


If true it will open the output panel when running Gulp(silent) only if the task failed


Toggles the creation of sublime-gulp.log if any error occurs.


Syntax file for highlighting the gulp results. You can pick it from from the command pannel as Set Syntax: Gulp results.

Set the setting to false if you don't want any colors (you may need to restart Sublime if you're removing the syntax).


When enabled, the package will read the streams from the task process using two threads, one for stdout and another for stderr. This allows all the output to be piped to Sublime live without having to wait for the task to finish.

If set to false, it will read first from stdout and then from stderr.


This seting lets you define custom flags for your gulp commands. The key is the name of the task and the value is the string containing the flags.

For example if you have to run build with the --watch flag, like this gulp build --watch you'll do:

    "flags": {
        "build": "--watch"

If you want to add a flag to a task just for a project, you can try binding a specific task.

Shortcut Keys

This package doesn't bind any command to a keyboard shortcut, but you can add it like this:

    { "keys": ["KEYS"], "command": "gulp" },

    { "keys": ["KEYS"], "command": "gulp_kill" },

    { "keys": ["KEYS"], "command": "gulp_show_panel" },

    { "keys": ["KEYS"], "command": "gulp_plugins" }

Bind specific tasks

You also can use a shortcut for running a specific task like this:

{ "keys": ["KEYS"], "command": "gulp", "args": { "task_name": "watch" } }

and if you want to run it in silent mode, you can add "silent" to the args

{ "keys": ["KEYS"], "command": "gulp", "args": { "task_name": "watch", "silent": true } }

Lastly, you can add a flag to the command using task_flag. This option will override the any flag defined on the settings file. If you set it to "" (empty string) it will run the command without flags.

{ "keys": ["KEYS"], "command": "gulp", "args": { "task_name": "build", "task_flag": "--watch" } }



If you have PackageControl installed, you can use it to install the package.

Just type cmd-shift-p/ctrl-shift-p to bring up the command pallete and pick Package Control: Install Package from the dropdown, search and select the package there and you're all set.


You can clone the repo in your /Packages (Preferences -> Browse Packages…) folder and start using/hacking it.

cd ~/path/to/Packages
git clone git://github.com/NicoSantangelo/sublime-gulp.git Gulp