0

When right-clicking on a link to a local PDF file (e.g. the line in a markdown file shown below), it is opened as a text file. How can this behavior be modified such that an external viewer (xpdf, evince) is launched?

[@samplefile](../bibliography/samplefile.pdf)  

With tasks and the field below, I manage to define a new entry, which opens the viewer, but not the file:

"command": "xpdf ${FOLDER_NAME:file}",

Edit: arguments can be explicitly given in a different field, like

"command": "xpdf",
"args": [
  "-fullscreen",
  "../bibliography/${selectedText}.pdf"
],
nightcod3r
  • 752
  • 1
  • 7
  • 26
  • currently using version 3.04, not implementing open. tried with evince, same result, it does not open the file (only the viewer). – nightcod3r May 10 '23 at 21:55
  • you're right. but isn't there a way to just tell vs that the application to open a local file when clicking a link is a viewer, or the browser itself, as it is the case with URLs? – nightcod3r May 10 '23 at 22:16
  • 1
    found out that arguments can be given as a separate field, see updated question. now this opens xpdf with the file given by the selected text. (thx for those 20+ minutes!) – nightcod3r May 10 '23 at 22:52
  • 1
    in this case it's the methodology that imposes how to proceed: a md file that includes references to papers (`[@mypaper]`), created, edited and visualized in vscodium, and in this process sometimes you need to check the paper itself, so by selecting `mypaper` you get it opened. only thing is that now selecting and key pressing are needed, it would be perfect if it opens by simply double-clicking on the reference. – nightcod3r May 11 '23 at 05:25

0 Answers0