Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions plugin/makegreen.vim
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,19 @@ hi RedBar term=reverse ctermfg=white ctermbg=red guifg=white guibg=red

function MakeGreen(...) "{{{1
let arg_count = a:0
if arg_count
let make_args = a:1

if exists("g:makegreen_stay_on_file") && g:makegreen_stay_on_file
let make_command = "make!"
else
let make_args = '%'
let make_command = "make"
endif

silent! w " TODO: configuration option?
silent! exec "make " . make_args
if arg_count
silent! exec make_command . " " . a:1
else
silent! exec make_command
endif

redraw!

Expand Down Expand Up @@ -72,13 +77,7 @@ function s:Bar(type, msg)
echohl None
endfunction

" }}}1
" Mappings" {{{1

if !hasmapto('MakeGreen')
map <unique> <silent> <Leader>t :call MakeGreen()<cr>
endif
" }}}1
:command -nargs=* MakeGreen :call MakeGreen(<q-args>)

let &cpo = s:save_cpo
unlet s:save_cpo
Expand Down