Ⅰ. 插件描述
vim plugin for pants integrationⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'edma2/vim-pants-ours'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'edma2/vim-pants-ours'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'edma2/vim-pants-ours'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/edma2/vim-pants
Ⅳ. 文档说明
Overview
A vim plugin for Pants build tool.
The core utility provided is the Pants command.
Invoke it like so
:Pants [goal] [target] ...The default goal is "compile".
The default target is inferred from the current file's parent BUILD file.
When run with one argument, replace the default goal with the given argument.
When run with two arguments, replace the default goal with the first argument,
and default target with the second argument. The target syntax is described
here; you can use '.' as
an alias for the default target (see the example below). When run with more
than two arguments, set the goal and target as described above using the first
two arguments, and pass the remaining arguments to Pants.
Errors and warnings will be loaded in a quickfix list once Pants finishes
running.
Uses vim-dispatch if present. This is
highly recommended (along with tmux) to avoid blocking the entire editor when
Pants runs.
Additionally, a convenience command, :Junit, is provided to run the
current file as a JUnit test suite (only if file ends with Test.scala or
Spec.scala).
Examples
Compile the default target; its sources will include the current file:
:PantsRun the tests in foobird target (from project root)
:Pants test foobird:testsStart a new REPL (especially useful as a split window if vim-dispatch is used)
using the classpath of the default target:
:Pants replCompile a different target within the parent BUILD file ("foo") instead of
using the default target (the target matching the parent directory's name).
Also pass some additional arguments to Pants.
:Pants compile .:foo -arg1 -arg2Run current file as JUnit test suite:
:Junit