asyncrun.vim
asyncrun.vim copied to clipboard
texcompiler latexmk is not working properly
Hi,
I use asyncrun to run and compile all my codes, as:
" AsyncRun {{{
" Quick run via <F10>
nnoremap <F10> :call <SID>compile_and_run()<CR>
inoremap <buffer> <F10> <Esc> :call <SID>compile_and_run()<CR>
function! s:compile_and_run()
exec 'w'
if &filetype == 'c'
exec "AsyncRun! gcc % -o %<; time ./%<"
elseif &filetype == 'fortran'
exec "AsyncRun! gfortran -Wall % -o %<; time ./%<"
" elseif &filetype == 'tex'
" exec "AsyncRun! latexmk -pdflatex=lualatex -pdf -interaction=nonstopmode -pv -quiet -synctex=1 -shell-escape %"
elseif &filetype == 'sh'
exec "AsyncRun! time bash %"
elseif &filetype == 'python'
exec "AsyncRun! time python3 %"
endif
endfunction
let g:asyncrun_open = 15
"}}}
But, while this is working well for fortran or sh or python, tex is not working properly.
Instead of asyncrun, if I use it normally as:
au FileType tex nnoremap <buffer> <F10> :up!<cr>:! latexmk -pdflatex=lualatex -pdf -pv -quiet -synctex=1 -shell-escape %<CR><Esc>
then it is working as intended. Please let me know how to use it.
"not working properly" ? what's that exactly ? any error output ?
Error is "Backgrond job is still running". Actually, it comes and goes so fast in gvim's quickfix window, its hard to check.
Has it started any desktop gui app which is still running in the background ??
Did you see any
[Finished in xx seconds]
message in the quickfix window ?
The latexmk -pv opens evince, and it is persistance in the background.
So, the background job is still running, you can fixed it by starting evince before this.
While I can definitely do that, I was looking for some way to use <Esc>, as I have done in my au command, which is working.