vim-rmarkdown
vim-rmarkdown copied to clipboard
Disowning the process from vim
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.
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.
@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.
Could it be like the vimtex background compile after save?
Yea something like that would be great, or even better would be live preview like NeoTex
@Urimu You don't really need a plugin for that, you can make it happen pretty easily with three pieces:
- An autosave plugin in the editor
- Any single command used to render your document (use a makefile or script if you need to splice several commands together.
- A utility like
entr
Here is an example I did a while pack using ionotifywait, but entr is much simpler: https://youtu.be/zCdDgtlBaTU