You are not logged in.
I am using a plugin called vim-latex (latex-suite) to compile LaTeX file directly in bim. I want that my LaTeX code compiles in the background, so I don't see the output and I can edit the file in vim in the meantime. I followed some other questions and so far I have got this:
noremap <leader>mm :AsyncMake<cr>
:autocmd BufEnter *.tex let &makeprg="latexmk -e '$pdflatex=q/pdflatex -synctex=1 -interaction=nonstopmode/' -pdf ".expand("<amatch>")
let g:Tex_DefaultTargetFormat = 'pdf'
let g:Tex_FormatDependency_pdf = 'pdf'
let g:Tex_CompileRule_pdf = 'pdflatex -synctex=1 --interaction=nonstopmode $* '
`\ll` compiles the latex file, but I have to wait for the compile to be over so I can continue editing my file and also I see the output on the whole screen.
I can press `\mm` and my code compiles in the background, but it doesn't use the default vim-latex command, so when I am not in the main.tex and call `\mm` I get errors (vim-latex handels that on it's own well). On the other hand, if I press `\ll` in the secondary file, everything compiles correcty (but I have to wait to compile).
`\ll` calls
\ll @<Plug>Tex_Compile
Is there a way to bind that command, so that it runs with this Async thing, or something else, if it's better.
Last edited by Mladia (2018-09-23 20:57:56)
Offline
I don't know anything about the 'vim-latex' plugin, I never saw any point in such things as they hide very very simple processes behind a load of complexity. I just bind a key to a latexmk command. If you wanted to run latexmk in the background and return to your document, you'd just bind a key to `latexmk &`.
In my case, my binding is the following (this is not backgrounded):
nmap <F5> ;w<CR>;silent !latexmk -quiet -pv "%"; latexmk -c "%"<CR><CR>;redraw!<CR>
To remove the preview, the 'write', and to background it (and to use the default : prefix):
nmap <F5> :silent !latexmk -quiet "%" &<CR>:redraw!<CR>
Last edited by Trilby (2018-09-23 15:47:16)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
but I have to wait for the compile to be over so I can continue editing my file and also I see the output on the whole screen.
This can be quite helpful when the compile fails and prints a helpful error message...
Offline
Well, that worked also. I redirect the output to copen
Last edited by Mladia (2018-09-23 21:10:37)
Offline