Skip to content
MakeGreen runs make and shows a red or green message bar for success/failure. Speeds the red-green-refactor cycle!
Find file
Pull request Compare This branch is 2 commits ahead, 14 commits behind reinh:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


makegreen.vim is a vim ( plugin that runs make and shows the test run status with a red or green bar.

Mitechie Fork

Check the original for the real deal. This is me tweaking how it runs the files based on my usage. I keep a matching test file for files I'm working on. So for file I'll have So it prepends test_ to the filenames.

I also often want to rerun the tests while I'm on the test file itself, so it will catch that I'm on a test file and just rerun it.


Copy all files to your ~/.vim directory or use Tim Pope's excellent pathogen plugin (


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


$ 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 argument. 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.


Something went wrong with that request. Please try again.