Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disowning the process from vim #29

Open
broccoli5 opened this issue Mar 25, 2020 · 5 comments
Open

Disowning the process from vim #29

broccoli5 opened this issue Mar 25, 2020 · 5 comments

Comments

@broccoli5
Copy link

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
Copy link
Member

alerque commented Mar 25, 2020

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
Copy link
Author

@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
Copy link

Could it be like the vimtex background compile after save?

@broccoli5
Copy link
Author

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

@alerque
Copy link
Member

alerque commented Mar 30, 2020

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants