Starting from version
0.8.0the plugin uses semantic versionning 2.0.0.
This plugin is a simple gulp wrapper for vim.
- Run gulp inside Vim.
- Run gulp in the backgound using an external terminal without losing focus.
- Run gulp using a custom shell or vim command.
- List your gulp tasks.
- Support different gulpfiles (
- CtrlP integration provided.
- Unite source provided.
- Use your own fuzzy finder plugin.
- Works on GNU/Linux and Windows.
Use your preferred method to install the plugin. I recommend you to use a plugin manager.
e.g with Vim-plug
This is not mandatory, but the plugin can use Tpope's Dispatch plugin if its installed (P.S: This integration will be removed in 1.0.0, the
g:gv_custom_cmd is a better choice).
Gulp-vim provides 2 main commands:
Both commands accept 0 or many arguments (Task name(s)), that can be completed using
<Tab>. If no task name is provided, 'default' will be used.
:Gulp [task(s)...] :GulpExt [task(s)...]
Gulpexecutes gulp inside Vim.
GulpExtby default executes gulp in an external terminal:
- The default one via
exo-openin GNU/Linux or a simple
- Use a defined user command.
- Use Dispatch if its installed (WILL BE REMOVED IN 1.0.0).
===> Unix only: (G)Vim doesn't lose focus if wmctrl is installed.
- The default one via
Don't use gulp watching tasks with the command
<Ctrl-C> to stop it), use
You can execute gulp tasks with CtrlP (Works only if CtrlP is installed of course). Check the configuration.
gulp Unite source is provided, see configuration.
:Unite -buffer-name=gulp gulp
Use another fuzzy finder plugin
Its quite simple to use your favourite fuzzy finder plugin, all what you need is
Some examples in the wiki.
Shows a list of your gulp task names (Extracted from the current
:GulpFile [path/to/gulpfile | gulpfile] " gulpfile.js by default
Set the gulpfile to use (Can be a name:
gulpfile.babel.js, or a(n) absolute/relative path to a gulpfile).
GulpFile is used without argument, it set back its value to the default one:
(In fact, this command just assign a value to
If you're using rvm in GNU/Linux, when using
GulpExt or a custom command, rvm shell functions will not be exported so your gems and some gulp plugins will not work (
gulp-compass as an example).
To get rid of that add to your vimrc:
let g:gv_rvm_hack = 1
If its not working, consider using Tpope's vim-rvm plugin.
Go back to the shell prompt
By default with
GulpExt, when the gulp task is completed, the terminal is closed.
If you want to go back to the shell prompt after executing the task, add to your vimrc:
let g:gv_return_2_prompt = 1
P.S: If you are using a custom command it will not work.
Specify the gulpfile
If needed, you can specify the gulpfile to use with
g:gv_default_gulpfile variable (By default, it's
let g:gv_default_gulpfile = 'gulpfile.coffee' " Or let g:gv_default_gulpfile = 'gulpfile.babel.js'
Note that the gulpfile can be dynamically defined using the command
THIS INTEGRATION WILL BE REMOVED IN 1.0.0
By default if the plugin Dispatch is installed, the command
GulpExt will use
Start! to execute Gulp, this means:
- In Linux: If you're in tmux, a new window will be created otherwise the default terminal will be open.
- In Windows: A minimized cmd.exe window is spawned.
You can disable this integration by setting
let g:gv_use_dispatch = 0
You can specify which gulp-vim command to use with
Gulp by default)):
let g:gv_ctrlp_cmd = 'GulpExt'
You can specify which gulp-vim command to use with the
gulp Unite source action (
Gulp by default)):
let g:gv_unite_cmd = 'GulpExt'
You can specify a custom command to use with
This variable can be a list or a string where
%s will be replaced by the adequate shell command.
It can be a vim command (If you want to use external vim plugin) or a shell command.
let g:gv_custom_cmd = 'Start! %s'
Be aware that the gulp shell command can contain double quotes, so if you need to escape them use a list instead of a string and define its 2nd element to 1.
e.g using Vimux plugin:
let g:gv_custom_cmd = ['VimuxRunCommand "clear && %s"', 1]
More examples can be found on the wiki.
By default, when one of the main commands is executed, the plugin searches for a
gulpfile.js file (Or the one defined by either
g:gv_default_gulpfile or the command
GulpFile) in the following order:
- In the current vim working directory (
- Traverse up from the cwd.
- Traverse up from the current file directory.
The plugin parse and extract task names from the gulpfile to provide command completion (This method is quicker than using
GulpExtinto one command
let g:gv_rvm_hack = 1 let g:gv_use_dispatch = 0 " Use vimux on Linux & dispatch on windows let g:gv_custom_cmd = has('unix') ? \ ['VimuxRunCommand "clear && %s"', 1] : \ 'Start! %s' let g:gv_ctrlp_cmd = 'GulpExt' nnoremap ,g :CtrlPGulp<CR>
Thanks to gulp author(s).
Thanks to Bram Moolenaar for creating the best piece of software in the world
Thanks to you if you're using gulp-vim.