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

Docs: MyPandocOpen custom_open - use existing viewer instance #435

Open
ccaprani opened this issue Sep 2, 2022 · 0 comments
Open

Docs: MyPandocOpen custom_open - use existing viewer instance #435

ccaprani opened this issue Sep 2, 2022 · 0 comments

Comments

@ccaprani
Copy link

ccaprani commented Sep 2, 2022

I use this mostly for writing presentations in markdown files for beamer. I've used the custom_open hook to open the rendered PDF, but it's a bit of a nuisance that it opens a new instance of the viewer each time.

I use zathura, and I came across this and adapted it, and it could be a useful addition to the docs, at least for zathura and/or markdown users:

function! MyPandocOpen(file)
        let position = line('.') . ":" . col('.') . ":" . expand('%:p') . " "
        return "zathura -x 'nvr --remote +%{line} %{input}' --synctex-forward " . position . " " . substitute(expand('%:p'),"md$","pdf", "")
        "" return 'xdg-open '. a:file
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant