From 177b78b201fe3b12a15b102d63cbb2b00e6c3485 Mon Sep 17 00:00:00 2001 From: Renan Ivo Date: Sun, 1 Jan 2012 20:22:37 -0200 Subject: [PATCH 1/4] remove plugin mapping to avoid conflicts with user defined mappings --- plugin/makegreen.vim | 7 ------- 1 file changed, 7 deletions(-) diff --git a/plugin/makegreen.vim b/plugin/makegreen.vim index 16710d2..f7dbc33 100644 --- a/plugin/makegreen.vim +++ b/plugin/makegreen.vim @@ -72,13 +72,6 @@ function s:Bar(type, msg) echohl None endfunction -" }}}1 -" Mappings" {{{1 - -if !hasmapto('MakeGreen') - map t :call MakeGreen() -endif -" }}}1 let &cpo = s:save_cpo unlet s:save_cpo From 523c122dd43a54c143264413757fc260324a2073 Mon Sep 17 00:00:00 2001 From: Renan Ivo Date: Sun, 1 Jan 2012 20:37:52 -0200 Subject: [PATCH 2/4] add command :MakeGreen to be easier to use/map --- plugin/makegreen.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/makegreen.vim b/plugin/makegreen.vim index f7dbc33..54475df 100644 --- a/plugin/makegreen.vim +++ b/plugin/makegreen.vim @@ -72,6 +72,7 @@ function s:Bar(type, msg) echohl None endfunction +:command MakeGreen :call MakeGreen() let &cpo = s:save_cpo unlet s:save_cpo From d3cbbc6237b980c6a57c8bdc5b2948f164460b4f Mon Sep 17 00:00:00 2001 From: Renan Ivo Date: Sun, 1 Jan 2012 20:54:01 -0200 Subject: [PATCH 3/4] stop passing % as argument to make. Allow ":MakeGreen %". --- plugin/makegreen.vim | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugin/makegreen.vim b/plugin/makegreen.vim index 54475df..4d6d4fb 100644 --- a/plugin/makegreen.vim +++ b/plugin/makegreen.vim @@ -22,15 +22,14 @@ hi RedBar term=reverse ctermfg=white ctermbg=red guifg=white guibg=red function MakeGreen(...) "{{{1 let arg_count = a:0 + + silent! w " TODO: configuration option? if arg_count - let make_args = a:1 + silent! exec "make " . a:1 else - let make_args = '%' + silent! exec "make" endif - silent! w " TODO: configuration option? - silent! exec "make " . make_args - redraw! let error = s:GetFirstError() @@ -72,7 +71,7 @@ function s:Bar(type, msg) echohl None endfunction -:command MakeGreen :call MakeGreen() +:command -nargs=* MakeGreen :call MakeGreen() let &cpo = s:save_cpo unlet s:save_cpo From 0a4ae2537d58f0942c0723102467f6266727766f Mon Sep 17 00:00:00 2001 From: Renan Ivo Date: Mon, 23 Jul 2012 02:37:43 -0300 Subject: [PATCH 4/4] add option g:makegreen_stay_on_file g:makegreen_stay_on_file (Default value 0) When the value is different of zero, adds a bang to the make command (make!) so it does not jumps to the first error after been executed. --- plugin/makegreen.vim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugin/makegreen.vim b/plugin/makegreen.vim index 4d6d4fb..6bae305 100644 --- a/plugin/makegreen.vim +++ b/plugin/makegreen.vim @@ -23,11 +23,17 @@ hi RedBar term=reverse ctermfg=white ctermbg=red guifg=white guibg=red function MakeGreen(...) "{{{1 let arg_count = a:0 + if exists("g:makegreen_stay_on_file") && g:makegreen_stay_on_file + let make_command = "make!" + else + let make_command = "make" + endif + silent! w " TODO: configuration option? if arg_count - silent! exec "make " . a:1 + silent! exec make_command . " " . a:1 else - silent! exec "make" + silent! exec make_command endif redraw!