Added single shot compile command (solves #71)
This commit is contained in:
parent
df2ed5292b
commit
406e3725f6
@ -23,6 +23,7 @@ function! latex#latexmk#init(initialized) " {{{1
|
|||||||
" Define commands
|
" Define commands
|
||||||
"
|
"
|
||||||
com! -buffer VimLatexCompile call latex#latexmk#compile()
|
com! -buffer VimLatexCompile call latex#latexmk#compile()
|
||||||
|
com! -buffer VimLatexCompileSS call latex#latexmk#compile_singleshot()
|
||||||
com! -buffer VimLatexCompileToggle call latex#latexmk#toggle()
|
com! -buffer VimLatexCompileToggle call latex#latexmk#toggle()
|
||||||
com! -buffer VimLatexStop call latex#latexmk#stop()
|
com! -buffer VimLatexStop call latex#latexmk#stop()
|
||||||
com! -buffer VimLatexStopAll call latex#latexmk#stop_all()
|
com! -buffer VimLatexStopAll call latex#latexmk#stop_all()
|
||||||
@ -147,6 +148,35 @@ function! latex#latexmk#compile() " {{{1
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" }}}1
|
||||||
|
function! latex#latexmk#compile_singleshot() " {{{1
|
||||||
|
let data = g:latex#data[b:latex.id]
|
||||||
|
|
||||||
|
if data.pid
|
||||||
|
echomsg "latexmk is already running for `" . data.base . "'"
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:latex_latexmk_continuous = g:latex_latexmk_continuous
|
||||||
|
let g:latex_latexmk_continuous = 0
|
||||||
|
call s:latexmk_set_cmd(data)
|
||||||
|
let g:latex_latexmk_continuous = l:latex_latexmk_continuous
|
||||||
|
|
||||||
|
" Start latexmk
|
||||||
|
let exe = {}
|
||||||
|
let exe.null = 0
|
||||||
|
if !g:latex_latexmk_background
|
||||||
|
let exe.bg = 0
|
||||||
|
let exe.silent = 0
|
||||||
|
endif
|
||||||
|
let exe.cmd = data.cmds.compile
|
||||||
|
call latex#util#execute(exe)
|
||||||
|
|
||||||
|
if g:latex_latexmk_background
|
||||||
|
echomsg 'latexmk compiling'
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
" }}}1
|
" }}}1
|
||||||
function! latex#latexmk#errors(force) " {{{1
|
function! latex#latexmk#errors(force) " {{{1
|
||||||
cclose
|
cclose
|
||||||
|
@ -242,6 +242,7 @@ Below the commands are listed in alphabetical order.
|
|||||||
VimLatexClean call latex#latexmk#clean()
|
VimLatexClean call latex#latexmk#clean()
|
||||||
VimLatexClean! call latex#latexmk#clean(1)
|
VimLatexClean! call latex#latexmk#clean(1)
|
||||||
VimLatexCompile call latex#latexmk#compile()
|
VimLatexCompile call latex#latexmk#compile()
|
||||||
|
VimLatexCompileSS call latex#latexmk#compile_singleshot()
|
||||||
VimLatexCompileToggle call latex#latexmk#toggle()
|
VimLatexCompileToggle call latex#latexmk#toggle()
|
||||||
VimLatexErrors call latex#latexmk#errors(1)
|
VimLatexErrors call latex#latexmk#errors(1)
|
||||||
VimLatexHelp call latex#help()
|
VimLatexHelp call latex#help()
|
||||||
@ -657,7 +658,9 @@ Compilation is started with |latex#latexmk#compile| or may be toggled by
|
|||||||
|latex#latexmk#toggle|. The default behaviour uses preview continuous mode of
|
|latex#latexmk#toggle|. The default behaviour uses preview continuous mode of
|
||||||
`latexmk`, which may be disabled with |g:latex_latexmk_continuous|. If it is
|
`latexmk`, which may be disabled with |g:latex_latexmk_continuous|. If it is
|
||||||
disabled, then the option |g:latex_latexmk_background| may be used to decide
|
disabled, then the option |g:latex_latexmk_background| may be used to decide
|
||||||
if the single shot compilation should run in the foreground or the background.
|
if single shot compilation should run in the foreground or the background.
|
||||||
|
Single shot compilation may always be issued with the function
|
||||||
|
|latex#latexmk#compile_singleshot|.
|
||||||
|
|
||||||
If vim is compiled with the |+clientserver| option and if
|
If vim is compiled with the |+clientserver| option and if
|
||||||
|g:latex_latexmk_callback| is enabled, then compilation errors are parsed
|
|g:latex_latexmk_callback| is enabled, then compilation errors are parsed
|
||||||
@ -680,6 +683,7 @@ Associated settings:
|
|||||||
Functions:
|
Functions:
|
||||||
|latex#latexmk#clean|
|
|latex#latexmk#clean|
|
||||||
|latex#latexmk#compile|
|
|latex#latexmk#compile|
|
||||||
|
|latex#latexmk#compile_singleshot|
|
||||||
|latex#latexmk#errors|
|
|latex#latexmk#errors|
|
||||||
|latex#latexmk#output|
|
|latex#latexmk#output|
|
||||||
|latex#latexmk#status|
|
|latex#latexmk#status|
|
||||||
@ -867,6 +871,7 @@ Overview:~
|
|||||||
|latex#info|
|
|latex#info|
|
||||||
|latex#latexmk#clean|
|
|latex#latexmk#clean|
|
||||||
|latex#latexmk#compile|
|
|latex#latexmk#compile|
|
||||||
|
|latex#latexmk#compile_singleshot|
|
||||||
|latex#latexmk#errors|
|
|latex#latexmk#errors|
|
||||||
|latex#latexmk#output|
|
|latex#latexmk#output|
|
||||||
|latex#latexmk#status|
|
|latex#latexmk#status|
|
||||||
@ -958,6 +963,10 @@ output files. This will only be run if `latexmk` is not already running.
|
|||||||
*latex#latexmk#compile*
|
*latex#latexmk#compile*
|
||||||
Starts `latexmk -pvc ...` for the given buffer, if it is not already running.
|
Starts `latexmk -pvc ...` for the given buffer, if it is not already running.
|
||||||
|
|
||||||
|
*latex#latexmk#compile_singleshot*
|
||||||
|
Starts a single shot compile with `latexmk ...` for the given buffer (if it is
|
||||||
|
not already running).
|
||||||
|
|
||||||
*latex#latexmk#errors*
|
*latex#latexmk#errors*
|
||||||
Parse the log file for errors and warnings. If any errors or warnings are
|
Parse the log file for errors and warnings. If any errors or warnings are
|
||||||
found, they are displayed in the quickfix window. The exact behaviour is
|
found, they are displayed in the quickfix window. The exact behaviour is
|
||||||
|
Loading…
x
Reference in New Issue
Block a user