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.
Extract files to your ~/.vim directory or use Tim Pope's pathogen.vim.
- Vim 7.0+ compiled with
+clientserver
- AsyncCommand
- red-green.vim
AsyncMakeGreen adds 1 new command to AsyncCommand:
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
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.