I'm setting up an environment to automatically recompile .tex
files on save. I've found solution for this:
autocmd BufWritePost *.tex :! latexmk -pdf
But is there any better way to do this? It seems like *.tex
check will be executed every time I save a file, be it .c
or .md
file (maybe I'm wrong about this). Could I possibly place this option somewhere so it is executed only when I save .tex
files? Something like ftplugin/tex.vim
(I couldn't make it working there).