Vimtex: Workaround for single-shot compilation with callback

Created on 26 Jan 2017  路  5Comments  路  Source: lervag/vimtex

I recently switched from Latex-Box and I prefer single-shot compilation since I am sometimes working on large Beamer presentations with very long compile times. However, not having callbacks is inconvenient. Here's my workaround, which seems to have the behavior I want:

" .vimrc
let g:vimtex_latexmk_continuous = 1
let g:vimtex_latexmk_callback_hooks = ['SingleShotWithCallback']
function! SingleShotWithCallback(status)
    silent call vimtex#latexmk#stop()
endfunction

Is there a reason this couldn't be built into vimtex by e.g. always setting -pvc and calling vimtex#latexmk#stop() after compilation when single-shot behavior is desired?

Most helpful comment

I've added this now. If possible, it uses your suggested method, and if not, it reverts to the old method.

All 5 comments

Interesting. I never thought of this, and it actually looks like a very good idea. I'll look into it later when I get more time.

Note, though: This relies heavily on the vim clientserver, and so I should probably keep the current implementation just in case, but I could add this as an alternative in cases where it should work.

I've added this now. If possible, it uses your suggested method, and if not, it reverts to the old method.

This is great! It should be changed in the documentation too: https://github.com/lervag/vimtex/blob/78e062c20163cc5700cff40f27175e789de38982/doc/vimtex.txt#L664


Edit:

This also seems wrong, I have single-shot compilations right now and the quickfix window is still opened:

https://github.com/lervag/vimtex/blob/78e062c20163cc5700cff40f27175e789de38982/doc/vimtex.txt#L1344-L1345


Edit:

And this:

https://github.com/lervag/vimtex/blob/78e062c20163cc5700cff40f27175e789de38982/doc/vimtex.txt#L1539-L1541

Thanks. I tried to improve this now.

Thank you. 馃槃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lervag picture lervag  路  5Comments

carloabelli picture carloabelli  路  3Comments

LuxGiammi picture LuxGiammi  路  3Comments

chakravala picture chakravala  路  5Comments

benutzer193 picture benutzer193  路  4Comments