vim-makegreen


Ⅰ. 插件描述

MakeGreen runs make and shows a red or green message bar for success/failure. Speeds the red-green-refactor cycle!

Ⅱ. 基本信息

创建日期:  2009-04-18
使用用户:  3
Github星:  1
插件作者:  Renan Ivo

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'renanivo/vim-makegreen-the-lucky-one'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'renanivo/vim-makegreen-the-lucky-one'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'renanivo/vim-makegreen-the-lucky-one'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/renanivo/vim-makegreen

Ⅳ. 文档说明

vim-MakeGreen

makegreen.vim is a vim (http://www.vim.org) plugin that runs make and shows the
test run status with a red or green bar.

Installation

Copy all files to your ~/.vim directory or use Tim Pope's excellent pathogen plugin (http://github.com/tpope/vim-pathogen).

Usage

<Leader>t will run make for the current file and show its status with a red or green message bar.

example:

$ cd <your rails/merb root>
$ vim test/unit/user_test.rb

:compiler rubyunit
press <Leader>t

(<Leader> is mapped to '' by default)

Default Key Bindings

<Leader>t: run make and show red/green bar

You can change default key bindings:

map <Leader>] <Plug>MakeGreen " change from <Leader>t to <Leader>]

Configuring Vim's Makeprg

MakeGreen expects your make program to accept the current file name as its

  1. Specifically, if :make % works, MakeGreen will work.

Using Compilers

The easiest way to use MakeGreen is with compilers. For instance, vim's ruby
configuration files provide an rspec compiler that sets makeprg and errorformat
appropriately for running specs and parsing their output.

You can tell vim to use the rspec compiler for all *_spec.rb files by adding
this line to your vimrc:

  autocmd BufNewFile,BufRead *_spec.rb compiler rspec

Then :make % (make current file) and MakeGreen will work automatically when
you are in a spec.

Specifying Make Arguments

By default, MakeGreen will run :make %. If you'd like to pass custom
arguments to :make, bind a key to call :MakeGreen('my args'). This will
also remove the default key mapping.

Credits

modified for this more specific purpose.

modified for my use. Please do check out Gary's coding videos on his blog
for more awesome vim usage (http://blog.extracheese.org/).

  • elik and godlygeek in #vim on irc.freenode.net for vim help
  • Jim Remsik (@jremsikjr on twitter) for debugging and typo fixing.

Contributors

Rein Henrichs
Gary Bernhardt

添加新评论