dotfiles/nvim/.config/nvim/plugin/personal/doccompile.vim

26 lines
750 B
VimL

function s:_compile(verbose, ...)
:execute(":w!")
if a:verbose
execute "!" . "compile" . " " . "%" . " " . join(a:000)
else
silent "!" . "compile" . " " . "%" . " " . join(a:000)
endif
endfunction
function s:_open(verbose, ...)
if a:verbose
execute "!" . "open-compiled" . " " . "%" . " " . join(a:000)
else
silent "!" . "open-compiled" . " " . "%" . " " . join(a:000)
endif
endfunction
function s:_compileopen(verbose, ...)
call s:_compile(<bang>0, <f-args>)
call s:_open(<bang>0, <f-args>)
endfunction
command -bang -nargs=* DocCompile call s:_compile(<bang>0, <f-args>)
command -bang -nargs=* DocCompileOpen call s:_compileopen(<bang>0, <f-args>)
command -bang -nargs=* DocOpen call s:_open(<bang>0, <f-args>)