Skip to content

Command Line Tool

Linwei edited this page Feb 28, 2020 · 28 revisions

This plugin provides you an asyncrun.py script (in the bin folder) when you want to run tasks right in your shell

Setup

To use it, copy the files from bin to /usr/local/bin or ~/bin, or simpily add bin folder to your $PATH in bashrc.

Usage

Then, in any child directories of your project, just type:

$ asynctask project-build

You don't have to jump back to your project root manually, because profile-build has a cwd=<root>.

Command

$ asynctask <taskname> [path]

Run the given task with the path, the path can be either a file name or a directory. It is used to extract macros like $(VIM_FILENAME) or $(VIM_ROOT), if path is omitted, current working directory will be used:

$ asynctask project-build .
$ asynctask project-build

The two commands works exactly the same way. The two below are also equivalent:

$ asynctask project-build ../project2
$ cd ../project2 && asynctask project-build && cd -

More examples:

# run with a file name, for tasks containing $(VIM_FILENAME), $(VIM_FILEPATH) ...
$ asynctask file-build hello.c

# run with a path, when the path is omitted, current cwd is used.
$ asynctask project-build ../project2

# build with "release" profile
$ asynctask -profile=release project-build

# run with interactive mode
$ asynctask -i

# use fzf to select tasks
$ asynctask -f

Interactive mode with fzf:

Bonus: use -i and -f with asynctask can allow interactive mode and you can select task with fzf.

Clone this wiki locally