Ⅰ. 插件描述
Vim plugin to asynchronously run make and display a green/red bar on success/failureⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'jimf/vim-async-make-green'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'jimf/vim-async-make-green'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'jimf/vim-async-make-green'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/jimf/vim-async-make-green
Ⅳ. 文档说明
vim-AsyncMakeGreen
AsyncMakeGreen is the conceptual marrying of AsyncCommand and makegreen.vim. It provides the means to run makeprg asynchronously, and once the command finishes, display a green bar on success or a red bar on error, jumping to the line of failure.
Installation
Extract files to your ~/.vim directory or use Tim Pope's pathogen.vim.
Requirements
- Vim 7.0+ compiled with
+clientserver - AsyncCommand
- red-green.vim
Usage
AsyncMakeGreen adds 1 new command to AsyncCommand:
AsyncMakeGreen
run make against a target and display a green bar on success or a red bar on failure, jumping to the line
Example:
function! MakeTest(target)
if filereadable('./Makefile')
silent ! echo
exec "set makeprg=make\\ NOSE='bin/nosetests\\ --no-color\\ --machine-out'"
set errorformat=%f:%l:\ fail:\ %m
exec "AsyncMakeGreen " . a:target
endif
endfunction
au BufWritePost * if &filetype == "python" | call MakeTest('unit-test') | endif
Configuration
The behavior of this plugin can be tweaked by modifying the following variables:
let g:async_make_green_success_prefix = ' ✓ '
let g:async_make_green_failure_prefix = ' ✖ '
let g:async_make_green_default_success_text = 'All tests passed'
let g:async_make_green_use_make_output_on_success = 0
To modify the bar colors, see the red-green.vim README
Additionally, see :help switchbuf to customize the way the splits from this plugin behave.