vim-pandoc / vim-rmarkdown

Rmarkdown support for vim
98 stars 26 forks source link

Disowning the process from vim #29

Open broccoli5 opened 4 years ago

broccoli5 commented 4 years ago

I have added this to my .vimrc to compile rmarkdown

autocmd filetype rmd nnoremap <F5> :RMarkdown<Space>pdf<Space>latex_engine="pdflatex"<enter>

Which will render and open the pdf but the process is not disowned so I can't continue editing the file in vim. I tried adding <bar>&<Space>disown behind it but that just stops the rendering as the RMarkdown command reads it a another parameter.

alerque commented 4 years ago

I actually don't know the answer to this off the top of my head, but I'm sure there is a way to do it using either job control or a shell background function. This is a pretty general purpose question though, you might have better lock getting an answer on https://vi.stackexchange.com about how to background or disown an action like this.

If it turns out it has to to be done on the shell command then we probably need to setup an option of some kind to pass that through at the right point.

broccoli5 commented 4 years ago

@alerque Thanks for the tip, I asked the question on vi.stackexchange as you suggested I will see if I can resolve it and then add a comment with the solution if there is any.

otreblan commented 4 years ago

Could it be like the vimtex background compile after save?

broccoli5 commented 4 years ago

Yea something like that would be great, or even better would be live preview like NeoTex

alerque commented 4 years ago

@Urimu You don't really need a plugin for that, you can make it happen pretty easily with three pieces:

Here is an example I did a while pack using ionotifywait, but entr is much simpler: https://youtu.be/zCdDgtlBaTU