I want to open pdf files using their file links from Vim in the default pdf viewer application which is Preview on my osx.
There is gf
normal command to open a file link inside Vim. But pdf files should be opened in an external application.
Right-click the PDF, choose Open With > Choose default program or another app in. 2. Choose Adobe Acrobat Reader DC or Adobe Acrobat DC in the list of programs, and then do one of the following: (Windows 10) Select Always use this app to open .
This tip shows how to use Vim to view the text in a PDF document. That can be useful to use Vim to see the differences between the text in two versions of a pdf. You need to install xpdf (available on all major platforms) as it provides the pdftotext utility to read the text from a pdf file.
Evince is the default document viewer for PDF (Portable Document Format) and PostScript files but can also display other formats, such as images. It is designed to make reading documents a simple and hassle-free experience, and has intuitive previewing, indexing and searching capabilities.
As said by @Ken in the comments, you should use gx
:
Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
best seen with a special handler (ie. a tool provided with your computer).
Netrw allows one to invoke such special handlers by:
* when Exploring, hit the "x" key
* when editing, hit gx with the cursor atop the special filename
More information can be found in :help gx
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With